Skip to content

Conversation

samizdatco
Copy link
Contributor

Motivation

OneLineShaper currently compares each typeface to the requested FontStyle and detects cases where there is a mismatch in terms of italic/upright-ness or bold-ness (with a threshold of semibold or heavier counting as 'bold'). If it detects a mismatch it will apply a shear transform to create a fake italic or outdent the strokes to create a fake bold.

While there are cases where this automated behavior is desirable, there are also times where it is preferable to use an unmodified typeface (albeit with a different style than requested) rather than a synthetically generated one.

Changes

This PR adds a boolean property to ParagraphStyle called fFakeMissingFontStyles which defaults to true (so as not to change the current default behavior) but can be toggled to false by calling the setFakeMissingFontStyles() accessor. OneLineShaper has been updated to apply its faking routines only if the flag is enabled.

@skia-codereview-bot
Copy link

This PR (HEAD: f735319) has been imported to Gerrit for code review.

Please visit review.skia.org/1044617 to see it. Please CC yourself to the Gerrit change.

Note:

  • Skia uses only Gerrit for reviews and submitting code (doc).
  • All comments are handled within Gerrit. Any comments on the GitHub PR will be ignored.
  • The PR author can continue to upload commits to the branch used by the PR in order to address feedback from Gerrit.
  • Once the code is ready to be merged, a maintainer will submit the change on Gerrit and skia-codereview-bot will close this PR.
  • Similarly, if a change is abandoned on Gerrit, the corresponding PR will be closed with a note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants