mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fix emoji advance in PDF export (#4325)
This commit is contained in:
parent
a9b3273a2b
commit
9afd247534
@ -69,7 +69,8 @@ pub fn write_color_fonts(
|
|||||||
.font
|
.font
|
||||||
.advance(color_glyph.gid)
|
.advance(color_glyph.gid)
|
||||||
.unwrap_or(Em::new(0.0))
|
.unwrap_or(Em::new(0.0))
|
||||||
.to_font_units();
|
.get() as f32
|
||||||
|
* scale_factor;
|
||||||
widths.push(width);
|
widths.push(width);
|
||||||
chunk
|
chunk
|
||||||
.stream(
|
.stream(
|
||||||
@ -239,8 +240,10 @@ impl ColorFontMap<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let frame = frame_for_glyph(font, gid);
|
let frame = frame_for_glyph(font, gid);
|
||||||
let width = font.advance(gid).unwrap_or(Em::new(0.0)).to_font_units();
|
let width =
|
||||||
let instructions = content::build(&mut self.resources, &frame, Some(width));
|
font.advance(gid).unwrap_or(Em::new(0.0)).get() * font.units_per_em();
|
||||||
|
let instructions =
|
||||||
|
content::build(&mut self.resources, &frame, Some(width as f32));
|
||||||
color_font.glyphs.push(ColorGlyph { gid, instructions });
|
color_font.glyphs.push(ColorGlyph { gid, instructions });
|
||||||
color_font.glyph_indices.insert(gid, index);
|
color_font.glyph_indices.insert(gid, index);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user