You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
For some Chinese users, they sometimes dislike it when BHL is used in an article. This is because when they open a page that includes the BHL theme, they often find that there are no Chinese characters displayed on their screen. Instead, they see only English words and numbers. It takes several seconds, or even several minutes, for the fonts to load before they can finally read the article normally. This situation leads to complaints that the BHL theme is "so laggy."
This issue is essentially a network problem. Due to the Great Firewall of China (GFW) or some local policies, people may have difficulty connecting to github.io or fonts.googleapis.com to download the required assets.
In the following gif, I used a trick to reproduce this problem, which can be described as "fully reloading the source code."
Describe the solution you'd like:
I noticed that you have added font-display: swap for every English font but not for the CJK (Chinese, Japanese, Korean) fonts. Therefore, the solution is simple.
Add font-display: swap; for every CJK font. This will display the fallback font for users first and then switch to the correct font after it is loaded.
As shown in the gif below, this significantly improves the reading experience.
Separating the @font-face part from the final black-highlighter.min.css and allowing each branch to choose its own font pack. For example, the CN branch can use @import url("https://nu-scptheme.github.io/Black-Highlighter/css/font/CN-fonts.css");, and the JP branch can use @import url("https://nu-scptheme.github.io/Black-Highlighter/css/font/JP-fonts.css");. This solution can reduce the loading burden for users who will never use certain languages.
Ah, excellent, that is very good to know! It makes sense that changing it to swap would help. I like your second idea and shouldn't be too difficult. I'll work on that sometime this week.
Is your feature request related to a problem? Please describe.
For some Chinese users, they sometimes dislike it when BHL is used in an article. This is because when they open a page that includes the BHL theme, they often find that there are no Chinese characters displayed on their screen. Instead, they see only English words and numbers. It takes several seconds, or even several minutes, for the fonts to load before they can finally read the article normally. This situation leads to complaints that the BHL theme is "so laggy."
This issue is essentially a network problem. Due to the Great Firewall of China (GFW) or some local policies, people may have difficulty connecting to
github.io
orfonts.googleapis.com
to download the required assets.In the following gif, I used a trick to reproduce this problem, which can be described as "fully reloading the source code."
Describe the solution you'd like:
I noticed that you have added
font-display: swap
for every English font but not for the CJK (Chinese, Japanese, Korean) fonts. Therefore, the solution is simple.Add font-display: swap; for every CJK font. This will display the fallback font for users first and then switch to the correct font after it is loaded.
As shown in the gif below, this significantly improves the reading experience.
Describe alternatives you've considered:
@font-face
part from the finalblack-highlighter.min.css
and allowing each branch to choose its own font pack. For example, the CN branch can use@import url("https://nu-scptheme.github.io/Black-Highlighter/css/font/CN-fonts.css");
, and the JP branch can use@import url("https://nu-scptheme.github.io/Black-Highlighter/css/font/JP-fonts.css");
. This solution can reduce the loading burden for users who will never use certain languages.Additional context:
Test environment:
System: Windows 11 Insider Preview Build 25375
Browser: Firefox 113.0.2
Page: Advanced Information Methodology (AIM) Component (CN Version)
The text was updated successfully, but these errors were encountered: