riperiperi / FreeSO

Re-implementation of The Sims Online.
http://freeso.org
Mozilla Public License 2.0
817 stars 95 forks source link

Support of Cyrillic, Greek and extended latin #154

Closed Cosmatevs closed 4 years ago

Cosmatevs commented 5 years ago
riperiperi commented 4 years ago

Looks very good! Sorry for the delay, must have missed the email. Will look at the new characters and rebuild the msdf font for ingame.

riperiperi commented 4 years ago

I noticed you removed characters from the font including some of the symbols. I'd prefer if they were only added - not removed - as if they are not needed they can simply be excluded from the ini. Symbols like ┛, ♪ were used in the ini, and I notice the only one you didn't remove is the stars (because it it used by upgrades).

The ttf is not distributed with the game (we distribute a font resource generated with the ini config), so the extra size is not an issue. Recently I added support for dynamically loadable "extension" character sets, which the japanese characters in this font could still be used for, rather than pulling an additional font.

The glyphs you've added are brilliant - they look indistinguishable from the maxis ones in terms of style, which is as perfect as you can ask for.

Cosmatevs commented 4 years ago

I've kept non-gothic symbols only, and recreated stars. I'll add back all symbols for now, and recreate them later if they're going to be used.

Japanese characters don't follow the font style and they could be difficult to read in small sizes since they're quite thin. For that reason, I think Japanese should have its own font, like Thai has. By the way, I've deleted Japanese characters because it takes a few seconds to save such a big file and it was some inconvenience for me saving a file frequently. I could add Japanese characters back if you want. (I think the Rounded M+ 2c Bold font matches this font's style well. You can find it on this page, inside rounded-mplus-20150529.zip)

And thanks for your kind words, I tried my best.

Cosmatevs commented 4 years ago

I've just added Vietnamese glyphs but double-diacritized capital letters are so high that I'm afraid they're going to be cut. vietnamese

riperiperi commented 4 years ago

The msdf font generator rescales the characters to fit in the box, so big characters should just lose fidelity rather than clipping.

On 17 Sep 2019, at 21:23, Cosmatevs notifications@github.com<mailto:notifications@github.com> wrote:

I've just added Vietnamese glyphs but double-diacritized capital letters are so high that I'm afraid they're going to be cut. [vietnamese]https://user-images.githubusercontent.com/44393502/65076683-c29fff80-d999-11e9-9ee3-51a2a81b973f.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/riperiperi/FreeSO/pull/154?email_source=notifications&email_token=ABQAVC6JAP5Q7C4AVZZTZ2TQKE4FXA5CNFSM4ISUQLJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD65ZHWA#issuecomment-532386776, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABQAVCYRHGG7KLNRTIZIFATQKE4FXANCNFSM4ISUQLJQ.

Cosmatevs commented 4 years ago

Thus some Vietnamese characters will be rescaled…

I'll probably be changing/extending this font in the future but for now that's all. Consider using the font I've mentioned before, as a fallback for Japanese characters.

riperiperi commented 4 years ago

It's not really something to consider since the difference is that miniscule. For example, in the english font , has a lot more "resolution per distance" than like, W. I'll give this version a run through the content builder and test it ingame.

riperiperi commented 4 years ago

Did some ingame testing, looking very good.

Vietnamese example: image

Double diacritized: image

New star on upgrades: image

Cyrillic: image

Large Scaling (signed distance field upscaling): image

Cosmatevs commented 4 years ago

Cyrillic characters aren't kerned well, from what I see. The font has got three kerning subtables – for Latin, Cyrillic and Greek. I'm afraid that the first one only works… By the way, I've just found an unkerned pair.

riperiperi commented 4 years ago

The truetype library that I am using reads one kern-table that can read multiple subtables.

https://github.com/roy-t/TrueType/blob/master/RoyT.TrueType/TrueTypeFont.cs https://github.com/roy-t/TrueType/blob/master/RoyT.TrueType/Helpers/KerningHelper.cs

If multiple subtables are used, the kerning should still be detected.

Cosmatevs commented 4 years ago

But probably it isn't detected at all, even the Latin part. Look at To in Touch, or ГД.

riperiperi commented 4 years ago

Not sure how that can be the case, as the kerning I added to the font originally did work.

riperiperi commented 4 years ago

image Compiling it is showing 0 kerning pairs, but I cannot debug the MSDFExtension due to how MGCB works.

Cosmatevs commented 4 years ago

I've saved the font using the old style 'kern' option. Does it work now?

riperiperi commented 4 years ago

image Yep. Hopefully C# dictionary is fast enough for this.

image

riperiperi commented 4 years ago

LGTM, thank you so much! I'll commit the change to the MSDF extension and a compiled version separately.