Provide new fonts handling routines in TVirtualX/TPadPainter classes#22059
Open
linev wants to merge 12 commits intoroot-project:masterfrom
Open
Provide new fonts handling routines in TVirtualX/TPadPainter classes#22059linev wants to merge 12 commits intoroot-project:masterfrom
linev wants to merge 12 commits intoroot-project:masterfrom
Conversation
Very often used method to calculate text size in pixels for specified pad. Important that now pad is used as parameter
Old methods relies on global attributes which normally related to current window. But text handling does not uses window context. Add new methods where text font and size provided directly.
Used only when plain X11 without TTF fonts are involved - which is normally not a case.
Anyway TTF is involved
This is special platform where TTF is not used by default. So all methods must be correctly implemented Adjust internal methods to avoid dependency from selected font. Now font and size provided directly - one can directly use selected font handle as method argument, also in old methods Provide shortcut method to extract unichars for greek and math symbols
They let decouple graphics classes from gVirtualX
Here TTF handling performed when HasTTFonts are enabled. It also used when gVirtualX cannot provide font information for any reason
For these classes TTF will be used directly without involving of gVirtualX
Remove there dependency from gVirtualX. One can potentially configure any other text engine
It returns text size in relative units for specified pad Use this method when apply to pad painter attributes
Test Results 22 files 22 suites 3d 10h 49m 41s ⏱️ For more details on these failures, see this check. Results for commit 52087ed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TVirtualXinterface which gives text metrics for specified font/size.TTFandnot-TTFplatform will be handled.TAttText::GetTextSizePixels(TVirtualPad &pad)andTAttText::GetTextSizeRelative(TVirtualPad &pad). These methods uses pad attributes to correctly scale font size depending from font precision. One can see that pixel size used by TVirtualX and relative size used by TVirtualPS outputReally missing is functionality to get pad pixel width and height. All kind of workarounds are really annoying.
Using equation:
pad_height = pad.YtoPixel(pad.GetY1());is not that one expects.