diff --git a/src/font/locator/mod.rs b/src/font/locator/mod.rs index c7cb40d9c..c2f60e0bb 100644 --- a/src/font/locator/mod.rs +++ b/src/font/locator/mod.rs @@ -18,8 +18,15 @@ pub mod font_loader; /// collection if the data represents a collection of /// fonts. pub enum FontDataHandle { - OnDisk { path: PathBuf, index: u32 }, - Memory { data: Vec, index: u32 }, + OnDisk { + path: PathBuf, + index: u32, + }, + #[allow(dead_code)] + Memory { + data: Vec, + index: u32, + }, } impl std::fmt::Debug for FontDataHandle { diff --git a/src/font/units.rs b/src/font/units.rs index 182fd6ef3..6a4ba273f 100644 --- a/src/font/units.rs +++ b/src/font/units.rs @@ -1,38 +1,3 @@ -use euclid::{Length, Scale}; - pub type PixelUnit = window::PixelUnit; -pub struct FontUnit; -pub struct PointUnit; -pub struct EMUnit; - -/// The length of a side of the imaginary EM square -/// which sets the resolution of a glyph. -/// eg: an EMSize of 2048 means that there are 2048 -/// FontUnit's per em square. -/// 1em corresponds to the selected point size of a font. -pub type EMSize = Length; - -/// A dimension expressed in font coordinates. -/// For example, if the EMSize is 2000 and we have a FontLength -/// of 500, it represents 500/2000 or 1/4 of the nominal size -/// of a glyph. -pub type FontLength = Length; - -/// Describes a distance measured in points. -pub type PointLength = Length; - -/// Returns the scaling factor required to convert from -/// points to pixels at a given dpi; multiply a `PointLength` by -/// this to produce a `PixelLength` -pub fn pixels_per_point(dpi: u32) -> Scale { - Scale::new(dpi as f64 / 72.) -} - -/// Returns the scaling factor required to convert from -/// font units in a particular font to points. -pub fn units_per_em(units_per_em: EMSize) -> Scale { - Scale::new(1.0 / units_per_em.get() as f64) -} - pub type PixelLength = euclid::Length; -pub type IntPixelLength = isize; // euclid::Length; +pub type IntPixelLength = isize; diff --git a/window/src/bitmaps/atlas.rs b/window/src/bitmaps/atlas.rs index 6d7dbe524..cb5622d12 100644 --- a/window/src/bitmaps/atlas.rs +++ b/window/src/bitmaps/atlas.rs @@ -66,8 +66,6 @@ where // We pad each sprite reservation with blank space to avoid // surprising and unexpected artifacts when the texture is // interpolated on to the render surface. - // In addition, we need to ensure that the bottom left pixel - // is blank as we use that for whitespace glyphs. let reserve_width = width + 2; let reserve_height = height + 2;