Apache OpenOffice (AOO) Bugzilla – Issue 74715
Text Box should offer more alignment options
Last modified: 2013-02-07 22:35:00 UTC
Many of the more profesional page layout apps provide alignment options to edges of the actual text in a text box. In Draw I've found that even after setting the text to fit frame & make all margins 0, the text still has a gap from the surrounding box (even if this box doesn't show). Well, most other progs (Corel Draw, Illustrator, Scribus, etc.) also has this "defect", but they've got a solution: You can align text to another object by choosing to align the actual text's edges, not the box's. For example, say you have a rectangle with some text below, you need to align the left edge of the text to the left edge of the rectangle. With Draw the text will always be slightly to the right of where it should be - unless you fine-tune the position manually (which is a pain).
Reassigned.
Created attachment 64181 [details] Sample to show problem
Created a sample to show the problem. Each of the texts has a spacing to borders set to 0.00cm and then aligned to the rectangle below. The 2 lines below that is split into 2 text objects since the "space" next to each character varies between characters. This is not the case in other programs (e.g. Scribus) which aligns the actual character to the specified side of the text box. So an align of a multi-line text box aligns all the characters correctly. BTW, the sample was done in OOo Draw 3.0 so it's still a problem.
Looks like text boxes are only formatted for the logical extents of the text. Add the option to use the ink bounding boxes instead sounds like a good idea.
It's actually even worse than just aligning to the ink boundary. Since multiple lined paragraphs don't even align with each consecutive line. See the example I've attached. The 2 top lines are inside one text box. As you'll note the capital T is much closer to the alignment edge than the next line's lowercase r. The bottom 2 lines I had to split into 2 separate text boxes and align then individually. The T and c's differences are even more pronounced then T & r. That's why I think this may be dependent on Issue 3243, at least if a version of Optical Letter Kerning is used there.
Created attachment 64230 [details] logical bounds of Arial's 'r' and 'T'
> you'll note the capital T is much closer to the alignment edge than the next line's lowercase r This is intended so by the font designer. See my screenshot above: the left-side-bearing of 'r' is 133, of 'T' it is only 48, i.e. it is about three times closer to the logical bound, which is exactly what you see in your screenshot.
> This is intended so by the font designer. Which is fine (I suppose) when there's 2 characters next to each other. But where I find it really irritating is at present I'm creating a email signature with logo & disclaimer at the bottom. I'm trying to line-up the disclaimer paragraph with the left edge of logo. While with some fiddling I can align most of the text lines with the logo, the text actually does not look aligned to left. It appears as if I indented by using spaces instead of a tab (like you find a non PC literate typist would do), while it's not even indented at all.
Created attachment 64233 [details] Example Draw file
I've just attached an ODG file with the problem shown. I've tried adjusting the text paragraph by moving it -0.01cm (absolute minimum which has any effect) after aligning with the rectangle. As you can see some of the text now passes to the left of the rectangle, while others are still to the right of the edge.
This confirms that OOo's textbox should get additional alignment options. Currently left-alignment always means alignment of the text origin (see http://www.myfirstfont.com/glossary.html for a nice overview of the difference between logical bounds and ink bounds). So the technical background of this issue has been clarified and the open questions in this issue about new options, best defaults, intuitiveness of user-interactions, etc. are already correctly assigned to "requirements".
IOW what should happen is to align with the left / right side of the text, minus the sidebearing of the character. I've just tried this in Scribus, it has an option for aligning text to the box sides using an "optical alignment" ... which seems to accomplish this task.