mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion: Fix font subsetting not working for CJK fonts
This commit is contained in:
parent
2bd084ba23
commit
ba8f9d10ca
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user