Skip to content

Commit fe7a0a2

Browse files
committed
Don't copy cvt, fpgm, and prep if we use interjection
1 parent fb8d0aa commit fe7a0a2

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/lib.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,15 @@ fn _subset(mut ctx: Context) -> Result<Vec<u8>> {
221221
if ctx.flavor == FontFlavor::TrueType {
222222
// LOCA will be handled by GLYF
223223
ctx.process(Tag::GLYF)?;
224-
ctx.process(Tag::CVT)?; // won't be subsetted.
225-
ctx.process(Tag::FPGM)?; // won't be subsetted.
226-
ctx.process(Tag::PREP)?; // won't be subsetted.
224+
225+
// Only copy hinting tables if we don't interject because skrifa will
226+
// discard hinting information.
227+
// TODO: Add a test for this.
228+
if !ctx.interjector.is_skrifa() {
229+
ctx.process(Tag::CVT)?; // won't be subsetted.
230+
ctx.process(Tag::FPGM)?; // won't be subsetted.
231+
ctx.process(Tag::PREP)?; // won't be subsetted.
232+
}
227233
} else if ctx.flavor == FontFlavor::Cff {
228234
ctx.process(Tag::CFF)?;
229235
} else if ctx.flavor == FontFlavor::Cff2 {

0 commit comments

Comments
 (0)