Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignoring_center に含まれる各文字の幅がわずかに小さい #30

Merged
merged 4 commits into from
Jul 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion cica.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def set_os2_values(_font, _info):
_font.hhea_descent = 100
_font.hhea_descent_add = True
_font.hhea_linegap = 0
_font.os2_panose = (2, 11, weight / 100, 9, 2, 2, 3, 2, 2, 7)
_font.os2_panose = (2, 11, int(weight / 100), 9, 2, 2, 3, 2, 2, 7)
return _font

def align_to_center(_g):
Expand Down Expand Up @@ -556,8 +556,18 @@ def build_font(_f):
]
for g in cica.glyphs():
g.transform((0.91,0,0,0.91,0,0))
full_half_threshold = 700
if _f.get('italic'):
g.transform(psMat.skew(0.25))
skew_amount = g.font.ascent * 0.91 * 0.25
g.width = g.width + skew_amount
full_half_threshold += skew_amount
if g.width > full_half_threshold:
width = 1024
else:
width = 512
g.transform(psMat.translate((width - g.width)/2, 0))
g.width = width
if g.encoding in ignoring_center:
pass
else:
Expand Down