Skip to content

Commit

Permalink
better handling of middle line (hyphen)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstrema committed Sep 14, 2020
1 parent a0c7565 commit f1f873d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 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.
2 changes: 1 addition & 1 deletion 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.
2 changes: 1 addition & 1 deletion src/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ 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)
svg_map = generate_svgs.generate(master_svg, output_dir, template_svg, master_char, ["nine"])

font = fontforge.font() # new font
for char in svg_map:
Expand Down
10 changes: 5 additions & 5 deletions src/generate_svgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ def check_output_dir(output_dir):

def generate_merge(merge_char, names, values, template: str, output_dir, exclude_from_master_char):
inside_str = ""
for svg in values:
if not svg in exclude_from_master_char:
inside_str += '\n ' + svg
for index in range(len(names)):
if not names[index] in exclude_from_master_char:
inside_str += '\n ' + values[index]

value = template.replace('<!--$Value-->', inside_str)

value = value.replace('class="key"', 'class="key" fill="none" stroke="black" stroke-width="3px"').replace('class="normal"', 'class="normal" fill="none" stroke="black" stroke-width="3px"')

value = value.replace('class="key"', 'class="key" fill="none" stroke="black" stroke-width="3px"')
value = value.replace('class="normal"', 'class="normal" fill="black" stroke="none" stroke-width="3px"')
with open(os.path.join(os.path.dirname(current_file_path), output_dir, merge_char + ".svg"), 'w') as file:
file.write(value)

Expand Down

0 comments on commit f1f873d

Please sign in to comment.