Skip to content

Commit

Permalink
Conversion: Fix font subsetting not working for CJK fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Sep 19, 2013
1 parent 2bd084b commit ba8f9d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/calibre/utils/fonts/sfnt/cmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def get_glyph_ids(self, codes):
glyph_id = self.glyph_id_map[idx]
if glyph_id != 0:
glyph_id += self.id_delta[i]
yield glyph_id % 0x1000
yield glyph_id % 0x10000
break
if not found:
yield 0
Expand All @@ -159,7 +159,7 @@ def get_glyph_map(self, glyph_ids):
glyph_id = self.glyph_id_map[idx]
if glyph_id != 0:
glyph_id += self.id_delta[i]
glyph_id %= 0x1000
glyph_id %= 0x10000
if glyph_id in glyph_ids and code not in ans:
ans[code] = glyph_id
return ans
Expand Down
2 changes: 1 addition & 1 deletion src/calibre/utils/fonts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def get_bmp_glyph_ids(table, bmp, codes):
glyph_id = glyph_id_map[idx]
if glyph_id != 0:
glyph_id += id_delta[i]
yield glyph_id % 0x1000
yield glyph_id % 0x10000
break
if not found:
yield 0
Expand Down

0 comments on commit ba8f9d1

Please sign in to comment.