Use hb_ft_face_create
. The stream->base
might be null.
IIRC @matthiasc added palette selection to Pango; or at least to cairo.
As for supporting SVG fonts, it's doable these days using FreeType+rsvg; but needs to be set up by the client. I don't know of any client that does that.
You should seriously consider using COLRv1 fonts though.
This is now making me question whether Windows supports format13 cmap subtables at all.
How about this giant font using format12 cmap?
This is now making me question whether Windows supports format13 cmap subtables at all.
I thought fontBuilder does that automatically.
The other change is that FontForge added the three other "recommended" glyphs.
The 3 version doesn't have the format13 cmap at all.
FWIW, this is the code I used to build this one:
from fontTools.fontBuilder import FontBuilder, buildCmapSubTable
from fontTools.ttLib import newTable
from fontTools.ttLib.tables._g_l_y_f import Glyph
from fontTools.pens.ttGlyphPen import TTGlyphPen
from fontTools import unicodedata
upem = 128
fb = FontBuilder(unitsPerEm=upem)
glyphOrder = [".notdef", "space", "block", "halfblock", "doubleblock"]
fb.setupGlyphOrder(glyphOrder)
glyphs = {k: Glyph() for k in glyphOrder}
pen = TTGlyphPen()
pen.moveTo((0, 0))
pen.lineTo((upem // 2, 0))
pen.lineTo((upem // 2, upem))
pen.lineTo((0, upem))
pen.closePath()
glyphs["block"] = pen.glyph()
pen = TTGlyphPen()
pen.moveTo((0, 0))
pen.lineTo((upem // 2, 0))
pen.lineTo((upem // 2, upem // 2))
pen.lineTo((0, upem // 2))
pen.closePath()
glyphs["halfblock"] = pen.glyph()
pen = TTGlyphPen()
pen.moveTo((0, 0))
pen.lineTo((upem, 0))
pen.lineTo((upem, upem))
pen.lineTo((0, upem))
pen.closePath()
glyphs["doubleblock"] = pen.glyph()
fb.setupGlyf(glyphs)
cmapping = {}
for u in range(0x10FFFF + 1):
gc = unicodedata.category(chr(u))
ea = unicodedata.east_asian_width(chr(u))
if ea in ("F", "W"):
cmapping[u] = "doubleblock"
elif gc in ("Lu", "Lt"):
cmapping[u] = "block"
elif gc in ("Ll", "Lm", "Lo", "Nd", "Nl", "No"):
cmapping[u] = "halfblock"
else:
cmapping[u] = "space"
cmapSubTable = buildCmapSubTable(cmapping, 13, 3, 10)
fb.font["cmap"] = newTable("cmap")
fb.font["cmap"].tableVersion = 0
fb.font["cmap"].tables = [cmapSubTable]
fb.setupHorizontalMetrics({k: (upem // 2, 0) for k in glyphs})
fb.setupOS2(sTypoAscender=upem, sTypoDescender=0, usWinAscent=upem, usWinDescent=0)
fb.setupHorizontalHeader(ascent=upem, descent=0)
fb.setupNameTable({"familyName": "BuilderBlocks2", "styleName": "Regular"})
fb.setupPost()
fb.save('BuilderBlocks2.ttf')
@Zacharymk1213 Please test this one.
No. The font is a glyf
-table font. So CFF
doesn't make sense even. hdmx
is optional. etc etc.
Anyway, lemme produce a font with fontBuilder. I'm working on it.
The tool looks useless... The font has no CFF
, hdmx
, etc tables but it's giving errors about those!
This is the beginning. I think the wrong head table checksum might be doing it now.
I'll rewrite the font production code today using fontBuilder(), which should fix all these issues.
I managed to build just fine. But I was getting hundreds of error, which wasn't useful. Also it's UI was hard to use in my high-dpi monitor...
Thanks. You can try building https://github.com/HinTak/Font-Validator/ and seeing what it thinks about the font.
cc @khaledhosny Do you have a Windows machine? Can you help here? I tried FontValidator from HinTak but it gave me hundreds of errors...
Looks like OS/2 table missing. Let me try to add one.
Okay lemme try to build Font-Validator and see what it thinks of the font.