iojs.org icon indicating copy to clipboard operation
iojs.org copied to clipboard

Font used for the website, to accomodate all languages

Open AntouanK opened this issue 10 years ago • 19 comments

The font currently used, Lato, does not have character subsets needed from other languages ( greek for example ). So those languages will default to Sans-Serif and the text in the page will be a mix of two fonts. Not cool.

Maybe we should choose another font? One that can have the characters we need for a proper i18n website.

AntouanK avatar Feb 11 '15 17:02 AntouanK

I would suggest possibly a language specific style sheet that is included in the build for that language? Then they can @font-face include whatever font they want? I would probably want to restrict it to CDN'd fonts like Google Fonts to avoid the massive headache of font conversion and upkeep.

therebelrobot avatar Feb 11 '15 17:02 therebelrobot

There are versions of Lato with the full glyph set available:

http://www.latofonts.com/lato-free-fonts/#download

These are quite heavy though, 300kB before gzip.

silverwind avatar Feb 12 '15 16:02 silverwind

Hmm, well we can probably do locale+english for each i18n locale, that might work.

Fishrock123 avatar Feb 12 '15 16:02 Fishrock123

@silverwind You're right. I'm wondering why they are not in the google fonts website.

@Fishrock123 Yeah, each i18n team will make a font with english + the subset they need. So in CSS you can include that font only. Or we can inline them with base64, to avoid making that extra call ( if you want to be performant for some reason )

AntouanK avatar Feb 12 '15 17:02 AntouanK

Or we can inline them with base64, to avoid making that extra call ( if you want to be performant for some reason )

That's not guaranteed to be more performant though. :)

it's probably best to have each separate and marked as cacheable for a long time. Gzip actually makes the inital data overhead smaller.

Fishrock123 avatar Feb 12 '15 17:02 Fishrock123

+1 to not base64 encoding it. Though I still would prefer a CDN'd font rather than hosting ourselves. Whatever works for the teams, though.

therebelrobot avatar Feb 12 '15 17:02 therebelrobot

@Fishrock123 the inlined text will also be Gzipped, right? :P Well, difference is really small anyway.

AntouanK avatar Feb 12 '15 17:02 AntouanK

Google does offer a Latin Extended (latin-ext) subset, not sure if that's enough:

@import url(http://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext);

silverwind avatar Feb 12 '15 17:02 silverwind

@silverwind definitely not enough, considering we have active Chinese / Japanese / greek / etc translations. :)

Fishrock123 avatar Feb 12 '15 17:02 Fishrock123

Lato-Regular.woff goes from 323172 to 312473 bytes after gzipping, so not much gains there. Converting to woff2 might shave off another 20%, but overall you're looking at 250kB gzipped per font weight :(

silverwind avatar Feb 12 '15 17:02 silverwind

@silverwind woff is already compressed. :)

Fishrock123 avatar Feb 12 '15 17:02 Fishrock123

Yeah, probably not worth gzipping it at all.

silverwind avatar Feb 12 '15 17:02 silverwind

Forget the gzipping part.

All we (you) have to do is give the ability to every team, to include their font. It's up to them to make a Lato font with English+whatever they need.

Then we can fight over perf stuff. :)

AntouanK avatar Feb 12 '15 17:02 AntouanK

Google’s Noto Sans fonts (http://www.google.com/get/noto/) provide a remarkably consistent look for many languages (similar stroke weights, for example). Localized sites in other languages may still need to include English for technical terms, and consistency between the fonts used for different scripts will be important.

These fonts are also available via the Google Fonts CDN.

aravindet avatar Feb 12 '15 19:02 aravindet

One thing I need to say is, we shouldn't use web fonts on Chinese since the font files are very big (usually 2MB+). Since then, we need a lot fallback font family rules to make it looks nice on every platform and every browser. What's more, people in Mainland China can't use any Google services, including Google Fonts & APIs. It's not a good idea to choose Google for CDN service in this way.

laosb avatar Feb 16 '15 13:02 laosb

So, do we have any updates on the font issue? @therebelrobot

AntouanK avatar Feb 17 '15 11:02 AntouanK

Just to weigth in on Noto: The chinese variants are like 20MiB each, so definitely out of question to serve these directly. I think a font stack of local "nice looking" fonts it the only way to go.

silverwind avatar Feb 17 '15 16:02 silverwind

@silverwind Sounds good. Waiting for the build step though so we can add a font...

AntouanK avatar Feb 17 '15 16:02 AntouanK

Sorry, I've had an enormously busy week. I'll be looking into a build step for this today, though it may need to hold off until we begin the rebuild off the new website design #181

therebelrobot avatar Feb 22 '15 15:02 therebelrobot