﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,phab_field
2457,[PATCH] Better font support,sanderd17,,"I don't exactly know if this should be part of the l10n branch. It isn't really dependent on it (nor the other way around), but it is somehow related, and I don't want to lose the work.

Basically, I made fontbuilder support fallback fonts. The primary and fallback fonts are mixed into one font texture which can be used by the Engine. I've experienced that, apart from packaging size, this method doesn't have many drawbacks. The textures seem to get cached on a per-glyph base. Which means that, if you don't use the huge amount of Chinese glyphs, they'll never get cached. 

Only font generation time has increase a big deal, but as all Chinese glyphs have the same bounding box, the naive placement algorithm tends to use even less texture space than the smart algorithm. This is because the entire Chinese unicode block fits into a perfect grid, and takes up 90% of the total texture space. While the smart algorithm leaves this grid, and creates quite some holes.

The charset.txt, and the generator for that file have become unnecessary too. Finding out which ranges were used for which languages was too much work. Instead, all glyphs available in the font are rendered.

I also edited the GUI text renderer to mark every Chinese glyph as the end of a word. Chinese texts use no spaces, so the text was seen as one word, which didn't get divided over several lines. 

As fallback fonts, I added FreeFont (https://www.gnu.org/software/freefont/) and Hanazono Mincho (for which Wikipedia says it's available under a free license: http://en.wikipedia.org/wiki/Open-source_Unicode_typefaces and http://en.wikipedia.org/wiki/List_of_CJK_fonts )

Those fonts aren't in the patch, though they're easy to install.

There's still no support for RTL text, and it will require quite some changes in the text renderer (see http://www.unicode.org/reports/tr9/)",enhancement,new,Nice to Have,Alpha 16,Core engine,,patch review,,
