swash/scale/
proxy.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use super::{
    super::{metrics::MetricsProxy, strike::BitmapStrikesProxy, FontRef},
    color::ColorProxy,
};

#[derive(Copy, Clone)]
pub struct ScalerProxy {
    pub metrics: MetricsProxy,
    pub color: ColorProxy,
    pub bitmaps: BitmapStrikesProxy,
    pub coord_count: u16,
}

impl ScalerProxy {
    pub fn from_font(font: &FontRef) -> Self {
        Self {
            metrics: MetricsProxy::from_font(font),
            color: ColorProxy::from_font(font),
            bitmaps: BitmapStrikesProxy::from_font(font),
            coord_count: font.variations().len() as u16,
        }
    }
}