Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to set 'key' ? #61

Closed
sunaneko-1324 opened this issue May 9, 2020 · 5 comments
Closed

how to set 'key' ? #61

sunaneko-1324 opened this issue May 9, 2020 · 5 comments

Comments

@sunaneko-1324
Copy link

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
Copy link
Owner

ysc3839 commented May 9, 2020

"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.

@ysc3839 ysc3839 closed this as completed May 9, 2020
@sunaneko-1324
Copy link
Author

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
Copy link
Owner

ysc3839 commented May 9, 2020

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

Here SimSun is the "key".

@hibiyasleep
Copy link

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
Copy link
Owner

ysc3839 commented May 9, 2020

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants