diff --git a/crates/text/src/color.rs b/crates/text/src/color.rs index 101dabc9..85509214 100644 --- a/crates/text/src/color.rs +++ b/crates/text/src/color.rs @@ -136,9 +136,10 @@ impl Face { made } - /// Read a strike bitmap and place it. The formula is the one Skia (and CoreText behind it) - /// uses: bearings are in font units and scale with the em, the origin offsets and the image - /// with the strike's ppem, and an sbix image is measured from its lower-left corner. + /// Read a strike bitmap and place it the way Skia's fontations port does + /// (`src/ports/fontations/src/bitmap.rs`): the outer bearings are in font units and scale with + /// the em, the inner ones are pixels at the strike's ppem, and an sbix image is measured from + /// its lower-left corner (the spec places the graphic's origin at the glyph box's xMin, yMin). fn read_bitmap(&self, gid: u32, size: f64) -> Option { let gid = GlyphId::new(gid); let font = FontRef::from_index(self.bytes.data(), self.index).ok()?; diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index a83fa0fe..24e6495b 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -639,7 +639,7 @@ impl FontDb { } /// Colour emoji faces, for characters no other fallback covers. Kept out of - /// [`fallbacks`](Self::fallbacks) because the files are large (Apple Color Emoji is ~190 MB) + /// [`fallbacks`](Self::fallbacks) because the files are large (Apple Color Emoji is ~180 MB) /// and only texts that actually show emoji need them; each family reads one face. pub fn emoji_fallbacks(&mut self) -> Vec> { let mut out = Vec::new(); @@ -725,7 +725,7 @@ fn scan_dir(dir: &std::path::Path, depth: usize, out: &mut BTreeMap, box_height: Option) for s in &styles { faces.push(dbw.find(&s.font_family, &s.font_style).or_else(|| dbw.default_face())); } - // Colour emoji are their own, large faces (Apple Color Emoji is ~190 MB): they are read only + // Colour emoji are their own, large faces (Apple Color Emoji is ~180 MB): they are read only // for a text whose characters nothing above covers. let covered = |c: char| c == '\n' || faces.iter().flatten().any(|f| f.has_char(c)) || fallbacks.iter().any(|f| f.has_char(c)); if chars.iter().any(|c| !covered(*c)) {