Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

character "ṇ" not displaying correctly in small-caps #362

Closed
JonWFergus opened this issue Mar 2, 2019 · 16 comments
Closed

character "ṇ" not displaying correctly in small-caps #362

JonWFergus opened this issue Mar 2, 2019 · 16 comments

Comments

@JonWFergus
Copy link

JonWFergus commented Mar 2, 2019

Font is Noto-serif (https://fonts.google.com/specimen/Noto+Serif)

The character "ṇ" (U+1E47) doesn't display correctly when using font-variant: small-caps. It displays as the lowercase letter, instead of the corresponding uppercase letter Ṇ (U+1E46). Other variants of "n", i.e. "ñ" do display correctly in small caps.

Edit: just saw that the same issue exists for the character "ṃ" (U+1E43), which should display in small caps as the character "Ṃ" (U+1E42). So I went through and verified that the same issue exists for other bottom-diacritic characters. So far have verified ḍ ṛ ḷ ṭ and ṣ.

Edit 2: tested on 2 devices, multiple browsers. The characters display correctly on my phone (samsung galazy s7) in all browsers. The characters display incorrectly on my laptop (windows 10) in Chrome, Firefox and Opera, but they display correctly in Edge. So I suppose this means it's not a font issue, but rather something in those three browsers?

@marekjez86
Copy link

@JonWFergus : do you have a test html that you are willing to share here (i'd like to place it, with your permission, in https://github.com/googlei18n/noto-source/tree/master/test/English or more "fitting" language in https://github.com/googlei18n/noto-source/tree/master/test )?

@JonWFergus
Copy link
Author

@marekjez86 no problem. I'll link you to the page I'm working on where I first noticed the issue, and I also created a test html for you, showing the characters that are having the issue.

Here's where I noticed the problem: https://universaltheosophy.com/hpb/voiceofthesilence.html
(see on p.47 there, or search for "Vajrapāṇi")

Here's a test html with all the characters I've seen having the problem: https://universaltheosophy.com/hpb/diacritics-test.html

@nizarsq
Copy link

nizarsq commented Jul 1, 2020

@JonWFergus can you check if the issue with small-caps still reproducible on this font: https://github.com/googlefonts/noto-fonts/tree/master/phaseIII_only/hinted/ttf/NotoSerif. Thank you
Screen Shot 2020-07-01 at 3 29 58 PM

@JonWFergus
Copy link
Author

JonWFergus commented Jul 2, 2020

Thanks @nizarsq. I wasn't able to reproduce the issue. The bottom dot diacritic characters look correct in small caps with this updated font.

Edit: see further replies below, showing that the issue is yet unsolved.

@moyogo
Copy link
Contributor

moyogo commented Jul 2, 2020

Isn’t the issue that ḍ ḷ ṇ ṛ ṣ ṭ don’t turn into small capitals when the small-caps smcp feature is enabled?
This is still the case in the screenshots of the latest version.

@moyogo
Copy link
Contributor

moyogo commented Jul 2, 2020

Screenshot 2020-07-02 at 20 03 54

@JonWFergus
Copy link
Author

@moyogo you can check my test html page to see how it looks on your end with the updated font. See here: https://universaltheosophy.com/hpb/diacritics-test.html

This is what I see on my end:

small-caps-test

@moyogo
Copy link
Contributor

moyogo commented Jul 2, 2020

@JonWFergus On your end the browser is generating fake small-caps by uppercasing and reducing the font-size. It doesn’t seem like the small-caps feature is served in the web font you are using or the browser doesn’t use the font small-caps feature. This could also be why you had different results in your initial post.

Compare the following two lines:
image

Or compare these two lines:
image

In each sample, the top line has fake small-caps, the bottom line uses the font’s small-caps.
Notice the difference in:

  • the stroke weight (the fake small-caps look lighter),
  • the height of the small-caps (the fake small-caps are shorter that lowercase letters),
  • the space between the V and the small-caps a (the fake small-caps has them too far appart).

@nizarsq
Copy link

nizarsq commented Jul 2, 2020

@moyogo the screenshot I added is confusing here is the correct one
Screen Shot 2020-07-02 at 1 38 07 PM

@nizarsq
Copy link

nizarsq commented Jul 2, 2020

Here the code I'm using
Screen Shot 2020-07-02 at 1 45 31 PM

@moyogo
Copy link
Contributor

moyogo commented Jul 2, 2020

@nizarsq Can you change the text of the spans with font-variant: small-caps from "Ṇ" to "ṇ"? The font-variant: small-caps property value or the font smcp feature only apply to lowercase.

@nizarsq
Copy link

nizarsq commented Jul 2, 2020

@nizarsq Can you change the text of the spans with font-variant: small-caps from "Ṇ" to "ṇ"? The font-variant: small-caps property value or the font smcp feature only apply to lowercase.

Screen Shot 2020-07-02 at 2 08 19 PM

@kess
Copy link

kess commented Jul 4, 2020

A quick test typeset with XeLaTeX, note that several characters are missing in small-caps form.

(ISO 15919 is used as transliteration scheme below, but others exist...)

Lowercase in black and small caps in red.

testa-noto-kap
As PDF: testa-noto-kap.pdf

Characters again, in plain text:

  • Single dots: ġṁṅẏż ḍḥḷṃṇṛṣṭẓ
  • Double dots: h̤s̤t̤
  • Rings: r̥l̥
  • Lines: āǣēīōū ẖḵḻṉṟs̱ṯẕ
  • Circumflexes: ĉêô
  • Breves: m̆n̆r̆ŭ ḫ
  • Various diacritics: m̐ ñ ś
  • Multiple diacritics: r̥̄l̥̄
  • Diacritics spanning multiple characters: k͟h

@JonWFergus
Copy link
Author

Thanks for the explanation @moyogo. I've checked in Firefox, Chrome and Opera and you're right, it's fake small caps on all of them.

So, I don't understand how I'm supposed to get a browser to give real small caps from a google font. All I'm doing right now is loading the font family from fonts.googleapis, then I use font-variant: small-caps. If the font has small caps, shouldn't that be what the browser uses? Is there something else I need to do that I'm missing?

@josineto
Copy link

josineto commented Jul 8, 2020

@JonWFergus as I answered your comment in Stack Overflow, Google Fonts strip out smcp font feature in their fonts. Because of that, none CSS you apply to the font can give you real small caps.

I tested that last year and don't remember exactly which way I used, but you can try using FontTools. After all, I'm hosting my own font files, optimized using Font Squirrel, getting less server request with a few more bytes in total font sizes.

@JonWFergus
Copy link
Author

JonWFergus commented Jul 8, 2020

Thanks @jzeneto. I was able to verify that you're correct and it does apply to the Noto fonts. Seems like such a strange/pointless thing for google to do. I went ahead and downloaded the Noto Serif font from the main google fonts page and opened it in fontforge and indeed it has no scmp substitution table (no substitution tables at all, in fact), while the NotoSerif Regular font linked to above by @nizarsq does have a scmp substitution table (and many other sub tables).

For everyone else in this discussion: I downloaded the most recent Noto Serif regular font from @nizarsq's link and opened it in fontforge. I can see the smcp substitution table there (table 38), and it is indeed simply missing all the "latin with dots/etc" diacritic glyphs (range from U+1E00 to say U+1EF9), with 4 exceptions.

I was also able to repeat the results @moyogo showed in screenshots above, by loading this font locally and I've updated my test html accordingly (not sure what I had done wrong before when testing the same way). See here: https://universaltheosophy.com/hpb/diacritics-test.html

All that needs to be done now is to add the missing small-caps glyphs in the range I noted above.

@simoncozens simoncozens transferred this issue from notofonts/noto-fonts Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants