-
I am trying to instantiate a font from an variable font. I wrote this code this code and it give me this font and this XML. from fontTools import ttLib
from fontTools.varLib import instancer
fontsTtLib = ttLib.TTFont(r'Akshar-VariableFont_wght.ttf')
defaultCoordinates = {}
for axis in fontsTtLib["fvar"].axes:
defaultCoordinates[axis.axisTag] = axis.defaultValue
newFont = instancer.instantiateVariableFont(fontsTtLib, defaultCoordinates, updateFontNames=True)
newFont['name'].setName("test example", 1, 3, 1, 0x409)
newFont['name'].setName("test example", 4, 3, 1, 0x409)
newFont.save("test.ttf")
newFont.saveXML("test.xml") When I installed the font in windows 10, I can see it in Does this mean instantiateVariableFont has a little problem or it mean windows has problem? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
First, where the font file is located depends on how you installed it. Second, you have some issues with the name fields inside the font. So you need to fix the name fields so they are all consistent. |
Beta Was this translation helpful? Give feedback.
First, where the font file is located depends on how you installed it.
Right-click and select "Install for all users" will put it in
C:\Windows\Fonts
.If you use the Window Font Viewer and then click the
Install
buttonthat will install the font in your user font folder.
Hit
Windows
key +R
to open a Run dialog, and paste this below,%localappdata%\Microsoft\Windows\Fonts\
and click
OK
That will open a File Explorer window for your user fonts folder.
The font file is probably installed there.
Second, you have some issues with the name fields inside the font.
The style group name is "test example",
but the "Typo" name and some of the other name fields are "Akshar-Light".
Word, LibreOffice …