Provide none-static interface for TTF#22098
Provide none-static interface for TTF#22098linev wants to merge 3 commits intoroot-project:masterfrom
Conversation
Use instead normal getters
Provide several getters which replace such direct access. Remove friend classes - no any allows to use members from outside. They will disappear soon
It is future replacement for static TTF interface. For now it define similar methods and TTF just call to static instance - fully preserve API as it was before. In ROOT7 TTFhandle class will fully replace TTF. All ROOT classes will use new API
| std::vector<TTF::TTGlyph> fGlyphs; ///< glyphs | ||
| Bool_t fHinting = kFALSE; ///< use hinting (true by default) | ||
| Bool_t fKerning = kTRUE; ///< use kerning (true by default) | ||
| std::unique_ptr<FT_Matrix> fRotMatrix; ///< rotation matrix |
There was a problem hiding this comment.
Why does this need to be a separate allocation? Can't we just store it inline?
Edit: sorry, just noticed this is still a draft.
There was a problem hiding this comment.
I need to emulate old API.
And these were many static members before.
Some of them used outside of TTF parsing.
There was a problem hiding this comment.
No, I mean why the matrix specifically needs to be wrapped in a unique_ptr? That should not be required for backward compatibility
There was a problem hiding this comment.
I mean why the matrix specifically needs to be wrapped in a unique_ptr
unique_ptr will automatically delete matrix in the destructor of TTFhandle.
Just simple sign of ownership.
PR is not yet ready - I just want to check that functionality is still there.
There was a problem hiding this comment.
I meant why is the matrix is not there by value, why the dynamic allocation at all
There was a problem hiding this comment.
No idea. Maybe you are right and dynamic allocation not needed at all.
I checking this and many other things right now.
Test Results 21 files 21 suites 3d 6h 18m 13s ⏱️ For more details on these failures, see this check. Results for commit 4dbdefd. |
Now TTF class uses fully static API - no chance to run code parallel.
Also there are several static arrays preallocated - which leads to certain limitations.
While old TTF.h API must be preserved until ROOT7, just introduce extra
TTFhandleclass which shouldprovide "normal" API without all static limitations. Old static API redirects to new static instance of
std::unique_ptr<TTFhandle>.All ROOT classes will be switched to use new API - so static interfaces will be only available for users.