Skip to content

Conversation

@bharat-biradar
Copy link
Contributor

This PR adds the custom font formats that are supported by flutter in the text style docs.

Issues - #76715

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

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.

@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Mar 4, 2021
@google-cla google-cla bot added the cla: yes label Mar 4, 2021
@HansMuller
Copy link
Contributor

CC @GaryQian @jason-simmons

/// #### Supported font formats
///
/// Font formats currently supported by Flutter :
/// * `.ttf`
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

@GaryQian
Copy link
Contributor

GaryQian commented Mar 5, 2021

@jason-simmons are there any other more obscure formats that we support that I forgot?

@jason-simmons
Copy link
Member

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:
https://flutter.googlesource.com/third_party/freetype2/+/a10b062df0c8958d69377aa04ea6554a9961a111

/// Font formats currently supported by Flutter :
/// * `.ttf`
/// * `.otf`
/// * `.ttc`
Copy link
Contributor

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

Copy link
Contributor

@GaryQian GaryQian left a 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`
Copy link
Contributor

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 :
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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!

Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants