mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
parent
15c5c81b1f
commit
0f221521ab
3 changed files with 26 additions and 18 deletions
|
@ -1800,16 +1800,18 @@ impl ScaledFontExtensionMethods for ScaledFont {
|
|||
for slice in run.natural_word_slices_in_visual_order(range) {
|
||||
for glyph in slice.glyphs.iter_glyphs_for_byte_range(&slice.range) {
|
||||
let glyph_advance = glyph.advance();
|
||||
let glyph_offset = glyph.offset().unwrap_or(Point2D::zero());
|
||||
let azglyph = struct__AzGlyph {
|
||||
mIndex: glyph.id() as u32,
|
||||
mPosition: struct__AzPoint {
|
||||
x: (origin.x + glyph_offset.x).to_f32_px(),
|
||||
y: (origin.y + glyph_offset.y).to_f32_px(),
|
||||
}
|
||||
};
|
||||
origin = Point2D::new(origin.x + glyph_advance, origin.y);
|
||||
azglyphs.push(azglyph)
|
||||
if !slice.glyphs.is_whitespace() {
|
||||
let glyph_offset = glyph.offset().unwrap_or(Point2D::zero());
|
||||
let azglyph = struct__AzGlyph {
|
||||
mIndex: glyph.id() as u32,
|
||||
mPosition: struct__AzPoint {
|
||||
x: (origin.x + glyph_offset.x).to_f32_px(),
|
||||
y: (origin.y + glyph_offset.y).to_f32_px(),
|
||||
}
|
||||
};
|
||||
azglyphs.push(azglyph)
|
||||
}
|
||||
origin.x = origin.x + glyph_advance;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue