Skip to content
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

fontVariations() does not work correctly on Linux #1

Closed
justvanrossum opened this issue Sep 17, 2020 · 3 comments
Closed

fontVariations() does not work correctly on Linux #1

justvanrossum opened this issue Sep 17, 2020 · 3 comments

Comments

@justvanrossum
Copy link
Owner

Possibly due to a bug in skia-python: kyamagu/skia-python/issues/112

@justvanrossum
Copy link
Owner Author

Or due to me using the skia-python API wrong.

@justvanrossum
Copy link
Owner Author

This test script does not give the expected result on Linux: https://github.com/justvanrossum/drawbot-skia/blob/master/tests/apitests/fontVariations.py

size(275, 400)
rect(0, 0, width(), height())
font("../fonts/MutatorSans.ttf")
fontSize(100)
fill(1)
text("ABCXYZ", (10, 15))
fontVariations(wght=600)
text("ABCXYZ", (10, 115))
variations = fontVariations(wdth=200)
assert {'wdth': 200, 'wght': 600.0} == variations, variations
text("ABCXYZ", (10, 215))
variations = fontVariations(wdth=1000, resetVariations=True)
assert {'wdth': 1000, 'wght': 0.0} == variations, variations
text("ABCXYZ", (10, 315))

@justvanrossum
Copy link
Owner Author

This appears to be fixed thanks to recent changes to the TextStyle object: I no longer use the skia API to get at the current VF location, and setting is apparently not a problem.

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

No branches or pull requests

1 participant