Conversion: Fix font subsetting not working for CJK fonts

This commit is contained in:
Kovid Goyal 2013-09-19 12:41:30 +05:30
parent 2bd084ba23
commit ba8f9d10ca
2 changed files with 3 additions and 3 deletions

View File

@ -141,7 +141,7 @@ class BMPTable(object):
glyph_id = self.glyph_id_map[idx] glyph_id = self.glyph_id_map[idx]
if glyph_id != 0: if glyph_id != 0:
glyph_id += self.id_delta[i] glyph_id += self.id_delta[i]
yield glyph_id % 0x1000 yield glyph_id % 0x10000
break break
if not found: if not found:
yield 0 yield 0
@ -159,7 +159,7 @@ class BMPTable(object):
glyph_id = self.glyph_id_map[idx] glyph_id = self.glyph_id_map[idx]
if glyph_id != 0: if glyph_id != 0:
glyph_id += self.id_delta[i] glyph_id += self.id_delta[i]
glyph_id %= 0x1000 glyph_id %= 0x10000
if glyph_id in glyph_ids and code not in ans: if glyph_id in glyph_ids and code not in ans:
ans[code] = glyph_id ans[code] = glyph_id
return ans return ans

View File

@ -350,7 +350,7 @@ def get_bmp_glyph_ids(table, bmp, codes):
glyph_id = glyph_id_map[idx] glyph_id = glyph_id_map[idx]
if glyph_id != 0: if glyph_id != 0:
glyph_id += id_delta[i] glyph_id += id_delta[i]
yield glyph_id % 0x1000 yield glyph_id % 0x10000
break break
if not found: if not found:
yield 0 yield 0