Skip to content
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 alignment #193

Open
WindowsNT opened this issue Feb 2, 2025 · 1 comment
Open

Text alignment #193

WindowsNT opened this issue Feb 2, 2025 · 1 comment

Comments

@WindowsNT
Copy link

WindowsNT commented Feb 2, 2025

Image

This is the output of {[ c2/12 ]}, the "3" in the tuple is misaligned.

When debugging I saw that the top left rect (x,y) passed to DrawString may be the "bottom" of the text.

I need some help understanding the SetFontAlign parameters. For example, is the kAlignCenter both horizontal and vertical alignment?

@dfober
Copy link
Member

dfober commented Feb 4, 2025

Text alignment for tuplets for VGDevice::kAlignCenter | VGDevice::kAlignBottom.
I suggest to test various text alignments with your implementation, using text elements only. You can compare your output with the online guidoeditor.
e.g.

{
[
	\text<"right", textformat="rt">(a) 
	\text<"center", textformat="ct">(a)
	\text<"left", textformat="lt">(a)
]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants