nothings/stb

stb_truetype.h: Support Font Variations

Open

#509 opened on Oct 13, 2017

View on GitHub
 (5 comments) (0 reactions) (0 assignees)C (33,640 stars) (8,054 forks)batch import
1 stb_truetype4 enhancementhelp wanted

Description

I figure this is probably goes along with adding support for hinting. However there is some fonts where a lot of data is missing because of the lack of support for Font Variations. The two major variations for this are as follows:

Variation 1: Apple Advanced Typography (AAT) - This is Apple's Variation on TrueType Fonts, and has a slightly different signature than OpenType. This is still a good reference since a lot of the behavior is the same in this, and OpenType. The only difference may be the table name is changed.

Variation 2: OpenType Version 1.8.2 or newer - This includes most of the tables used by Apple, and adds a few mores. Also, Collections for OpenType use the OTC file extension.

To help with implementation, I have a list of the tables that need implementing to add this feature, and you can find the list in the table below...

Table Name Description AAT Support OpenType Support
avar Axis Variations Table Y Y
cvar Control Value Variations table. Y Y
fvar Font Variation Table Y Y
gvar Glyph Variation Table Y Y
name Name Table Y Y
HVAR Horizontal Metrics Variations N Y
MVAR Metrics Variations Table N Y
VVAR Vertical Metrics Variations N Y
ttcf TrueType Collections Table N Y

Also, Since there is a need for fonts to test to make sure this works, you can find the fonts in the following list. In general these fonts have have two downloadable versions where one version includes the Font Variations, and the other version has the fonts variations as separate font files.

Contributor guide