From: Ben Harris Date: Thu, 2 Jan 2025 00:27:50 +0000 (+0000) Subject: Add a comment explaining the purpose of aalt_overrides X-Git-Tag: bedstead-3.251~47 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=ad5c57432161232497cf8856a5e3bb9a002e1b9c;p=bedstead.git Add a comment explaining the purpose of aalt_overrides --- diff --git a/bedstead.c b/bedstead.c index e2410d6..1bfe8a5 100644 --- a/bedstead.c +++ b/bedstead.c @@ -2693,6 +2693,19 @@ static int const nglyphs = NGLYPHS; static struct glyph const *glyphs_by_name[NGLYPHS]; +/* + * This array defines 'aalt' mappings that should not be automatically + * generated from glyph names. The OpenType specification says that + * different fonts in the same family should order the results of the + * 'aalt' lookup the same, which implies that applications might + * reasonably record the index of an alternative. To avoid breaking + * such applications when Bedstead is upgraded, we want to ensure that + * any such indexes in an old version of a font still work in newer + * (minor) versions. For most AlternateSets in the 'aalt' lookup, + * this will happen naturally, but where it doesn't, this table + * explicitly specifies the list of alternative glyphs so that they + * match older versions. + */ #define MAX_ALT_SUB_OVERRIDE 3 static struct alt_sub_override { char const *base; @@ -2701,12 +2714,12 @@ static struct alt_sub_override { { "D", { "D.c2sc", "D.serif", "D.narrow" } }, { "J", { "J.c2sc", "J.narrow", "J.narrow" } }, { "L", { "L.c2sc", "L.narrow", "L.narrow" } }, - { "ccedilla", { "ccedilla.angular", "ccedilla.sc" } }, // maybe not? + { "ccedilla", { "ccedilla.angular", "ccedilla.sc" } }, { "colon", { "colon.leftsmall", "colon.leftsmall" } }, - { "ocircumflex", { "ocircumflex.large", "ocircumflex.sc" } }, // maybe not? + { "ocircumflex", { "ocircumflex.large", "ocircumflex.sc" } }, { "question", { "question.open", "question.open" } }, { "semicolon", { "semicolon.left", "semicolon.left" } }, - { "ugrave", { "ugrave.roundjoined", "ugrave.sc" } }, // maybe not? + { "ugrave", { "ugrave.roundjoined", "ugrave.sc" } }, }; #define MAXSUBS 10