Tatsu-syo / noMeiryoUI

No!! MeiryoUI is Windows system font setting tool on Windows 8.1/10/11.
https://www.tatsu-syo.info/MySoft/WinCust/index.html
MIT License
4.71k stars 163 forks source link

Add application font fallback. #101

Closed Tatsu-syo closed 5 months ago

Tatsu-syo commented 8 months ago

I added application font fallback mechanism. Application font fallback mechanism does when Windows don't have font that specified in language file FONT_FACE key, select alternative font.

When NoMeiryoUI::applyResource executed, add call NoMeiryoUI::getLanguageFallbackForCountry that select application font fallback mechanism. NoMeiryoUI::getLanguageFallbackForCountry calls application fallback font detect functions..

Font detect functions is written in country specific folder located in country(country name) .

I write base functions and Japanese and no country specific function, and Japanese language setting.

Translators can write better look font name in FONT_FACE key.

I write recently added better font "BIZ UDPGothic" in Japanese translation file. This font is used in Windows 11 and later version of Windows 10. In Earlyer version of Windows 10, Yu Gothic Medium is used. And in Windows 8.1.Yu Gothic is used. Earlyer than Windows 8.1 MS UI Gothic(bitmap) is used. This choice by my program.

mon-jai commented 8 months ago

I would suggest making the fallback font configurable.

Personally, I've installed Noto Sans CJK on my machine, and it looks much better, but it might not work for everyone. It would also be too much work if someone needs to recompile the program to specify their own fallback font (as it is a matter of taste and preferences).

Additionally, is there an option for "just using the system default fallback font"?

Tatsu-syo commented 8 months ago

I also installed noto

Additionally, is there an option for "just using the system default fallback font"? Oh, I forgot this item. In weekend, went hospitals and make basic programs and solve my computer trouble in full of time. Next, I plan to make alternative application font settings in language file.

Example (in Japanese):

FONT_FACE=Noto Sans CJK JP
ALTER_FONT_FACE=BIZ UDPGothic

And if each font didn't found in Windows, use system default fallback font.

How about? i

mon-jai commented 8 months ago

I would suggest making the fallback font option available as a dropdown menu in the user interface, rather than via a config file, to leave the choice to the end user.

Because choosing the fallback font is a matter of preference, the font we pick may not suit all users well.

Having a language-sensitive default is good, though.

Tatsu-syo commented 8 months ago

@mon-jai

I would suggest making the fallback font option available as a dropdown menu in the user interface, rather than via a config file, to leave the choice to the end user.
Because choosing the fallback font is a matter of preference, the font we pick may not suit all users well.

If I implement this feature, I think I would have to implement these features.

For users:

For translators:

To run application correctly:

Hmm, there are lot of work. I continue to consider feature and implementation.

Thanks.

mon-jai commented 8 months ago

It seems that it requires much more work than I expected :(

If we proceed with the current implementation, can I interpret the .lng files as language-specific configuration files? noMeiryoUI will look up a matching .lng file based on the system language and apply the fallback font defined in it.

Users can edit the corresponding .lng file if they want to define their own fallback font.

mon-jai commented 8 months ago

Some questions:

I could help with the documentation. Thanks for your awesome work!

mon-jai commented 8 months ago

User's selected application font setting storage

Why do we need the name of the fallback font after the font setup operation has been completed?

Tatsu-syo commented 6 months ago

It seems that it requires much more work than I expected :(

If we proceed with the current implementation, can I interpret the .lng files as language-specific configuration files? noMeiryoUI will look up a matching .lng file based on the system language and apply the fallback font defined in it.

Users can edit the corresponding .lng file if they want to define their own fallback font.

I think again. And user can choice own No!! Meiryo UI user interface font better than translator's recommended font. Reasons are below.

I restore items about user interface in font settings language file. And make user can choice user interface font.

Tatsu-syo commented 6 months ago

User's selected application font setting storage

Why do we need the name of the fallback font after the font setup operation has been completed?

If users run No!! Meiryo UI again, user can use No!! Meiryo UI their favorite font. Situations are below.

Tatsu-syo commented 5 months ago

I reconsidered. On first start up, No!! Meiryo UI's application font is specified on language file. And I add function to select application font. Users choice own favorite font, application font setting are saved on application's folder. On next start up, application uses user's application font setting.

@mon-jai How about?

mon-jai commented 5 months ago

Thank you so much for your work.

Can I understand it this way?


Some questions:

Tatsu-syo commented 5 months ago

@mon-jai

The translator's recommended fallback font will be enabled by default. I decided not use translator's recommended fallback font. Because if translator's favorite font are different, might be cause some confusion.

Users can choose their own fallback font if they find the recommended fallback font unsuitable for them. Yes.

Applied font configurations will be stored in the application's folder. The next time the user launches the app, these configurations will be loaded automatically. Yes.

Can users choose to keep the system's fallback font instead? Yes.

What happens if a character doesn't exist in both the base font and fallback font? For example, if you defined "Arial" as the base font and "Noto Sans JP" as the fallback font, which font would be used to render a Korean character? Windows has own font fallback mechanism. And if font don't have character, Windows uses own fallback character. For example, Segoe UI don't have Japanese character, and if program try to draw Japanese character by Segoe UI, Windows use own fallback character Meiryo UI :( .

Tatsu-syo commented 5 months ago

There are no objections. And I merge this PR.

mon-jai commented 5 months ago

@Tatsu-syo That would be great. Thanks for your work.