googlefonts / Inconsolata

Development repo of Inconsolata Fonts by Raph Levien
http://levien.com/type/myfonts/inconsolata.html
SIL Open Font License 1.1
1.32k stars 64 forks source link

How can vtt_hinting.ttx be regenerated? #53

Closed spwhitton closed 4 years ago

spwhitton commented 4 years ago

Hello,

I am looking into updating the version of Inconsolata in Debian. It seems that the file sources/vtt_hinting.ttx does not get regenerated using the documented build process. Could you explain how that file can be produced, please?

I won't be able to update Inconsolata in Debian unless it can be reproduced using only free software.

I don't know much about fonts -- thank you for your patience.

raphlinus commented 4 years ago

This file was generated using proprietary tools (VTT in particular), and there certainly isn't a free toolchain that can do this. @m4rc1e may have more insight into what we can do here, particularly if we've had a similar experience with other free fonts for which there is a desire to make Debian packaged versions. See #48 for the original commit that included this content.

One possibility to explore is a non-hinted variable version, as hand-generated proprietary hints cause other problems with updatability of the font. My long term vision for this is for variable font renderers to do a good job with client-side autohinting, and I have a proposal in to Google Fonts to explore this in more detail.

Just a note: autohinting for static instances works beautifully, thanks to ttfautohint. The reason why we're having trouble now is the intersection of hinting (targeted to Windows) and variable fonts.

spwhitton commented 4 years ago

Thank you, this is very helpful. It sounds like I can go ahead and rebuild and install all the files under fonts/ttf and fonts/otf for Debian, which would be an improvement over the current situation where we don't even have a bold variant. If and when it's possible for us to rebuild the variable versions too, we can add them to the package.

raphlinus commented 4 years ago

That sounds like a reasonable compromise. Best of luck!

m4rc1e commented 4 years ago

As Raph pointed out, the hinting was made using Microsoft VTT. VTT doesn't produce the xml source. This is produced using DaMa's vttLib, https://github.com/daltonmaag/vttLib. It has the ability to dump, merge and compile hints.

I won't be able to update Inconsolata in Debian unless it can be reproduced using only free software.

AFAIK, you can download it for free here, https://docs.microsoft.com/en-us/typography/tools/vtt/. However, I don't know what license it has. The build chain will install vttLib and compile the hinted variable font

We added VTT hinting because rendering on Windows was pretty bad for certain OS and Browser combos.

m4rc1e commented 4 years ago

Regarding your original question, you can produce the vtt_hinting.ttx file by doing the following from the parent dir:

# Merge vtt_hinting.ttx into a ttf so it can be edited using VTT
python -m vttLib mergefile sources/vtt_hinting.ttx fonts/variable/Inconsolata\[wdth\,wght\].ttf

# Export newly edited hinting back to vtt_hinting.ttx
python -m vttLib dumpfile fonts/variable/Inconsolata\[wdth\,wght\].ttf sources/vtt_hinting.ttx
spwhitton commented 4 years ago

Just to be clear, you use the mergefile command, execute (proprietary) VTT, and then use the dumpfile command?

m4rc1e commented 4 years ago

Yes

spwhitton commented 4 years ago

Thanks again.