You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ParagraphStyle setting to choose whether missing font weight/slant should be faked
### 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.
This is an imported pull request from
#207
GitOrigin-RevId: 80bf189
Change-Id: I26db9217eb034150685ff74824bc65ca8144491a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1044616
Commit-Queue: Julia Lavrova <[email protected]>
Reviewed-by: Julia Lavrova <[email protected]>
0 commit comments