From 948ce7dc952d154fd50da52383964588f302d17a Mon Sep 17 00:00:00 2001 From: meyer Date: Mon, 11 Nov 2024 16:06:46 +0200 Subject: [PATCH] Temporarily ignore `flip` graphic type See also: - https://github.com/python-pillow/Pillow/issues/7854 - https://gitlab.freedesktop.org/freetype/freetype/-/issues/1282 --- src/TrueTypeFont.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/TrueTypeFont.ts b/src/TrueTypeFont.ts index c43f2d19..cbf9d10f 100644 --- a/src/TrueTypeFont.ts +++ b/src/TrueTypeFont.ts @@ -208,9 +208,13 @@ export class TrueTypeFont { const offset = this.tableOffsetsByTag.sbix + strikeOffset.offset + currentGlyphOffset; const graphicType = await bp.tag(offset + 4); - invariant(graphicType === 'png ', 'Not a PNG!'); - const data = await bp.readBytes(size - 8, offset + 8); + if (graphicType === "flip") { + console.error('TODO: add flip support'); + continue; + } + + invariant(graphicType === 'png ', 'Expected `png `, received `%s`', graphicType); yield { data, name }; }