Don’t mark fonts with glyf table as bitmap fonts
The bitmap font detection condition is now close to the original condition
changed in 95d2c37.
Fix #2328.
This commit is contained in:
+10
-1
@@ -88,7 +88,16 @@ class Font:
|
||||
for i in range(table_count[0]):
|
||||
harfbuzz.hb_tag_to_string(table_tags[i], table_name)
|
||||
self.tables.append(ffi.string(table_name).decode())
|
||||
self.bitmap = 'EBDT' in self.tables and 'EBLC' in self.tables
|
||||
self.bitmap = False
|
||||
if 'EBDT' in self.tables and 'EBLC' in self.tables:
|
||||
if 'glyf' in self.tables:
|
||||
tag = harfbuzz.hb_tag_from_string(b'glyf', -1)
|
||||
blob = harfbuzz.hb_face_reference_table(self.hb_face, tag)
|
||||
if harfbuzz.hb_blob_get_length(blob) == 0:
|
||||
self.bitmap = True
|
||||
harfbuzz.hb_blob_destroy(blob)
|
||||
else:
|
||||
self.bitmap = True
|
||||
self.italic_angle = 0 # TODO: this should be different
|
||||
self.upem = harfbuzz.hb_face_get_upem(self.hb_face)
|
||||
self.png = harfbuzz.hb_ot_color_has_png(self.hb_face)
|
||||
|
||||
@@ -22,7 +22,9 @@ ffi.cdef('''
|
||||
hb_blob_t * hb_face_reference_blob (hb_face_t *face);
|
||||
unsigned int hb_face_get_index (const hb_face_t *face);
|
||||
unsigned int hb_face_get_upem (const hb_face_t *face);
|
||||
hb_blob_t * hb_face_reference_table (const hb_face_t *face, hb_tag_t tag);
|
||||
const char * hb_blob_get_data (hb_blob_t *blob, unsigned int *length);
|
||||
unsigned int hb_blob_get_length (hb_blob_t *blob);
|
||||
bool hb_ot_color_has_png (hb_face_t *face);
|
||||
hb_blob_t * hb_ot_color_glyph_reference_png (hb_font_t *font, hb_codepoint_t glyph);
|
||||
bool hb_ot_color_has_svg (hb_face_t *face);
|
||||
|
||||
Reference in New Issue
Block a user