-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Text gets chopped when rotated >60 degrees #175
Comments
Hi @kutukvpavel sorry for the slow reply here. I wanted to complete a few things first. I've just pushed an update into the MyGet feed 1.0.0-beta13.15 which will most likely fix any issues you have. Can you please give it a try and let me know? |
Thanks for addressing this issue @JimBobSquarePants ! Unfortunately, no luck with 13.15 either. I installed beta13.15 prerelease from MyGet, ported some API, rebuilt everything clean, and checked the package dll version, so I'm indeed running 13.15. But the images produced are exactly the same. Btw, this is my app repo, in case you'd like to have a look at the code/test it on your machine: https://github.com/kutukvpavel/FloorTilingOptimization |
@kutukvpavel can you create a simplified, self contained repro, demonstrating the problem by drawing only one tile with constant image, rectangle sizes and offsets? That would (1) immediately clarify if this is a bug (vs. potential usage issue in your application), (2) save us a lot of time, leading to a faster issue triage and bugfix. |
No problem, @antonfirsov . Here you are: https://github.com/kutukvpavel/ImageSharpDemo . |
@antonfirsov I've just pulled down the code from the sample and the usage appears correct. Can confirm 60 degrees appears to be the cutoff for correct rendering also. Definitely a drawing issue and not a fonts one. |
a PR is available that fixes this issue - PR 191 |
…ts-chopped-when-rotated fixes #175 - Text gets chopped when rotated >60 degrees.
Prerequisites
DEBUG
andRELEASE
modeDescription
I'm trying to fill some rectangles and place tags (text) into them so that the tags are centered and rotated to match orientation of each rectangle. This means that I'm using DrawText either with a -90° rotation transform or without one. In case of the former, each character of the output text gets its bottom part cut at a consistent height that seems to depend on character index.
Take a look at 3 vertically oriented rectangles, two brown and one blue.
I've done some testing and observed that the issue occures for angles above ~60°. Angle sign does not matter. For example, this happens when I set the angle to +100° (set of rectangles is a random solution for an optimization problem, disregard the position changes).
Steps to Reproduce
First, I generate an image to draw on (it's padded to allow some rectangles that cross the expected boundary).
Then I draw a bunch of rectangles. I've tested it with a different font/size combination, no luck. Uncomment Draw() call to draw TextMeasure rectangle and see that it's always rendered correctly. The issue is somewhere inside DrawText.
Afterwards I resize and save the image (as PNG). I tested the code without final resizing, the problem persists.
System Configuration
The text was updated successfully, but these errors were encountered: