kyamagu / skia-python

Python binding to Skia Graphics Library
https://kyamagu.github.io/skia-python/
BSD 3-Clause "New" or "Revised" License
245 stars 43 forks source link

Identify what breaks in m122 for font(typeface("")) on mac os #241

Closed HinTak closed 6 months ago

HinTak commented 6 months ago

It is somewhat expected given the other changes, but it would be nice to identify the precise upstream commit/diff that causes font(typeface('')) to stop working in mac os x in m122. See https://github.com/kyamagu/skia-python/pull/232#issuecomment-1924104619 .

font(typeface('times')) should work everywhere?

HinTak commented 6 months ago

Times also gives glyphs_Times = [0, 0, 0, 0, 0]

pavpanchekha commented 6 months ago

I just ran into this locally. Even passing an explicit font seems to break:

>>> import skia
>>> skia.Typeface("Arial")
Typeface('', FontStyle(400, 5, Slant.kUpright_Slant))

The expected result (Typeface('Arial', FontStyle(400, 5, Slant.kUpright_Slant)) occurs on 121.0b6

HinTak commented 6 months ago

Yes, I tried "Times" on CI and it doesn't work either. https://github.com/kyamagu/skia-python/compare/3cf8711bdf2309325cf40f1a65ee8c59707f9a0b..ead48c542529c6c7f5d96692e3c27c3c718b929d

pavpanchekha commented 6 months ago

I found the issue: https://github.com/HinTak/skia-python/pull/1

Not sure I made the PR on the right repo, sorry @HinTak!

HinTak commented 6 months ago

@pavpanchekha doesn't matter which repo - I can cherry-pick it across.

HinTak commented 6 months ago

I have cherry-picked across to all of them now.

HinTak commented 6 months ago

@pavpanchekha thanks a lot for the work. The fix will go into 124b7, going out later today/tomorrow when ci finishes etc.