-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Automatic inlining of fonts results in jagged fonts for Windows users #22248
Comments
It appears that when using a Windows user-agent the woff2 font content size is about 1.7Kb larger. It doesn't appear to effect the font rendering on OSX in anyway. @mgechev, has offered to reach out to the Chrome team to understand this problem a bit better. |
Do you think this problem will be fixed? |
@foo6, we have reached out the the Chrome team again to gather some more information and their recommended. |
…ed fonts for Windows users We now replace the user agent string used to perform font inlining with a Windows one. This is because Google fonts will including hinting in fonts for Windows. Hinting is a technique used with Windows files to improve appearance however results in 20-50% larger file sizes, however this will make the fonts display correctly on all platforms. More information about this can be found in: - https://fonts.google.com/knowledge/glossary/hinting - https://glyphsapp.com/learn/hinting-manual-truetype-hinting - http://google3/java/com/google/fonts/css/OpenSansWebFontsCssBuilder.java?l=22 Closes angular#22248
…ed fonts for Windows users We now replace the user agent string used to perform font inlining with a Windows one. This is because Google fonts will including hinting in fonts for Windows. Hinting is a technique used with Windows files to improve appearance however results in 20-50% larger file sizes, however this will make the fonts display correctly on all platforms. More information about this can be found in: - https://fonts.google.com/knowledge/glossary/hinting - https://glyphsapp.com/learn/hinting-manual-truetype-hinting - http://google3/java/com/google/fonts/css/OpenSansWebFontsCssBuilder.java?l=22 Closes #22248
…ed fonts for Windows users We now replace the user agent string used to perform font inlining with a Windows one. This is because Google fonts will including hinting in fonts for Windows. Hinting is a technique used with Windows files to improve appearance however results in 20-50% larger file sizes, however this will make the fonts display correctly on all platforms. More information about this can be found in: - https://fonts.google.com/knowledge/glossary/hinting - https://glyphsapp.com/learn/hinting-manual-truetype-hinting - http://google3/java/com/google/fonts/css/OpenSansWebFontsCssBuilder.java?l=22 Closes #22248 (cherry picked from commit bf5fbdd)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, automatic inlining of fonts was introduced in Angular 11 (defaulted to on)
Description
Some Google fonts are rendering poorly for Windows users when automatic font inlining is turned on
🔬 Minimal Reproduction
Start up a new angular project, and add google open sans font into your
index.html
like so:Set the font-family of text to 'Open Sans' and font size to 12px.
Build the project so that the font inlining happens, and serve the static bundle locally.
One quick example to do this is to run
npx http-server dist/{PROJECT_NAME_HERE}
Notice that the rendered fonts look jagged and poor aliased.
If I turn off font-inlining and rebuild the font renders better:
🌍 Your Environment
Anything else relevant?
Looking at how the build-time font inlining works, it's making a request at build time with a Mac OSX user-agent which returns a different set of fonts than if I hit the Google Fonts endpoint with a Windows user-agent. In my testing when I replaced the inlined styles with fonts inlined with a Windows user agent the fonts rendered fine.
The text was updated successfully, but these errors were encountered: