[Libreoffice-bugs] [Bug 144608] Cannot use paragraph alignment in text box together with text anchor

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Sep 21 15:31:53 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=144608

--- Comment #9 from Mike Kaganski <mikekaganski at hotmail.com> ---
(In reply to sergio.callegari from comment #8)
> - I have always assumed that the role of the anchor was to determine how the
> text box should automatically alter its size when there is a need to do so
> (namely what should remain fixed when the size is automatically altered). Is
> this correct?

No. The size of *text box* (the graphical object), and the size of *text* that
it contains, are two different sizes. There is an *option* to resize control
automatically based on its content, but that is just an option. You need to
think about the text box and its text as *two* separate (related) boxes.

So when you define the anchor, you define the relation between these two boxes.
The graphical object has its borders; and you define which border, or which
corner, of the graphical object will be considered the starting point (anchor)
when starting to lay out the text. The text will start from there, but will not
consider the other elements of the graphical object.

> - I have always expected paragraphs to be laid out in the text box as they
> are in the regular page considering the size of the text box and aligning
> the individual paragraphs left, center, right or justified as set in the
> paragraph properties. I now understand that when you do not have the "full
> width" tick set the individual paragraphs are laidd out using their own
> natural width as the "page" size. Why is this needed? Is there a case where
> you need the full width unselected? That is something that you would not be
> able to do with the mere paragraph alignment controls?

This is the common property of the graphical objects, of which the text box is
just one example. There are other types - e.g., you may type text inside
rectangles or ellipses, or inside raster images. You might not want tour text
to consider the owning object's dimensions - you may only need the text to
*relate* to the object, but not use its bounds.

> - Why do you say you need the full width switch off for the left and right
> anchoring?

Someone ;) had written in comment 6:
> The anchor is meant to define how the text box should grow to accommodate more
> text when this is needed.

This was not *completely* correct, but if you rectify it like this:

"The anchor is meant to define how the text's (not necessarily its owner
object) bounds should grow to accommodate more text when this is needed"

this helps to understand why. If you anchor the text so that it would *grow*
from left, it *necessarily* means that it would grow *to the right*. But how do
you intend it grow to the right, if you already set both its left and right
bounds?

> This makes it impossible to achieve something like what I have
> just described in an example. You have a text box with some predefined width
> and you put them close to the right border of the page. In this box you want
> left alignment. But you may also want right anchoring, so that if one puts
> in the box more text that it can fit, rather than putting the text off the
> page, the box can expand to the left.

No. You are just using the wrong tool for that. To make what you want:

1. You define your text box *positioned* on the page by using its "Position and
Size"; there you make its horizontal position "Right" to whatever you need
(e.g., paragraph area);
2. You open the text attributes dialog to define the anchor - e.g., right top
corner; you also make sure that "Fit width to text" is selected;
3. You use whatever alignment of the paragraphs you need in that object.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210921/e2832345/attachment.htm>


More information about the Libreoffice-bugs mailing list