IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#57571 - 07/17/20 10:42 AM Help to center the text
Demerval Offline
OL Newbie

Registered: 05/18/12
Posts: 22
Loc: Brasil,Curitiba

Hello friend, I need a tip to leave my text centered in the middle of the box, when it has few lines. Sometimes it is complete and perfect, but when there are one to two lines, the text is ugly in the drawing.

Video to see what I'm talking about

[video:youtube]https://youtu.be/bviJjFZNmqk[/video]

Any tips.

Top
#57572 - 07/17/20 10:55 AM Re: Help to center the text [Re: Demerval]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 681
Loc: Québec, Canada
What you have is not related to the number of lines. It has to do with the back-end code and the way it cuts a line.

If your line has a lot of big words, then you'll end-up with big spaces between words as you have selected both side alignment ('leftright').

If the line as a lot of small words, the spacing between words will be smaller.

The reason is that the code doesn't break a word in two.
You should try 'center' instead as the extra space will be on the outside of the text and not in between words.
_________________________
♪♫♪♫
99 frigging bugs in my code
99 frigging bugs
Take one down
Code around
127 frigging bugs in my code
♪♫♪♫

Top
#57573 - 07/17/20 11:40 AM Re: Help to center the text [Re: Jean-Cédric]
Demerval Offline
OL Newbie

Registered: 05/18/12
Posts: 22
Loc: Brasil,Curitiba
Jean, I believe you didn't understand, but the text is perfect, it doesn't need anything. What I need is for it to vary or its center, but it does not make text but where it is, see the video or the alignment of the two, as the text does not have many lines I would like it to be lower down centering the position of the text. Not the text that is perfect.


[video:youtube]https://youtu.be/NarcKybDG5U[/video]

Top
#57574 - 07/17/20 12:41 PM Re: Help to center the text [Re: Demerval]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 681
Loc: Québec, Canada
Ah, you want your text to be center vertically!!!

The idea is to know in advance the height of your text, which is not possible unless you get into wild calculation.
However there is a trick to it.

To achieve what you want is to execute your Text object twice.

Once, outside of the printing area just to get the actual height of it once produce with the data. In that object, tick the box Dynamic height that you'll find under the Basic Attribute of the object. Then store that height into a global variable, in the Press Talk After. Like this:
Code:
&globalVariable := &height


Now that you know what will be the height of your Text object, you can, in the second Text object that is shown in your printing area, in its PressTalk Before move your object up by half the size of it:
Code:
translate(0,-1*(&GlobalVariable1 / 2))
_________________________
♪♫♪♫
99 frigging bugs in my code
99 frigging bugs
Take one down
Code around
127 frigging bugs in my code
♪♫♪♫

Top