stipub / stixfonts

OpenType Unicode fonts for Scientific, Technical, and Mathematical texts
SIL Open Font License 1.1
728 stars 41 forks source link

Add Unicode 14.0 math script style variation selector mappings #218

Open tiroj opened 3 years ago

tiroj commented 3 years ago

Unicode 14.0 defines new standardised variation selector sequences for chancery vs roundhand script styles of math alphabetics, but only for uppercase letters and only in regular weight:

# Mathematical alphabet script variants

1D49C FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL A
212C FE00;  chancery style; #  SCRIPT CAPITAL B
1D49E FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL C
1D49F FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL D
2130 FE00;  chancery style; #  SCRIPT CAPITAL E
2131 FE00;  chancery style; #  SCRIPT CAPITAL F
1D4A2 FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL G
210B FE00;  chancery style; #  SCRIPT CAPITAL H
2110 FE00;  chancery style; #  SCRIPT CAPITAL I
1D4A5 FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL J
1D4A6 FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL K
2112 FE00;  chancery style; #  SCRIPT CAPITAL L
2133 FE00;  chancery style; #  SCRIPT CAPITAL M
1D4A9 FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL N
1D4AA FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL O
1D4AB FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL P
1D4AC FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL Q
211B FE00;  chancery style; #  SCRIPT CAPITAL R
1D4AE FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL S
1D4AF FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL T
1D4B0 FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL U
1D4B1 FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL V
1D4B2 FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL W
1D4B3 FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL X
1D4B4 FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL Y
1D4B5 FE00; chancery style; #  MATHEMATICAL SCRIPT CAPITAL Z

1D49C FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL A
212C FE01;  roundhand style; #  SCRIPT CAPITAL B
1D49E FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL C
1D49F FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL D
2130 FE01;  roundhand style; #  SCRIPT CAPITAL E
2131 FE01;  roundhand style; #  SCRIPT CAPITAL F
1D4A2 FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL G
210B FE01;  roundhand style; #  SCRIPT CAPITAL H
2110 FE01;  roundhand style; #  SCRIPT CAPITAL I
1D4A5 FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL J
1D4A6 FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL K
2112 FE01;  roundhand style; #  SCRIPT CAPITAL L
2133 FE01;  roundhand style; #  SCRIPT CAPITAL M
1D4A9 FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL N
1D4AA FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL O
1D4AB FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL P
1D4AC FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL Q
211B FE01;  roundhand style; #  SCRIPT CAPITAL R
1D4AE FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL S
1D4AF FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL T
1D4B0 FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL U
1D4B1 FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL V
1D4B2 FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL W
1D4B3 FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL X
1D4B4 FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL Y
1D4B5 FE01; roundhand style; #  MATHEMATICAL SCRIPT CAPITAL Z

For 2.20, the second (roundhand) set of these has been added to the format 14 cmap subtable. The chancery set of variation selector sequences is not needed in the STIX Two Math font because the chancery forms are default. [Note: if someone were to fork the STIX Two Math font to make a version in which the roundhand forms were default, it would be necessary to update the format 14 cmap subtable accordingly.]

The roundhand script style glyphs—including the lowercase and the bold style—are still also mapped in the Stylistic Set ss01 feature, as in v2.10

tiroj commented 3 years ago

Duplicate issue. Deleted.

ctrlcctrlv commented 2 years ago

I think this issue was wrongly closed.

Has anyone actually confirmed that this works?

I did a TTX dump of STIXTwoMath-Regular:

ttx ~/.fonts/s/STIXTwoMath-Regular.ttf

Making sure I have the right version:

fred@mapache:/opt/share/sile$ ftdump ~/.fonts/s/STIXTwoMath-Regular.ttf
There is 1 face in this file.

----- Face number: 0 -----

font name entries
   family:              STIX Two Math
   style:               Regular
   postscript:          STIXTwoMath-Regular
   created:             2020-12-16
   modified:            2021-05-17
   revision:            2.13
   glyph count:         6760
      simple:           6041
      composite:        699
      empty:            20

font type entries
   FreeType driver:     truetype
   sfnt wrapped:        yes
   type:                scalable
   direction:           horizontal
   fixed width:         no
   glyph names:         yes
   EM size:             1000
   global BBox:         (-978,-1641):(3072,2627)
   ascender:            762
   descender:           -238
   height:              1250
   max_advance_width:   3072
   max_advance_height:  1250
   underline_position:  -103
   underline_thickness: 51

charmaps (5)
   0: unic, platform 0, encoding  3, format  4, language 0 
   1: unic, platform 0, encoding  4, format 12, language 0 
   2: unic, platform 0, encoding  5, format 14, UVS
   3: unic, platform 3, encoding  1, format  4, language 0 
 * 4: unic, platform 3, encoding 10, format 12, language 0

This just cannot work how you think it does.

rg uvs= /home/fred/.fonts/s/STIXTwoMath-Regular.ttx |bat --language=xml

image

Right?? Am I going nuts or are the mathematical script characters not even in the UVS cmap??

pkra commented 2 years ago

This was a duplicate of https://github.com/stipub/stixfonts/issues/187 -- but both issues are slated for the 2.20 release so no current release has these.

ctrlcctrlv commented 2 years ago

why were they both closed as completed then :\

pkra commented 2 years ago

Very likely because they are fixed in the source files.

ctrlcctrlv commented 2 years ago

i see but they require a proprietary editor to build and i lost like an hour debugging SILE before deciding to make sure the font actually works as advertised

i'm not complaining, i should have verified sooner, but maybe don't mark issues closed in future if they aren't in a release or at least in master :-)

firai commented 2 years ago

John explained his process and rationale for closing issues that he fixed in the sources in https://github.com/stipub/stixfonts/issues/227.

tiroj commented 2 years ago

Hi Fred. Sorry about that. The STIX development is a little complicated because issues are collected in the public repo but STI Pub like to have delivery of beta fonts privately before releasing them into the wild. I agree that it isn’t ideal to be closing the public issues before the fixes are applied to the public release, and now regret doing that: I was not anticipating the public release being delayed so long.

I’ll go back and reopen issues to ensure appropriate review when the new versions are pushed, and use labels to indicate source fixes delivered to STI Pub.

[I am on sabbatical at the moment, but will be touching base with @davidmjones in September re. some math kerning testing outcomes that remain a concern.]

tiroj commented 2 years ago

Updated sources and fonts delivered to STI Pub for testing. Issue reopened pending public release.