Re: SVG_New_textArea OR SVG_New_tspan

2020-02-28 Thread John J Foster via 4D_Tech
Hi All,

Never  mind about the last comment. The solution needs to be applying to each 
text area NOT to the SVG document.

Here’s the correct way for each line:

$Dom_text:=SVG_New_textArea ($svgRef;$Txt_buffer;0;0) 
SVG_SET_TEXT_ANCHOR ($Dom_text;Align center)

This create the beginning of this code fragment:


  // Other text lines within


This is all working in an SVG play ground area. Now to the actual document and 
get ti working there.

Pretty cool and simple once the basics are understood.

And then to centering the object from the point of origin…

Hope this helps someone else.

John…


> On Feb 28, 2020, at 4:23 PM, John J Foster  wrote:
> 
> 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. 
> 
> " STYLE=\"font-size:18pt;font-weight:bold;text-align:center\">"+$chartInfo{$ndx}+""
> 
> 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 > <mailto: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
**

Re: SVG_New_textArea OR SVG_New_tspan

2020-02-28 Thread John J Foster via 4D_Tech
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. 

""+$chartInfo{$ndx}+""

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  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
**

Re: SVG_New_textArea OR SVG_New_tspan

2020-02-28 Thread John J Foster via 4D_Tech
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
**

Re: SVG_New_textArea OR SVG_New_tspan

2020-02-28 Thread kculotta via 4D_Tech
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> 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
> **

**
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
**

SVG_New_textArea OR SVG_New_tspan

2020-02-28 Thread John J Foster via 4D_Tech
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
**