ysc3839 / FontMod

Simple hook tool to change Win32 program font.
MIT License
1.29k stars 62 forks source link

how to set 'key' ? #61

Closed sunaneko-1324 closed 4 years ago

sunaneko-1324 commented 4 years ago

If you want replace only CJK fonts and keep English font, you need to set key to CJK fallback font. This font may be different in different language environments. (For example in Chinese simplified environment is SimSun), you can use debug mode to find corresponding font.

i don't know how to set key... sorry noob question..

ysc3839 commented 4 years ago

"key" is the key of yaml objects. https://en.wikipedia.org/wiki/YAML#Basic_components For example:

foo:
  bar: baz

foo and bar are keys.

sunaneko-1324 commented 4 years ago

you need to set key to CJK fallback font.

i want keep english default font. but tutorial is not shown how to set key. please example..

ysc3839 commented 4 years ago
fonts:
  SimSun: &zh-cn-font # Chinese (Simplified) fallback font
    replace: Microsoft YaHei
    <<: *style

Here SimSun is the "key".

hibiyasleep commented 4 years ago

pardon for the interruption, before of all, sorry for poor english - I don't read/or/write it often.

anyway, I'm also getting little confusion on it, set key of what?

As long as I understood, fontname said in (object key) is the font that should be replaced, and the value of (object key).replace is the destination font; so when I do set key to CJK fallback font, results should be like below;

fonts:
  Gulim:
    replace: 맑은 고딕
  Gulim: # guide said, set key to (ry), but key of where?
    replace: Roboto

but... this will result in key conflict.


or, may I interpret set key to CJK fallback font as replace destination font to english-only font?

let's make an example, if user wants to replace Gulim to Malgun Gothic, but keep english glyphs in Roboto (which only supports latin characters), then is this what README meant?:

fonts:
  Gulim: # (from)
    replace: 맑은 고딕 # (to)
    <<: *style
  '맑은 고딕': # (from)
    replace: Roboto #(to)
ysc3839 commented 4 years ago

@hibiyasleep "CJK fallback font" is a Qt-specific term. Because Qt checks if current font supports character to render. If not, Qt will use another font. So if the main font is Open Sans, which does not include CJK characters. Qt will fallback to other font. If you want to keep Open Sans for English characters, but only replace CJK characters font, you need to replace only the "CJK fallback font".

But if you want replace Gulim with Malgun Gothic, but keep English characters Roboto. You need to use third-party tools to combine Roboto and Malgun Gothic into one font, and replace Gulim with this custom font.