chiark / gitweb /
Add a comment explaining the purpose of aalt_overrides
authorBen Harris <bjh21@bjh21.me.uk>
Thu, 2 Jan 2025 00:27:50 +0000 (00:27 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Thu, 2 Jan 2025 00:27:50 +0000 (00:27 +0000)
bedstead.c

index e2410d6191bfd959a7dd2ebaa06e5bfd44b95040..1bfe8a5e217186b697d4f6f5c48ed40231c3b6d9 100644 (file)
@@ -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