Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Commit

Permalink
change: wide comma to japanese reading point
Browse files Browse the repository at this point in the history
  • Loading branch information
atoring committed May 17, 2018
1 parent f739efe commit f2f20fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion binfont/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def encode():
tex.extend(d)
bin.extend(tex)
bin.extend(struct.pack("<I", len(chrs)))
tmp = bytearray()
for c in chrs:
id,x,y,w,h,xoffset,yoffset,xadvance,page,chnl = (c["id"],c["x"],c["y"],c["width"],c["height"],c["xoffset"],c["yoffset"],c["xadvance"],c["page"],c["chnl"])
left = x
Expand All @@ -177,7 +178,13 @@ def encode():
top += 6
if h > 6*2:
bottom -= 6
bin.extend(struct.pack("<fffffffHH", left,right,top,bottom,_width,offset_left,offset_top,code,tex))
# ja patch
if code == 0x3001: # 「、」
tmp = struct.pack("<fffffffHH", left,right,top,bottom,_width,offset_left,offset_top,0xff0c,tex)
if code == 0xff0c: # 「,」
bin.extend(tmp)
else:
bin.extend(struct.pack("<fffffffHH", left,right,top,bottom,_width,offset_left,offset_top,code,tex))
bin.extend(struct.pack("<fff", 46.25,0.0,7.03125))

write_bin("./out/notosanscjksc-medium.otf.binfont", bin)
Expand Down
Binary file modified binfont/out/notosanscjksc-medium.otf.binfont.zip
Binary file not shown.

0 comments on commit f2f20fe

Please sign in to comment.