Closed dantewang closed 2 years ago
As you said monospace is only a “fallback”, so it will not be used if the default font is available. From my point of view, I think what you may need is a custom font. Unfortunately, eureka does not change font in config file for now. You could achieve that by modifying the source code but you may need to handle a couple of things by yourself.
在 2021年12月14日,09:32,Dante Wang @.***> 写道:
Describe the bug
Use of Monospace font for code block does not work in Windows.
When visiting the author's site to read the documents, I notice that the font in code block is not a fixed-width font.
The theme seems to declare some monospace fonts, and "monospace" as a fallback. I know that at least on other operating systems, this will lead to use of the font set as the system's "monospace", but on Windows, this does not work.
To Reproduce
Does this issue reproduce with the latest release?
Steps to reproduce the behavior:
Simply visit https://www.wangchucheng.com/zh/docs/hugo-eureka/getting-started/ on Windows.
Expected behavior
The code blocks and inline code segments are displayed using a fixed-width font.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/wangchucheng/hugo-eureka/issues/157, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJEXGNBMED44KLAYLYCEM33UQ5IN3ANCNFSM5KBBPE3Q.
@wangchucheng It will be great if the theme could display "correctly" on Windows by default, without any modification.
The font-family list I see for the code blocks by inspecting is "SFMono-Regular,Menlo,monospace". The first 2 fonts are not available on my Windows and Ubuntu installation.
I think it's better to use these fonts as web fonts, and add "Consolas" to the font list as a fallback for Windows.
And,
By taking another look, the font-family for code
does have Consolas, but the .content code
overrides it which sets font-family to what I mentioned above.
Describe the bug
Use of Monospace font for code block does not work in Windows.
When visiting the author's site to read the documents, I notice that the font in code block is not a fixed-width font.
The theme seems to declare some monospace fonts, and "monospace" as a fallback. I know that at least on other operating systems, this will lead to use of the font set as the system's "monospace", but on Windows, this does not work.
To Reproduce
Does this issue reproduce with the latest release?
Steps to reproduce the behavior:
Simply visit https://www.wangchucheng.com/zh/docs/hugo-eureka/getting-started/ on Windows.
Expected behavior
The code blocks and inline code segments are displayed using a fixed-width font.