GithubHelp home page GithubHelp logo

Comments (6)

justvanrossum avatar justvanrossum commented on September 28, 2024

Oh, I just ran this on GH Actions on Linux and Win and macOS: the problem only exists on macOS.

from skia-python.

HinTak avatar HinTak commented on September 28, 2024

Since it is just a direct call to a single upstream routine:

return SkTypeface::MakeFromFile(&path[0], index);
, I think it is an upstream bug and you should report it upward. FWIW, I put a test through GH action with m117 and it is still failing, on mac os x, and only on mac os x. So you should file upstream against m117 / current.

from skia-python.

HinTak avatar HinTak commented on September 28, 2024

Just a heads-up: this API is being deprecated upstream in skia https://github.com/google/skia/blob/main/relnotes/typeface.md - so we'll have to either emulate it in skia-python for backward-compatibility, or just drop it, in m120+ .

Either way, you might consider using the FontMgr API as it says... I had an impression that there is no platform-specific APIs in skia-python (except the one I added a couple of months ago on COLRv1 fonts on freetype-based platforms), so it probably does not exist in skia-python yet. So here is a chance for you to influence how FontMgr_mac_ct should work in skia-python, for it to be added.

from skia-python.

HinTak avatar HinTak commented on September 28, 2024

Filed upstream https://issues.skia.org/issues/310510989

from skia-python.

HinTak avatar HinTak commented on September 28, 2024

See also #213 - that might workaround this issue when it lands. The tests already include a variant of this test set.

from skia-python.

HinTak avatar HinTak commented on September 28, 2024

I think skia.Typeface.MakeFromFile(p, N) is equivalent to invoking the default system font manager (CoreText) like this:
skia.FontMgr().makeFromFile(p, N) which does not work against CoreText. This is filed upstream
https://issues.skia.org/issues/310510989.

However, while looking for something else, I came across some info that Chrome on all platforms can use FreeType for font formats which the host font manager does not support - this include CBDT color fonts on Apple, variation fonts on old versions of windows, and etc. This is invoked via
skia.FontMgr.New_Custom_Empty() to get a "custom (ie based on freetype and non-host) Empty (have no access to system platform built-in fonts)" font manager, and load your font via this custom empty font manager:
skia.FontMgr.New_Custom_Empty().makeFromFile(p, N) .

And I have tested this in my playground pull HinTak/skia-m1xx-python#6 , and tidy up in #210 .

So if you really want it to work with the default CoreText based font manger, bug Google folks at the upstream URL; if you just like it to work "somehow" on mac OS, when m120 #210 get merged, you can do load via freetype on mac os with:
skia.FontMgr.New_Custom_Empty().makeFromFile(p, N) .

Of course I would like CoreText to work... close for now.

from skia-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.