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

Add lang specific font stacks for CJK #1

Merged
merged 1 commit into from
Mar 13, 2019
Merged

Add lang specific font stacks for CJK #1

merged 1 commit into from
Mar 13, 2019

Conversation

CL-Jeremy
Copy link

Summary of potential ameliorations to go-gitea#6007, based on my knowledge, updated today to match this branch):

  • Contrary to some misinformation on the Web, inherit only works alone and not in a sequence, and font is no exception, they are removed (for monospace I can rely on browser choice locally, works at least on macOS and Linux, on Safari and Firefox, but we may as well try to introduce an override mixin just like normal fonts).
  • Actually fixing the font chooser (elements with an explicit lang property definition should be rendered based on that).
  • Searching for parts of the current fallback sequence, I realized Microsoft YaHei New it is widely used but I could not find any source for that name, at least that doesn't match anything on any of my test environments. Microsoft JhengHei New doesn't even exist.
  • Hiragino Sans TC is not available unless otherwise purchased, but I tend to leave it there to match the widely accepted Hiragino Sans GB, notably shipped with macOS for over 10 years and used on various Mainland Chinese websites.
  • SF Mono is available since macOS High Sierra and is currently used on GitHub.
  • Regarding the non-English name matching, I do not suggest blindly including them unless English names error out during testing. I suspect those were needed for legacy Windows platform/browser combinations which are barely supported anyway.
  • A widely adopted approach of "fixing" Yu Gothic being too thin at regular weight on Windows is included (Microsoft JhengHei is about as thin, but that is reasonable given the nature of traditional Chinese characters, while Japanese Kanjis are normally not as complex).
  • As already stated in Add lang specific font stacks for CJK go-gitea/gitea#6007 (comment), Helvetica should precede Arial (the latter is shipped with macOS since more than 10 years ago); some may argue the problem of hinting on Windows at lower resolutions (as with Hiragino Sans), but since their presence on the affected platforms are due to the user's manual installation they are responsible for their own choice.
  • The Hong Kong regional variants of PingFang, Source Han Sans and PMingLiU and are prioritized accordingly.
  • Single and double quotes are normalized, and unnecessary ones are removed.

This PR has been tested against the master branch with merge conflicts resolve. Pending discussions affecting this include:

  1. Whether Lato should be abandoned in favor of the native fonts
  2. If not 1, whether and how Lato should be updated to include the latest glyphs of Latin-Extended and Cyrillic code blocks from official.
  3. Whether the compiled and minified stylesheets should be left to the build script and ignored in development trees.

commit 7d1679e9079541359869c9e677ba7412bfcc59f3
Author: Mike L <cl.jeremy@qq.com>
Date:   Wed Mar 13 13:53:49 2019 +0100

    Remove missed YaHei leftover from _home.less

commit 0079121ea91860a323ed4e5cc1a9c0d490d9cefd
Author: Mike L <cl.jeremy@qq.com>
Date:   Wed Mar 13 12:03:54 2019 +0100

    Fix overdone fixes (inherit, :lang)

commit 62c919915928ec1db4731d547e95885f91a0618d
Author: Mike L <cl.jeremy@qq.com>
Date:   Wed Mar 13 02:29:10 2019 +0100

    Fix elements w/ explicit lang (language chooser)

commit b3117587aa2eb8570d60bed583a11ee5565418be
Author: Mike L <cl.jeremy@qq.com>
Date:   Tue Mar 12 20:17:26 2019 +0100

    Fix textarea also (to match body)

commit 81cedf2c3012c4dd05a7680782b4a98e1b947f67
Author: Mike L <cl.jeremy@qq.com>
Date:   Tue Mar 12 19:41:39 2019 +0100

    Revert css temporarily to fix conflict

commit 80ff82797f3203cbeaf866f22e961334e137df89
Author: Mike L <cl.jeremy@qq.com>
Date:   Tue Mar 12 19:15:30 2019 +0100

    Tweak CJK, fix Yu Gothic, more monospace inherits

commit 581dceb9a869646c2c486dabb925c88c2680d70c
Author: Mike L <cl.jeremy@qq.com>
Date:   Mon Mar 11 13:09:26 2019 +0100

    Add Lato for latin extd. & cyrillic, improve CJK
@zeripath zeripath merged commit d9b45ec into zeripath:issue-4173-alternative-fix Mar 13, 2019
zeripath pushed a commit that referenced this pull request Apr 12, 2019
* Improve issue autolinks

Update autolinks to match what github does here:

Issue in same repo: #1
Issue in different repo: org/repo#1

Fixes go-gitea#6264

* Use setting.AppURL when parsing URL

Using setting.AppURL here is a more reliable way of parsing the current
URL and what other functions in this file seem to use.

* Make ComposeMetas always return a valid context

* Add per repository markdown renderers for better context

* Update for use of context metas

Now that we include the user and repo name inside context metas, update
various code and tests for this new logic
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

Successfully merging this pull request may close these issues.

2 participants