Forum Bugs

Font-variant/font-feature-settings ss01 is ineffective on Fraunces

gerph
Hiya,

I'm trying to create a document using the Fraunces font from Google. This font has a stylistic set feature which makes some letters more fancy. The letters look fine but the & does not - it is overly fancy - and I want to turn that off. The way to do that, according to the page (https://fonts.google.com/specimen/Fraunces#type-tester), is to disable the stylistic set 1, which should be the default.

In Prince, I always get the fancy &. In Firefox and Chrome, I always get the non-fancy &.
So something must be wrong, but I thought I'd followed the guidance in the Prince documentation for how to configure this.

I attach...

* The HTML content that shows the different ways of controlling the ss01 setting - specifically the use of the font-variant with prince-opentype(ss01(n)) and the font-feature-settings.
* The PDF generated by prince (14.2, running on macOS).
* PNGs taken from the output, so that you can see what I see.

I think this is a bug because I've followed the advice given - the fact that it doesn't work in the browser suggests that it might be something I'm doing wrong here, but I don't know why and one of those settings should have made it work, I'm sure.

Can you suggest what I need to do to disable the stylistic set and get back to the plain & ?
  1. Browser-AlwaysPlain.png46.8 kB
    In the browse it is always plain.
  2. Prince-AlwaysFancy.png40.3 kB
    In the Prince PDF it is always fancy.
  3. sset-example.html1.8 kB
    HTML matrix of the ways of changing ss01
  4. sset-example.pdf47.0 kB
    PDF matrix of the ways of changing ss01
mikeday
I'm not seeing any "ss01" feature (or in fact many features at all) in the Fraunces font files available from Google Fonts, but it does seem to be present in the font files released on GitHub.

Using the font file from GitHub makes prince-opentype(ss01) work, but I'm not sure why Prince is getting a different ampersand from the browser though with the font files from Google Fonts.
gerph
That's made me wonder if they were doing browser sniffing to deliver different content.. and sure enough they are - https://developers.google.com/fonts/docs/technical_considerations describes what's going on a little bit.

Firefox uses a user-agent like this:

wget --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:90.0) Gecko/20100101 Firefox/90.0' 'https://fonts.googleapis.com/css2?family=Fraunces&display=swap'


which gives me:

/* vietnamese */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/fraunces/v22/6NUh8FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0K7iN7hzFUPJH58nib1603gg7S2nfgRYIctxuTBv7Vp05GNyXkb24.woff) format('woff');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/fraunces/v22/6NUh8FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0K7iN7hzFUPJH58nib1603gg7S2nfgRYIctxuTB_7Vp05GNyXkb24.woff) format('woff');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/fraunces/v22/6NUh8FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0K7iN7hzFUPJH58nib1603gg7S2nfgRYIctxuTCf7Vp05GNyXk.woff) format('woff');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


Whilst if I request with the default user-agent for wget I get:

wget 'https://fonts.googleapis.com/css2?family=Fraunces&display=swap'


@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/fraunces/v22/6NUh8FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0K7iN7hzFUPJH58nib1603gg7S2nfgRYIctxujDg.ttf) format('truetype');
}


Could this be part of the problem I'm facing here? It's certainly going to confuse matters if the content differs depending on the perceived agent at the server side.

mikeday
That is a problem yes, but I was looking at the WOFF2 font served to Firefox and that does not appear to contain the ss01 feature either, so there's something else going on here too.