-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add supported custom font formats in official docs #77230
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
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| /// #### Supported font formats | ||
| /// | ||
| /// Font formats currently supported by Flutter : | ||
| /// * `.ttf` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flutter also supports TrueType Collections, (.ttc) which contain multiple tts files. This is commonly seen in CJK font collections that include multiple fonts for multiple languages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, see https://www.google.com/get/noto/help/cjk/ where the truetype downloads are .ttc files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GaryQian I had missed to mention it. Thanks for the tip. I'll make the changes.
|
@jason-simmons are there any other more obscure formats that we support that I forgot? |
|
I think those are all the formats that Flutter promises to support. Anything beyond that depends on the configuration of third-party libraries like FreeType. This change selected the types of fonts included in the engine's build of FreeType: |
| /// Font formats currently supported by Flutter : | ||
| /// * `.ttf` | ||
| /// * `.otf` | ||
| /// * `.ttc` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very minor nit: Move ttc to be next to ttf for better organization
GaryQian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
| /// #### Supported font formats | ||
| /// | ||
| /// Font formats currently supported by Flutter : | ||
| /// * `.ttf` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add additional space before each *
| /// | ||
| /// #### Supported font formats | ||
| /// | ||
| /// Font formats currently supported by Flutter : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add newline after this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GaryQian I have committed the proposed changes. Please check if there are any further changes to be made.
Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It LGTM now, thank you for your contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GaryQian the cookbook doesn't mention .ttc too. Should it also be updated?
This PR adds the custom font formats that are supported by flutter in the text style docs.
Issues - #76715
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.