Hi All,

So building a TSpan text variable and passing it

$Dom_text:=SVG_New_textArea ($svgRef;$Txt_buffer;400;400) 

Works in terms of all the text and it seem that it is placed at the left/top.

However, I cannot figure out how to get all the text lines to align center. 

"<SPAN 
STYLE=\"font-size:18pt;font-weight:bold;text-align:center\">"+$chartInfo{$ndx}+"</SPAN>"

Adding “align:center” doesn’t work.

The html tag “text-align: center” doesn't work either.

And using SVG_SET_TEXT_ANCHOR ($svgRef;Align center)

Doesn’t do anything.

Anyone successfully able to set an SVG text area so that all the text lines 
align centered?

Thanks,
John…



> On Feb 28, 2020, at 11:07 AM, John J Foster <trueg...@isomedia.com> wrote:
> 
> Hey Keith,
> 
>> I find textAreas easier to work with for those purposes
> 
> OK, good! Seemed like it on the surface.
> 
> Not using in a browser but within  4D picture field. SO now worries about 
> that.
> 
> If I ever need a browser I’ll likely reengineer and use a javascript based 
> SVG API. They are super fast!
> 
> Appreciate,
> John…
> 
> 
> 
>> I find textAreas easier to work with for those purposes.  The only drawback 
>> is that the textArea is not supported by some browsers.  I'll see some 
>> documents appear without their text in Safari when textArea is being used.
>> 
>> Keith - CDI
>> 
>>> On Feb 28, 2020, at 10:18 AM, John J Foster via 4D_Tech 
>>> <4d_tech@lists.4d.com <mailto:4d_tech@lists.4d.com>> wrote:
>>> 
>>> Hi All,
>>> 
>>> 4D v17 (mac and windows)
>>> 
>>> In my current need I have been creating text by looping though an array and 
>>> then creating each text line individually and placing each new line below 
>>> the one previously created. This works fine.
>>> 
>>> But there are scenarios where I would be easier to manage a series of text 
>>> as a single object (SVG_New_textArea OR SVG_New_tspan) and then place it 
>>> centered horizontally/vertically at a point on the doc.
>>> 
>>> For example placing centered lines of text within a circle and having it 
>>> perfectly centered both horizontally and vertically.
>>> 
>>> Before I rewrite code I’d like to make sure that I am conceiving the 
>>> problem correctly. And then using the correct SVG command.
>>> 
>>> Anyone with experience who has used SVG_New_textArea OR SVG_New_tspan? Are 
>>> they the “ideal" way to move forward?
>>> 
>>> Thanks,
>>> John…
> 

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to