Using Unicode Half-Stars Symbols in Ratings
15 points by abnercoimbre
15 points by abnercoimbre
You can use the [CSS unicode-range] descriptor to specify that Noto Sans is only used for some characters. That (unfortuantely) doesn't save you from downloading the whole file, but I think it should allow the browser to only load them when it's actually required from the page?
Of course there have been ways to ship reduced fonts that only support some glyphs, but I don't think Google Fonts support that and a "free to use" license might not always imply a "free to modify" license.
The font in question, Noto Sans Symbols 2, is under the SIL Open Font Licence, so you're allowed to modify it as long as the modified version does not use a "Reserved Font Name":
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
...and Google doesn't seem to have specified a Reserved Font Name.
Subsetting the font to include just the one half-star glyph you actually want to use is surely the right way to go.
Curious if others can see them. From the article:
Half-stars and half-filled stars (in both directions) were proposed in 2016 and added to Unicode 11 in 2018. You can see them here:
⯨⯩⯪⯫
…or maybe you can’t, because even after eight years, font support for them is still spotty.
On Fedora and Firefox, I see them both on the article and in your comment.
Author mentions using Google fonts to get a font that will show more uncommon characters. Coincidentally, this site uses an uncommon character for the upvote arrow (which are actually two, one for neutral, one for upvoted) and on some enviroments, the browser used different fonts to render it. The solution (which I hope has worked for everyone) was to use system-ui, i.e. whatever font your OS for the UI, cause it surely is more complete than whatever font the browser chooses at random.
macOS Firefox and I see placeholder glyphs in your comment as well as the original article. Pretty sure that's some anti-fingerprinting settting I have.
Can't see them with firefox on a stock-ish android, and I don't think I've messed with fonts... Kind of surprised that the case, but I haven't looked muxh into it.
Plain Firefox on plain Android, I see 4 gray squares
Same on my plain Firefox on plain iOS. On the latest macOS it's the same deal, although different browsers render the fallback / missing glyph differently!
even after eight years, font support for them is still spotty.
I use these symbols in my notes which I always edit in Iosevka, so I requested them and the Iosevka maintainer kindly obliged. :)
I wonder if any other font maintainers would accept a similar request?
Your issue actually reinforces my comment that system-ui is a great font; the starts are rendered by Adwaita Mono here. I know it's based on Iosevka, but Adwaita Mono is, perhaps, more widely available that Iosevka.