From 94b0c2e7954bd5222f1909b07301da351d99d6f4 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 31 Oct 2021 14:38:39 +0200 Subject: FontPack: Debug message about collection size --- src/fontpack.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/fontpack.c b/src/fontpack.c index 78181fd4..52ee93be 100644 --- a/src/fontpack.c +++ b/src/fontpack.c @@ -79,6 +79,15 @@ void init_FontFile(iFontFile *d) { static void load_FontFile_(iFontFile *d, const iBlock *data) { set_Block(&d->sourceData, data); +#if 0 + /* Count the number of available fonts. */ + for (int i = 0; ; i++) { + if (stbtt_GetFontOffsetForIndex(constData_Block(&d->sourceData), i) < 0) { + printf("%s: contains %d fonts\n", cstr_String(&d->id), i); + break; + } + } +#endif const size_t offset = stbtt_GetFontOffsetForIndex(constData_Block(&d->sourceData), d->colIndex); stbtt_InitFont(&d->stbInfo, constData_Block(data), offset); -- cgit v1.2.3