Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Added assertion up to cv99 for FontFeature.characterVariant #27745

Merged
merged 2 commits into from
Aug 3, 2021

Conversation

Darkade
Copy link
Contributor

@Darkade Darkade commented Jul 27, 2021

This PR changes the assertion in factory FontFeature.characterVaraint from up to 20 to up to 99 in order to support additional Character Variants

  • Previously whenever you would setup to use a character variant after 20 flutter would give an error during runtime.

You can check the OpenType docs to confirm the character variants go from cv01 to cv99

https://docs.microsoft.com/en-us/typography/opentype/spec/features_ae#cv01-cv99

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] and the [C++, Objective-C, Java style guides].
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the [CLA].
  • All existing and new tests are passing.

@google-cla google-cla bot added the cla: yes label Jul 27, 2021
@Darkade Darkade marked this pull request as ready for review July 28, 2021 00:14
@Darkade Darkade force-pushed the master branch 2 times, most recently from b30a8c3 to beb88af Compare July 28, 2021 16:38
@pazthor
Copy link

pazthor commented Jul 28, 2021

I like to expand it to what the specification indicates; my only issue would be what it mentions about glyphs :

the number of variants should be identical for all glyphs.

What do you think about that @Darkade?

@aalkz
Copy link

aalkz commented Jul 28, 2021

This is great, it would allow OTF fonts with specific variants to be super useful and would also allow the developer not having to create workarounds for custom symbols that aren't unicode.

@Darkade
Copy link
Contributor Author

Darkade commented Jul 29, 2021

I like to expand it to what the specification indicates; my only issue would be what it mentions about glyphs :

the number of variants should be identical for all glyphs.

What do you think about that @Darkade?

Shouldn't that be a concern for the typeface dev, tho?

Copy link
Contributor

@Hixie Hixie left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for fixing my mistake. :-)

@Darkade
Copy link
Contributor Author

Darkade commented Aug 3, 2021

Wouldn't have noticed except for really wanting to use a very specific font 😹

@Hixie Hixie merged commit d6ddc31 into flutter:master Aug 3, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 3, 2021
naudzghebre pushed a commit to naudzghebre/engine that referenced this pull request Sep 2, 2021
…27745)

* Added assertion up to cv99 for FontFeature.characterVariant

* Added FontFeature.characterVariant(99) test
filmil pushed a commit to filmil/engine that referenced this pull request Apr 21, 2022
…27745)

* Added assertion up to cv99 for FontFeature.characterVariant

* Added FontFeature.characterVariant(99) test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants