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
Help with the creation of an OTF-SVG #28
Comments
Hi Frederico, To assemble the OT-SVG font you're using your own scripts, as opposed to using the ones provided with I also don't know how well Inkscape or LuaLaTeX PDF support OpenType-SVG fonts. It's possible that the issues you're facing are caused by bugs in those applications, rather than problems with your font. Having said that, I'll mention a few points that might help you with your project:
|
Thank you so much. I still don't have a clear rule to follow for rescaling the images, but your words pointed me towards a rule of thumbs that works in my case. I managed to obtain a meaningful size by transposing and rescaling the SVG using a transform attribute and then applying the transform attribute to each inner object using an Inkscape extension (without using Inkscape, actually, only its python extension module |
cross-linking: fonttools/fonttools#3229 |
I am opening this issue only because I think you can really help me with this problem. Basically, I have an SVG an OTF font and I want to attach the SVG to the font programmatically. For this, I'm using
opentype-svg
andfonttools
, but the final font contains badly scaled glyphs.Here the problem is explained in more details. Here is the source code for reproducing the issue: Archive.zip
1. Dummy Font Creation
First, I create a dummy font having dummy glyphs. In this example, only the glyph
a
is created. For this, I use fontforge.To run the script, install fontforge and python and run
fontforge -script example_dummy.py
. A file namedDummyFont.otf
will be created. It's also attached in the zip.2. Attaching SVG Files
The second step is to attach SVG files in the SVG table of the font. As suggested by opentypesvg tool, I remove both widht and height, as well as the viewport property of the
<svg>
tag. The problem is that the SVGs are not rescaled properly. In both LuaTeX and Inkscape, they appear to have a small size compared to the glyph viewport. Below are two screenshots of the result.To run the script, run
pip install opentypesvg fonttools
and thenpython example_svg.py
. A file namedDummyFontSvg.otf
will be created. It's also attached in the zip.3. Result
Terminal output: (note that SVG and font have the same viewport and that font is correctly validated by fontforge)
Inkscape: (the green background is the text-selection color of one character, it shows the maximum size a glyph can have)
LuaLaTeX PDF:
The text was updated successfully, but these errors were encountered: