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

Edit svg font with missing horiz-adv-x #6

Open
EllenWasbo opened this issue Aug 14, 2021 · 0 comments
Open

Edit svg font with missing horiz-adv-x #6

EllenWasbo opened this issue Aug 14, 2021 · 0 comments

Comments

@EllenWasbo
Copy link

I was converting a ttf fot to svg using FontForge and when trying to edit this using the Custom Stroke Font - Edit Font it failed and I got nothing. It turned out that there was quite a few glyphs in the svg from FontForge missing the horiz-adv-x attribute. I guess this is a bug in while FontForge generate svg-font (the left/right bearings of those glyphs look fine when inspecting them in FontForge). Anyway - this problem was fixed by changing line 114 of stroke_font_manager.py

From
rOffset = float(e.getAttribute(xROff))

To
if e.getAttribute(xROff) == "":
rOffset = 0
else:
rOffset = float(e.getAttribute(xROff))

Ideally there should be a warning in the end that some (ideally which) glyphs had missing horiz-adv-x and that this is set to 0, or it could be set to the width of the bounding box to have something that might work - not as strange and obviously wrong as 0.

At least this made it possible to continue editing the font. So I'm happy with this solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant