notofonts / notobuilder

Python module for building Noto fonts
9 stars 0 forks source link

Single "megafont" covering all scripts covered by all Noto fonts #12

Open hakanai opened 7 years ago

hakanai commented 7 years ago

We are cursed with multiple inconvenient PDF generation libraries which can't do font fallback, so we want a single "megafont" which covers as much as possible. Arial Unicode is currently being used for this, but its licence prevents us redistributing it ourselves.

So the news of Noto was exciting. The news was billing it as a single font which covers everything. But the download page doesn't look like that at all. Instead of a single font which covers everything, I see multiple fonts which each cover a subset. So it doesn't solve our problem at all. :(

Can we not have a single font which covers everything the individual Noto fonts cover?

dougfelt commented 7 years ago

Strictly speaking, no, because there are many more glyphs in Noto than can fit into a single font. CJK alone is as large as it can get.

In addition, different scripts prefer different line metrics. Noto tries to provide suitable line metrics for each script rather than forcing all scripts to fit one. The UI fonts are an exception to this, however, so using them we could generate a single font sharing a single line height.

That said, we are working on a possible repackaging of the fonts into a few files. We can probably get one for CJK, one for common scripts in living languages, and one for obscure scripts-- depends if Tangut pushes us over the limit of what non-CJK we can fit into a single font . There are tools that can be used to merge fonts but the devil is in the details-- some common characters are in a few source fonts and if they behave differently we'd have to work that out.

hakanai commented 7 years ago

Ouch, I wasn't aware that the current, latest format we use for font files couldn't even fit one glyph for each character currently in Unicode...

brawer commented 7 years ago

You could try merging things yourself, for example with the merge tool in fontools. But as Doug said, you’ll run into OpenType limit of 64K glyphs per file. Which PDF generation libraries do you use? Have you asked them to implement font fallback?

jungshik commented 7 years ago

some common characters are in a few source fonts and if they behave differently we'd have to work that out.

One possibility for them is to add opentype 'loca' features to pick different glyphs for common characters per 'locale/lang' when merging fonts with common characters. However, PDF generation tools that cannot deal with font fallback are not likely to take advantage of opentype 'loca'.

The same thing can be said of using BASE tables to support scripts with different metrics in a combined font.

brawer commented 7 years ago

@trejkaz, which specific PDF generation libraries are you using?

KrasnayaPloshchad commented 7 years ago

That is what GNU FreeFont and DejaVu fonts does anyway, but they doesn’t receive CJK. BTW I think your PDF generating tools seems badly.

hakanai commented 7 years ago

@brawer, quite a lot of different ones, actually... iText is one example where you would pretty much have to implement font fallback yourself to get it to do it at all.