From b0cbe870b3fc3a118784d51a1a7efb3a49dbf094 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 2 Nov 2024 16:35:34 +0000 Subject: [PATCH] Generate 'cmap' table for TTX TTX currently refuses to compile it, but I suspect that's because the font still has no glyphs. --- bedstead.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/bedstead.c b/bedstead.c index 632e363..fee42d8 100644 --- a/bedstead.c +++ b/bedstead.c @@ -198,6 +198,7 @@ static void domosaic(unsigned code, bool sep); static void domosaic4(unsigned code, bool sep); static void doalias(char const *alias_of); static void dopanose(void); +static void docmap(int pid, int eid, int format); static void glyph_complement(void); static void bdf_gen(int size); @@ -2993,6 +2994,13 @@ main(int argc, char **argv) NAME(0x114, "4-cell separated graphics"); NAME(0x116, "6-cell separated graphics"); printf(" \n"); + + printf(" \n"); + docmap(0, 3, 4); /* Unicode 2.0+, BMP only */ + docmap(0, 4, 12); /* Unicode 2.0+, full repertoire */ + docmap(3, 1, 4); /* Windows Unicode, BMP only */ + docmap(3, 10, 12); /* Windows Unicode, full repertoire */ + printf(" \n"); /* printf("FontName: %s\n", fullname_to_fontname(get_fullname())); */ /* printf("FullName: %s\n", get_fullname()); */ /* printf("FamilyName: Bedstead\n"); */ @@ -3249,6 +3257,28 @@ dopanose(void) panose[5], panose[6], panose[7], panose[8], panose[9]); } +static void +docmap(int pid, int eid, int format) +{ + int i; + long limit = 0x10000; + + printf(" \n"); + for (i = 0; i < nglyphs; i++) + if (glyphs[i].unicode >= 0 && + glyphs[i].unicode < limit) + printf(" \n", + (long)glyphs[i].unicode, glyphs[i].name); + printf(" \n", format); +} + static void dopalt(struct glyph const *g) { -- 2.30.2