hovancik / stretchly

The break time reminder app
https://hovancik.net/stretchly
BSD 2-Clause "Simplified" License
4.62k stars 444 forks source link

[Bug]: Chinese Font is incorrect #1231

Open svota opened 2 years ago

svota commented 2 years ago

Version

Known issues

Existing issues

What operating system are you using?

Linux

Operating System Version

Ubuntu 22.04.1 LTS

Reproduction steps

  1. Set language to simplified or traditional chinese
  2. get a break message
  3. notice that it is using Japanese characters for some words ... Reproduces how often: [What percentage of the time does it reproduce?]

Expected Behavior

Several characters have the same point in unicode for the Japanese and Chinese character, and the Noto Sans CJK KR and CJK JP favor the Japanese version while the CJK SC and CJK TC use the Chinese character. If my language is set to simplified or traditional Chinese, I would expect "睛" to render as image

Actual Behavior

Instead, it is rendered as image (this is true for a sizable subset of characters, and a known issue for Ubuntu: https://askubuntu.com/questions/901486/%E9%97%A8-looks-weird-on-my-system-default-font , https://forum.ubuntu.org.cn/viewtopic.php?t=478915 )

Relevant log output

No response

Preferences

No response

Additional information

No response

Code of Conduct

svota commented 2 years ago

I see that I can update the font in app/css/common.css, but If I set it directly to CJK SC or CJK TC, this would just make the opposite problem appear in Japanese instead (and maybe korean? I'm not familiar with which set they prefer). Is the font being set per language somewhere else that I'm missing?

hovancik commented 2 years ago

Hi, I am loading multiple fonts in the common.css. I don't remember exactly, but I think browser (Stretchly uses electronJS and it uses Chromium) should detect the right font?

Here are the fonts:

body {
  background: var(--main-bg-color);
  color: var(--main-color);
  font-family: 'Noto Sans Regular', 'Noto Sans Arabic Regular',
    'Noto Sans CJK KR Regular',
    'Noto Sans Devanagari Regular',
    'Noto Sans Gujarati Regular', 'Noto Sans Gurmukhi Regular',
    'Noto Sans Hebrew Regular',
    'Noto Sans JP Regular';
}

Seems to me we need to add CJK SC and CJK TC font?

svota commented 2 years ago

Yeah, adding those fonts should do it, but I'm not 100% sure that electron will detect things, so we should test in both Japanese and Chinese after making the change.

svota commented 2 years ago

So here's a screencast showing the issue. I've set the language to Japanese (though the same will happen with Chinese). I think we need some sort of language toggle for these two fonts Screencast from 11-10-2022 11:42:29 AM.webm

svota commented 2 years ago

Also, I made the change locally, but I'm not sure how to submit it. I looked through CONTRIBUTING.md, but it points to PULL_REQUEST_TEMPLATE, which doesn't exist?

hovancik commented 1 year ago

Hi, pull request template will appear once you make a PR on Github :) for example: https://github.com/hovancik/stretchly/pull/1154

hovancik commented 1 year ago

@svota were you able to figure it out? can I help?