Monospaced Google Fonts lack lots of glyphs #7449
yves-chevallier
started this conversation in
General
Replies: 1 comment
-
Thanks for the feedback again. We can't possibly guarantee the availability of glyphs in Google Fonts, specifically in the light of the number of languages we support. We could add a note in our documentation to ensure that the font includes all glyphs, but that is not easy to check in the browser, since the browser will fall back to a series of fallback fonts. A better idea would be to check this during build time, where all rendered characters should basically be known, which might be an excellent idea for a plugin. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I spent some time trying to figure out why changing the monospace font in
mkdocs.yml
wasn't working as expected. According to the documentation in the section on Monospaced font, MkDocs Material should allow you to replace the default code font with another monospaced one from Google Fonts. However, I ran into issues, particularly with box drawing characters:After some digging, and with a bit of help, I discovered that Google Fonts lack box drawing characters (U+2500-257F). Unfortunately, attempting to work around this by modifying the font definition didn’t solve the problem:
I downloaded both the
.ttf
and.woff2
versions of the font and noticed a significant size difference, and the woff2 indeed misses many characters:Given this, I was hoping to configure a local font by specifying its path in
theme.font.code
. However, based on the schema, it seems this isn't currently supported.This makes me question the utility of this setting. Code fonts are typically monospaced, but since Google doesn’t provide a complete font, this setting seems somewhat limited—unless we could configure a local font like this:
Of course, I could add my font using a dedicated CSS as explained in the documentation:
But I think it is worth mentioning in the documentation that Google Fonts for monospaced fonts can lead to spacing issues... This has been bothering me for some time...
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions