-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Question about text series api (TextLine、NewTextBox..) #19
Comments
I think the text is aligned well, but the bounding box calculation is differently. Your first example uses text-width and line-height to draw the bounding box, while the second example uses text outline paths to calculate the exact bounding box. As you notice, the first example the stem from the If you draw the same piece of text, do they have the same position in both versions, even though the bounding box is displayed differently? |
Anyways, see 283bf67. I've updated the meaning of |
Line stretch modifies the distance between two lines, it looks like you only have one line of text. You could looks at this picture and figure out what all the different measures and metrics mean: https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/Art/glyph_metrics_2x.png In In general, it looks like they use |
I think the problem is this: in https://godoc.org/golang.org/x/image/font#Metrics the It might be that the font incorporates the line gap in the ascent/descent values, this depends on the font, see golang/freetype#32. This cannot be fixed without manual tweaking or until I write the custom font loader. In the mean time, you could maybe move the text box up by as much as |
hi, I want to draw a text content at the top-left of the screen, and without spacing. like this.
so I do a simply transform
and call c.DrawText, set y * -1
but, I have trouble in the "TextBox".
I tried to do some tests, you can see the text.Bounds() has little offsets. and here is my code
sorry for bad english
The text was updated successfully, but these errors were encountered: