From: Ben Harris Date: Sat, 2 Nov 2024 15:26:04 +0000 (+0000) Subject: Generate 'name' table for TTX X-Git-Tag: bedstead-3.246~71 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=75ad9bc47985d3813908ba44f99d0720fa477229;p=bedstead-debian.git Generate 'name' table for TTX --- diff --git a/bedstead.c b/bedstead.c index e3a69b8..632e363 100644 --- a/bedstead.c +++ b/bedstead.c @@ -2950,28 +2950,52 @@ main(int argc, char **argv) TTXI(usBreakChar, 32); TTXI(usMaxContext, 1); /* No pair subs. */ printf(" \n"); + + printf(" \n"); + /* Encode each name in Mac Roman and Windows UTF-16. */ +#define NAMEF(id, f, ...) \ + printf(" " \ + f "\n" \ + " " \ + f "\n", \ + (int)(id), __VA_ARGS__, (int)(id), __VA_ARGS__) +#define NAME(id, s) NAMEF(id, "%s", s) + NAME(0, "Dedicated to the public domain"); + if ((weight->ttfweight == 500 || weight->ttfweight == 700) && + width->suffix[0] == '\0') { + /* Normal width; regular or bold */ + NAME(1, "Bedstead"); + NAME(2, weight->suffix[0] ? weight->suffix + 1 : "Regular"); + } else { + /* + * Slightly unusual face, so we need to set the + * "Preferred" family and style. + */ + NAMEF(1, "Bedstead%s%s", + weight->ttfweight == 700 ? "" : weight->suffix, + width->suffix); + NAME(2, + weight->ttfweight == 700 ? weight->suffix+1 : "Regular"); + NAME(16, "Bedstead"); + NAMEF(17, "%s%s", weight->suffix[0] ? weight->suffix+1 : "", + weight->suffix[0] ? width->suffix : + width->suffix[0] ? width->suffix+1 : ""); + } + NAME(4, get_fullname()); + NAME(5, "Version " VERSION); + NAME(6, fullname_to_fontname(get_fullname())); + /* Stylistic set names. */ + NAME(0x101, "SAA5051"); + NAME(0x102, "SAA5052"); + NAME(0x104, "SAA5054"); + NAME(0x114, "4-cell separated graphics"); + NAME(0x116, "6-cell separated graphics"); + printf(" \n"); /* printf("FontName: %s\n", fullname_to_fontname(get_fullname())); */ /* printf("FullName: %s\n", get_fullname()); */ /* printf("FamilyName: Bedstead\n"); */ - /* if ((weight->ttfweight == 500 || weight->ttfweight == 700) && */ - /* width->suffix[0] == '\0') */ - /* /\* Normal width; regular or bold *\/ */ - /* printf("LangName: 1033 \"\" \"Bedstead\" \"%s\"\n", */ - /* weight->suffix[0] ? weight->suffix + 1 : "Regular"); */ - /* else */ - /* /\* */ - /* * Slightly unusual face, so we need to set the */ - /* * "Preferred" family and style. */ - /* *\/ */ - /* printf("LangName: 1033 \"\" \"Bedstead%s%s\" \"%s\" \"\" \"\" " */ - /* "\"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" " */ - /* "\"\" \"Bedstead\" \"%s%s\"\n", */ - /* weight->ttfweight == 700 ? "" : weight->suffix, */ - /* width->suffix, */ - /* weight->ttfweight == 700 ? weight->suffix+1 : "Regular", */ - /* weight->suffix[0] ? weight->suffix+1 : "", */ - /* weight->suffix[0] ? width->suffix : */ - /* width->suffix[0] ? width->suffix+1 : ""); */ /* printf("Weight:%s\n", weight->suffix[0] ? weight->suffix : " Medium"); */ /* printf("Copyright: Dedicated to the public domain\n"); */ /* printf("Version: 002.009\n"); */