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

font.getPaths() not working as expected #117

Closed
justvanrossum opened this issue Sep 28, 2020 · 0 comments
Closed

font.getPaths() not working as expected #117

justvanrossum opened this issue Sep 28, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@justvanrossum
Copy link
Contributor

Describe the bug
The paths returned by font.getPaths(gids) are wrongly scaled.

To Reproduce
Steps to reproduce the behavior:

Run this script:

import skia

font = skia.Font(skia.Typeface(None), 100)

gid = 15
path1 = font.getPath(gid)
print(path1.getBounds())

paths = font.getPaths([gid])
print(paths[0].getBounds())

Compare the first line of the output (which is correct) with the second line (which should be the same):

Rect(8.30078, -10.6445, 18.75, 14.8438)
Rect(5.3125, -6.8125, 12, 9.5)

If I change the font size, the first line changes as expected, but the second stays the same.

(This is with the default font on macOS, so the actual numbers may vary per platform.)

Expected behavior

font.getPath(gid) does work as expected (so that's the workaround as well, making this issue super low priority).

Desktop (please complete the following information):

  • OS: macOS 10.15.6
  • Python: 3.8
  • skia-python version: 86.0
@kyamagu kyamagu added the bug Something isn't working label Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants