Skip to content

Commit 27b59fd

Browse files
committed
Drop non-useful tables
1 parent 7a866c6 commit 27b59fd

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

ttj/src/lib.rs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,23 @@ pub fn table_diff(font_a: &FontRef, font_b: &FontRef, max_changes: usize, no_mat
172172
log::info!("Glyph names differ dramatically between fonts, using font names from font A");
173173
}
174174

175-
diff(
176-
&font_to_json(font_a, Some(&glyphmap_a)),
177-
&font_to_json(
178-
font_b,
179-
Some(if big_difference {
180-
&glyphmap_a
181-
} else {
182-
&glyphmap_b
183-
}),
184-
),
185-
max_changes,
186-
)
175+
let mut font_a_json = font_to_json(font_a, Some(&glyphmap_a));
176+
let mut font_b_json = font_to_json(
177+
font_b,
178+
Some(if big_difference {
179+
&glyphmap_a
180+
} else {
181+
&glyphmap_b
182+
}),
183+
);
184+
185+
// Remove some tables which aren't useful
186+
font_a_json.as_object_mut().unwrap().remove("glyf");
187+
font_b_json.as_object_mut().unwrap().remove("glyf");
188+
font_a_json.as_object_mut().unwrap().remove("loca");
189+
font_b_json.as_object_mut().unwrap().remove("loca");
190+
191+
diff(&font_a_json, &font_b_json, max_changes)
187192
}
188193

189194
/// Compare two fonts and return a JSON representation of the differences in kerning

0 commit comments

Comments
 (0)