Skip to content

Commit

Permalink
correct rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstrema committed Sep 15, 2020
1 parent f1f873d commit 4c40ee7
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 30 deletions.
Binary file modified redist/Saxy.otf
Binary file not shown.
Binary file modified redist/Saxy.ttf
Binary file not shown.
Binary file modified redist/saxy.woff2
Binary file not shown.
52 changes: 26 additions & 26 deletions src/MASTER.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions src/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def set_font_attributes(font):
font.familyname = font_name
font.fullname = font_name
font.comment = font_comments
font.design_size = 1
font.fontlog = font_comments
font.design_size = 3

def add_kerning(font):
s_index = svg_map.index(master_char)
Expand All @@ -46,14 +47,20 @@ def add_kerning(font):
font.addKerningClass("kern", "kern-1", tuple(svg_map), tuple(svg_map), tuple(offsets_tuple))

if __name__ == "__main__":
svg_map = generate_svgs.generate(master_svg, output_dir, template_svg, master_char, ["nine"])
svg_map = generate_svgs.generate(master_svg, output_dir, template_svg, "", ["nine"])

font = fontforge.font() # new font
for char in svg_map:
glyph = font.createMappedChar(char)
glyph.importOutlines(os.path.join(output_dir, char + '.svg'))
glyph.width = 0

# import merge char
merge_char = font.createMappedChar(master_char)
merge_char.importOutlines('merge.svg')
merge_char.width = 0
svg_map.append(master_char)

# Normal space char is to large
glyph = font.createMappedChar("space")
glyph.width = space_size
Expand Down
5 changes: 4 additions & 1 deletion src/generate_svgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def generate(filename, output_dir, template_filename, merge_char, exclude_from_m
generate_svgs(names, values, template, output_dir)
generate_merge(merge_char, names, values, template,
output_dir, exclude_from_master_char)
names.append(merge_char)
if not merge_char == "":
names.append(merge_char)
return names


Expand All @@ -47,6 +48,8 @@ def check_output_dir(output_dir):


def generate_merge(merge_char, names, values, template: str, output_dir, exclude_from_master_char):
if merge_char == "":
return
inside_str = ""
for index in range(len(names)):
if not names[index] in exclude_from_master_char:
Expand Down
23 changes: 23 additions & 0 deletions src/merge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4c40ee7

Please sign in to comment.