The OpenType specification is amazing! It describes a huge range of things you can do inside OpenType fonts, and tells you everything you need to implement that functionality.
But sometimes you just want someone else to do it for you. If you’re working on color font support, or vertical typesetting, or mathematics, or justification, you just want an example font you can poke about with, take apart, or try in your application.
That’s what this repository is for.
CFF-Outlines.otf
This contains the glyphs A
and B
in PostScript (CFF) outlines. The glyphs handily tell you that they are CFF-based.
If you see some gobbledegook below, go here to see this site in its full glory.
TrueType-Outlines.ttf
This contains the glyphs A
and B
in TrueType (glyf
table) outlines. The glyphs handily tell you that they are glyf
-based.
CFF-and-TrueType-Together.otf
This contains the glyphs A
and B
, but with both CFF
and glyf
tables. The sfnt wrapper has an OpenType (OTTO
) magic number.
CFF-and-TrueType-Together.ttf
This contains the glyphs A
and B
, but with both CFF
and glyf
tables. The sfnt wrapper has a TrueType (\01\00\00\00
) magic number.
CFF-Outlines-and-COLR.otf
This contains the glyphs A
and B
, with CFF outlines but also with color font (COLR
/ CPAL
table format). The color outlines handily tell you that they are COLR-based.
CFF-Outlines-and-SVG.otf
This contains the glyphs A
and B
, with CFF outlines but also with SVG
outlines. The color outlines handily tell you that they are SVG-based.
CFF-COLR-and-SVG.otf
This contains the glyphs A
and B
, with CFF outlines but also with SVG
and COLR
/ CPAL
outlines. Which outlines will your rendering software show? Place your bets now!
CFF-and-SBIX.otf
This contains the glyphs A
and B
with CFF outlines, but also with sbix
(“Apple colour”) bitmaps for the glyph “A”. Four strikes (bitmap sizes) are provided: 512, 256, 128 and 64. Each bitmap describes its own size.
CBDT.otf
This contains the glyph A
with a CBDT color bitmap image.
CombiningMarkTest-Regular.otf
This contains seven glyphs: e, o, a combining acute mark, a legacy (U+00B4) acute accent (self-describing), a combining dieresis mark, a precomposed e-acute (self-describing), and a precomposed o-dieresis (self-describing) which should never be seen because of a ccmp
feature which substitutes it with o dieresiscomb
. It does not contain precomposed o-acute or e-dieresis. mark
and mkmk
features are provided for positioning the marks.
The following div contains:
If the final two glyphs are rendered correctly, the dieresis should appear centered and high above the o (at the same level as the e-dieresis).
BaselineTest-Regular-with-BASE.otf
BaselineTest-Regular-without-BASE.otf
These two fonts test the processing of the OpenType BASE table. Both contain two glyphs, L and 道. The “with BASE” version contains the following BASE table:
table BASE {
HorizAxis.BaseTagList ideo romn ;
HorizAxis.BaseScriptList
latn romn -310 0,
hani ideo -310 0;
} BASE;
Here is the “with” version:
Here is the “without” version:
FallbackPlus-Regular.otf
This font is designed as an “OpenType feature playground”. It contains glyphs for all assigned and named Unicode codepoints from U+0000 to U+1FFFF (just over 32,000 glyphs in total). The glyphs are self-describing, reflecting their codepoint. The idea is that this is a base font that you then add your own shaping rules to using addfeatures.py
:
$ cat test.fea
feature calt {
sub uni0061 uni0062' uni0063 by uni0064;
} calt;
$ python3 addfeatures.py -o Fallback-abcd.otf FallbackPlus-Regular.otf test.fea
$ hb-shape Fallback-abcd.otf 'abc'
[uni0061=0+600|uni0064=1+600|uni0063=2+600]
To allow you further leeway for testing rules, the font also includes 99 spare (unencoded) glyphs, named glyph00
-glyph99
:
$ cat test.fea
feature calt {
sub uni0061 uni0062 uni0063 by glyph01;
sub glyph01 by uni0063 uni0062 uni0061;
sub uni0064 by glyph02;
} calt;
$ python3 addfeatures.py -o Fallback-abcd.otf FallbackPlus-Regular.otf test.fea
$ hb-shape Fallback-abcd.otf
[uni0063=0+600|uni0062=0+600|uni0061=0+600|glyph02=3+600]
The font is especially useful for understanding shaper behaviour when handling complex scripts. For example, here we see the way that the shaper, without any explicit rules from the font, reorders pre-base consonants in the Myanmar script to go before the base character:
$ hb-shape FallbackPlus-Regular.otf -u '1000 1001 103C'
[uni1000=0+600|uni103C=1+600|uni1001=1+600]
Here’s what the actual font looks like with a few random codepoints:
This is mainly for my own reference, because I’m going to forget, but may be useful if you want to subset or extend the range of glyphs. To build the font from the Fallback Plus Source.ufo
file, first run generate-fallback.py
to create Fallback Plus.ufo
. Next run:
fontmake --optimize-cff 1 -u Fallback\ Plus.ufo -o otf --keep-overlaps
This will produce an un-optimized OTF file in master_otf
. Currently this file breaks compreffor if you use the default C++ implementation, so you have to use the slower but safer Python implementation instead:
compreffor --py master_otf/Fallback\ Plus.otf FallbackPlus-Regular.otf