Comments (6)
Oh, I just ran this on GH Actions on Linux and Win and macOS: the problem only exists on macOS.
from skia-python.
Since it is just a direct call to a single upstream routine:
Line 575 in f71fdee
from skia-python.
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.
Filed upstream https://issues.skia.org/issues/310510989
from skia-python.
See also #213 - that might workaround this issue when it lands. The tests already include a variant of this test set.
from skia-python.
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)
- Raspberry Pi 4 Support (linux 32-bit arm) HOT 8
- Newer system gets an extra skip on exit in testing HOT 2
- AttributeError: 'skia.Paint' object has no attribute 'setTextScaleX' HOT 1
- How to underline and strikethrough fonts? HOT 6
- Binding the skparagraph module HOT 11
- Mac font is thicker than Linux font HOT 3
- Missing `skia.TableColorFilter.MakeARGB` equivalent in latest builds HOT 9
- deprecation of `distutils`upstream for python >= 3.12 HOT 8
- m122: SkFontMgr::RefDefault() has been deleted HOT 5
- Is there a way to use skia.Surface to export high quality images? HOT 5
- Missing `getBlendMode` on `skia.Paint` objects HOT 7
- "instance = class() ; instance.initGL()" vs "instance = class.MakeGL()
- rgb r and b are working in reverse fashion... HOT 1
- rgb r and b are working in reverse fashion... HOT 1
- Improve SamplingOptions, and adding test cases HOT 7
- Identify what breaks in m122 for font(typeface("")) on mac os HOT 7
- Support for Python 3.12 HOT 2
- Build for python3.21 HOT 1
- "Shader Compilation Error" HOT 12
- python3.7 could not pip install skia-python HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skia-python.