Topic Options
#40385 - 08/14/12 11:11 AM Text underline, splits when using fully justified
DeanB Offline
OL Toddler

Registered: 04/05/12
Posts: 37
Loc: Harrogate, UK
If I use the underline feature within a text box, it works fine. However if i need to justify the text so it fills the text box left to right (column style) then the underline splits and just underlines each word. Like this, instead of like this

Is there any fix for this as at the moment I am having to set up the text in another program and then import as a static PDF

Top
#40389 - 08/14/12 01:37 PM Re: Text underline, splits when using fully justified [Re: DeanB]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 3631
Loc: Objectif Lune Montreal
DeanB,

I confirm it does that. Probably because it's programmed to add spacing between the characters to fill the space, but not actual "space" characters, and so there is no underlining.

There is no easy workaround. Programming it to put spaces is not applicable, since we couldn't properly make it fill the box. We also cannot control how the internal commands behaves.

Your best bet may be to convert your text box into PressTalk object, and then modify it to add lines using the LineTo command, and a loop.

Here's an example:

Code:
% Variables we need to define.
define(&ypos, measure, 0)
define(&xpos, measure, 0)

% Original text box code(with no underline)
MoveTo(0,0)
MoveTo(&Width,&Height)
Margin(0.0000,0.0000)
BeginParagraph(0.0000,&Width,0.0000,'leftright',0.1667,False)
SetStyleExt(&Style1,12.0000,0,[100],100)
Show('A blue frog recently escaped the zoo, and found refuge in our developpers database. But if you perform a search for Blue Frog on our database, the search engine will return all its hiding places.')
EndParagraph()

% Store the current x and y positions.
&xpos := &current.x
&ypos := &current.y

% Draw the lines, repeat till we reach the y position
% we were at.
SetLineWidth(0.0070)
SetStrokeColor([100])
SetDash([1,0])
MoveTo(0,0.21)
repeat
  LineTo(&width,&current.y)
  Stroke()
  moveto(0, &current.y + 0.1667)
until(&current.y >= &ypos)

% Draw the final line, which will stop at the
% old x position.
LineTo(&xpos,&current.y)
Stroke()



This will add lines using LineTo, and will cover the entire width. We're not using underlined text, but drawing actual lines. This is a modification to a text box's code after converting it to PressTalk from Tools->Convert to PlanetPress Talk.

You'll have to adapt it to your own form, of course. This uses a default size of 12, but if you make the text smaller or bigger, you'll need to adjust the spacings used in this example according to the font's size. This may require some trial and error. The text in the "show" command is the actual paragraph's text that you'll need to modify. Feel free to make it use variable data selections, variables, etc...

Hope that helps!

Regards,
Raphaël Lalonde Lefebvre


Edited by Raphael Lalonde Lefebvre (08/14/12 01:40 PM)

Top