-
Notifications
You must be signed in to change notification settings - Fork 68
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
Several x.text angle and size problems problems #1077
Comments
Several of the PDF issues are due to limitation is the PDF specification (believe it or not, PDF doesn't support text alignment flags, etc). This has been addressed in master by exporting all text as a set of bezier curves rather than text tags, as this will ensure equivalent output on-screen, in png, and in the vector backends. Rotation direction is a matter of convention and differs across toolkits and domains. VTK uses the "positive = CCW" (as the trigonometry is more straightforward), but vcs appears to do the opposite when constructing the VTK text properties: The text size is a mystery to me. The manual specifies that text "height" is an integer between 1 and 100. I have no idea what units. @doutriaux1 wrote the bit that converts the VCS height to a fontsize in vcs2vtk.prepTextProperty -- perhaps a scale factor or similar needs tweaking? In short -- The PDF issues are (hopefully) fixed once and for all in master. Vector exported text should be identical to what is shown on screen, as it is now explicitly drawn in the exported image (rather than leaving the glyph loading/placement up to the viewer). The absolute text height units and text rotation conventions are documentation concerns for vcs -- @doutriaux1, can you find out what these conventions are supposed to be? @jypeter Thanks for the very thorough testing and report! |
|
Yup, text size is proportional to the height of the window; the ratio currently is text.height * window height / 800, rounded down to an integer. |
@jypeter @dlonie @chaosphere2112 @doutriaux1 again another related to #503 |
Yes, as complex as the PDF specification is, text support lacks some basic options ;) It's indeed a shame to lose the ability to edit the text directly, though it's simple enough to just replace the path with a new text object in an editor if needed. The path approach also has the advantage of ensuring consistent output across platforms/viewers, which often load different fonts for various face types and can cause some real headaches with alignment. |
Well, as long as it works and indeed everything is clean and look the same... Devil is in the details and my end users can sometimes be very picky about some details (change the color, move this over there, align the longitudes differently, etc...). So if I get something right on screen, it's better if I get the same in the output |
@jypeter the sign of the angle is following XGKS specification I agree it's not ideal but it is to preserve backward compatibilty. We can discuss "breaking" this but I really don't like the idea. |
@doutriaux1 as the last update to XGKS was in 2000, not sure this is a valid reason this decade, let alone century.. Right now is also an opportune time to break some backward compatibility, as with a significant rewrite comes change no matter how you like it, and it hurts less if it's all in one hit.. |
Closing this, as the issues have been resolved as follows:
If there are any unresolved problems from this thread, let's create new issues for them so we can more easily keep track of the individual tasks. |
I have found several serious problems when experimenting with x.text, that can be reproduced with the following simple script
can be seen in the png files below (2.1.0 is at the top)
Note: @chaosphere2112 can add this example or a variation of it to the Gallery, once the angles are OK (http://uvcdat.llnl.gov/gallery.php?primitive=text)
The text was updated successfully, but these errors were encountered: