docx icon indicating copy to clipboard operation
docx copied to clipboard

Two Paragraphs in a text-frame

Open nitayke opened this issue 2 years ago • 6 comments

Hi, I'm trying to create a text-box with 2 lines inside - heading and body of text. I want the heading to be bold, and the body to be aligned to both sides. If I use "break" in "TextRun", it makes line break but the heading is aligned to both sides: image Is there a way to make the heading not be aligned to both sides? Thanks

nitayke avatar Jul 03 '23 11:07 nitayke

Yes Try making the heading as a separate Paragraph

dolanmiu avatar Jul 04 '23 11:07 dolanmiu

But the text-frame itself is a paragraph... Can I put two paragraphs in the children of a text-frame paragraph?

nitayke avatar Jul 04 '23 11:07 nitayke

Yeah, i am not sure if this is possible. Is this even possible with Word itself?

I can do it in word by adding a table into the text box, but that seems hacky, the generated ooxml is weird

dolanmiu avatar Jul 05 '23 19:07 dolanmiu

The problem is that a regular textbox in Word is not the text-frame in the library. The text-frame is one Paragraph with an attribute that makes it float (gets x, y, and borders) and seem like a textbox. The classic textbox in word is a complicated structure that can contain a few Paragraphs.

nitayke avatar Jul 06 '23 10:07 nitayke

Perhaps we need two features, a TextFrame and Word's TextBox

Seems to be different concepts.

TextBox would be a new feature, seems complicated, uses the graphics API

dolanmiu avatar Jul 12 '23 10:07 dolanmiu

I would love a text box feature too. I agree it would likely be a big job.

kalda341 avatar Jul 12 '23 21:07 kalda341