-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Refactor some parts of ft2font extension #27891
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
Conversation
|
My reading of the mypy error is that it simply wants the stub to match the final status of the implementation by adding |
b97fc87 to
7af2e9b
Compare
|
build failures on windows do appear to be related here. |
|
Ah, interesting that designated initializers are so new in C++ vs C. |
7af2e9b to
a8f5072
Compare
a8f5072 to
d0c77a6
Compare
d0c77a6 to
ece8903
Compare
|
Remains true that the errors on Windows appear to be related. |
ece8903 to
45fcd96
Compare
|
I also put in the deprecated function removals here. |
|
Changing the classes to Do we have any sense of the preformance trade off of doing a single pass but maybe multiple memory allocations vs doing two passes but only one memory allocation? |
Running tests with |
|
A possibly reasonable microbenchmark: This ends at 500 iterations, with average before of 0.236 ± 0.014s, and average after of 0.231 ± 0.004s. |
45fcd96 to
028328d
Compare
028328d to
8849012
Compare
|
Snuck in one more thing; noticed that the C++ side's |
There appears to be no reason for them to be subtyped, as they are semi-private, and we don't do that.
This improves the encapsulation and separation of concerns between the files.
This means we only need to do one pass through.
It is set in a few places, but never read.
8849012 to
276fade
Compare
|
And |
PR summary
Mainly, this is moving Python-specific code from
ftfont.{cpp,h}toft2font_wrapper.cpp; this keeps the Python code encapsulated in the one file. Also remove the deprecations that can be expired now.This is based on #27885, and is a first step in moving to pybind11.
PR checklist