You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know the bug is with the fonts or in openscad; however if you try to align a text going in Y direction (btt or ttb) you may get a different horizontal alignment depending on the font.
text(text="Meow",valign="top",halign="left",direction="btt");
This seems to be a problem with all Liberation fonts on my system. halign = left pretty much centers the font.
Another test case for me is: text(text="Meow",valign="top",halign="center",direction="btt", font="Liberation Sans");
This puts the font at the Y center (towards -Y direction)
Not all fonts have issues with this, for example Helvetica works as I expect: text(text="Meow",valign="top",halign="left",direction="btt", font="Helvetica");
Oh, I have not seen this type of extreme result, but it seems to be fixed with the alignment changes that came with #3684. With the nightly build it looks ok on my system (Debian/Testing).
The overall alignment looks quite different now, I guess that needs another review if there's not more/other issues.
Note that the alignment is still based on font information, not geometry. With the new (experimental feature) textmetrics() (docu) it's possible to query that font information giving more options for alignment.
I did not address all text alignment / spacing issues.
spacing yields unobvious behavior in all but the most trivial cases. I don't think it can be salvaged. (See the "More on text alignment" thread above.)
There's an argument that horizontal alignment in RTL text is wrong. The general idea is that in the default case the origin should be where your pen starts, and you should draw from there as is natural for the text. Thus for LTR text you would draw to the right of the origin, but for LTR text you would draw to the left of the origin.
I don't know the bug is with the fonts or in openscad; however if you try to align a text going in Y direction (btt or ttb) you may get a different horizontal alignment depending on the font.
text(text="Meow",valign="top",halign="left",direction="btt");
This seems to be a problem with all Liberation fonts on my system. halign = left pretty much centers the font.
Another test case for me is:
text(text="Meow",valign="top",halign="center",direction="btt", font="Liberation Sans");
This puts the font at the Y center (towards -Y direction)
Not all fonts have issues with this, for example Helvetica works as I expect:
text(text="Meow",valign="top",halign="left",direction="btt", font="Helvetica");
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: