chiark / gitweb /
Add character variant for curly apostrophe (SAA5051/2)
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 18 Jan 2025 13:48:59 +0000 (13:48 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 19 Jan 2025 00:49:30 +0000 (00:49 +0000)
Unicode takes the position that U+0027 APOSTROPHE is always a straight
apostrophe and is you want a curly one you should use U+2019 RIGHT
SINGLE QUOTATION MARK (or U+02BC MODIFIER LETTER APOSTROPHE but let's
not get into that here).  Bedstead generally follows that, putting the
SAA5050 straight apostrophe at U+0027 and the SAA5055 curly one at
U+2019.

Older character standards, though, conflated those two and treated the
difference between them as one of font design.  In particular, ETS 300
706: May 1997, "Enhanced Teletext specification" treats position 2/7 as
being the same character in all national sub-sets of the Latin G0
primary set.  When coverting Teletext data to Unicode, ZVBI maps 2/7 to
U+0027 whichever national sub-set is in use.

This means that to faithfully display Teletext data in the way that an
SAA5051/2 would, Bedstead needs to interpret U+0027 as a curly
apostrophe.  I have accomplished this by adding a new "apostrophe.curly"
alias and including that in the 'ss01' and 'ss02' Stylistic Sets.  It
also, of course, gains a new Character Variant feature, 'cv07', so that
you can turn the curly apostrophe on and off independently.

This does cause me to wonder whether there should be a stylistic set to
map U+0020..U+007E onto the SAA5055 glyphs.

bedstead-faces.css
bedstead.c

index 4db70b61d4c3fa66a2e9a9319b98a33858b41812..529faf5d826897a514f953a21004ecca590f5a87 100644 (file)
         saa5054: 4;
     }
     @character-variant {
+        apostrophe-default: 6 1;
+        apostrophe-curly: 6 2
         comma-default: 12 1;
         comma-left: 12 2;
         period-default: 14 1;
index 28f649cf5445c97d75cb36c45760b68fef0e4938..401ee0f9fd532104c420da6d1859b50efdb3edaa 100644 (file)
@@ -520,6 +520,7 @@ static struct glyph {
   */
 
  /* Basic Latin */
+ ALIAS("quotesingle.curly", "quoteright"),
  ALIAS("A.c2sc", "uni1D00"),
  ALIAS("B.c2sc", "uni0299"),
  ALIAS("C.c2sc", "uni1D04"),
@@ -2845,6 +2846,7 @@ static struct alt_sub_override {
  * are then used to create 'cvXX' features and grouped into 'ssXX'
  * features.
  */
+#define CV07(V) V("quotesingle", ".curly")
 #define CV12(V) V("comma", ".left")
 #define CV14(V) V("period", ".large")
 #define CV26(V) V("colon", ".leftsmall")
@@ -2940,13 +2942,15 @@ static struct gsub_feature {
 #define SUFFIXSUB2(base, suffix1, suffix2, ...) SUB(base, base suffix2)
 #define SINGLESUB(x) "<SingleSubst>\n" x "</SingleSubst>\n"
        { "ss01", SCRIPT_ALL, .name = "SAA5051",
-         .xml = SINGLESUB(CV12(SUFFIXSUB1) CV14(SUFFIXSUB1) CV26(SUFFIXSUB1)
+         .xml = SINGLESUB(CV07(SUFFIXSUB1) CV12(SUFFIXSUB1)
+                          CV14(SUFFIXSUB1) CV26(SUFFIXSUB1)
                           CV27(SUFFIXSUB1) CV31(SUFFIXSUB1)
                           CV38(SUFFIXSUB1) CV42(SUFFIXSUB1)
                           CV44(SUFFIXSUB1) CV74(SUFFIXSUB1)
                           CV84(SUFFIXSUB1)) },
        { "ss02", SCRIPT_ALL, .name = "SAA5052",
-         .xml = SINGLESUB(CV12(SUFFIXSUB1) CV14(SUFFIXSUB1) CV26(SUFFIXSUB1)
+         .xml = SINGLESUB(CV07(SUFFIXSUB1) CV12(SUFFIXSUB1)
+                          CV14(SUFFIXSUB1) CV26(SUFFIXSUB1)
                           CV27(SUFFIXSUB1) CV31(SUFFIXSUB1)
                           CV38(SUFFIXSUB2) CV42(SUFFIXSUB1)
                           CV44(SUFFIXSUB1) CV74(SUFFIXSUB1)
@@ -2968,6 +2972,8 @@ static struct gsub_feature {
         * Where possible, Character Variant features have numbers
         * that are 32 less than the ASCII code of the base character.
         */
+       { "cv07", SCRIPT_ALL, .name = "apostrophe variants",
+         .xml = ALTSUB(CV07(CV2)) },
        { "cv12", SCRIPT_ALL, .name = "comma variants",
          .xml = ALTSUB(CV12(CV2)) },
        { "cv14", SCRIPT_ALL, .name = "full-stop variants",