Dies ist die alte 4D Dokumentations-Website. Die neue und aktualisierte Dokumentation finden Sie unter developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
SVG_New_textArea
|
SVG_New_textArea ( parentSVGObject ; Text {; x {; y {; textWidth {; textHeight {; font | styleDef {; Größe {; Stil {; Ausrichtung}}}}}}}} ) -> Funktionsergebnis | ||||||||
Parameter | Typ | Beschreibung | ||||||
parentSVGObject | SVG_Ref |
![]() |
Reference of parent element | |||||
Text | Text |
![]() |
Text to insert | |||||
x | Lange Ganzzahl |
![]() |
Coordinate on X axis | |||||
y | Lange Ganzzahl |
![]() |
Coordinate on Y axis | |||||
textWidth | Lange Ganzzahl |
![]() |
Width of text area | |||||
textHeight | Lange Ganzzahl |
![]() |
Height of text area | |||||
font | styleDef | Text |
![]() |
Font name or Style definition | |||||
Größe | Ganzzahl |
![]() |
Size of characters in points | |||||
Stil | Ganzzahl |
![]() |
Style of characters | |||||
Ausrichtung | Ganzzahl |
![]() |
Alignment | |||||
Funktionsergebnis | SVG_Ref |
![]() |
Reference of SVG text object | |||||
The SVG_New_textArea command inserts a text area in the SVG container designated by parentSVGObject and returns its reference. If parentSVGObject is not an SVG document, an error is generated.
The "textArea" element is recommended by the SVG tiny 1.2 standard and implemented in 4D v11 SQL beginning with version 11.3 (see http://www.w3.org/TR/SVGMobile12/text.html#TextAreaElement). This element implements a text area that, unlike the "text" element, automatically handles the line feed when the text exceeds the width requested.
Notes:
The optional x and y parameters can be used to specify the position on the X and Y axes of the top left corner of the area.
The optional textWidth and textHeight parameters specify the size of the area in the user coordinate space. If one or the other of these parameters is not provided, the text area will automatically be fitted to its contents.
The SVG_New_textArea command accepts two different syntaxes for setting characters:
0 = Plain
1 = Bold
2 = Italic
4 = Underline
8 = Strikethrough
1 = Align default (left)
2 = Align left
3 = Center
4 = Align right
5 = Justify
SVG_New_textArea($Dom_svg;"Hello World !";x;y;vWidth;vHeight;style_definition)
style="font-size:48px;fill:red;"
$svg:=SVG_New
`Position a border rectangle
$rec:=SVG_New_rect($svg;5;5;210;320;0;0;"#777";"peachpuff";3)
`The text
$txt:="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor."
$txtArea:=SVG_New_textArea($svg;$txt;10;10;200;310;"Georgia";25;Italic;5)
`Save document
SVG_SAVE_AS_TEXT($svg;"test.svg")
Display of multi-style text:
C_TEXT($Dom_svg;$Dom_text;$Txt_buffer)
//definition of multi-style text
$Txt_buffer:="<SPAN STYLE=\"font-size:18pt\">Hello </SPAN>"+\
"<SPAN STYLE=\"font-size:24pt;font-weight:bold;color:#D81E05\">World</SPAN>"+\
"<SPAN STYLE=\"font-size:36pt\">!</SPAN><BR/>"+\
"<SPAN STYLE=\"font-size:19pt;font-style:italic\">It's </SPAN>"+\
"<SPAN STYLE=\"font-size:24pt\">Monday</SPAN>"
$Dom_svg:=SVG_New
//title
SVG_SET_FONT_COLOR(SVG_New_text($Dom_svg;"_______ SVG_New_textArea ______";10;30;"";-1);"blue")
//textArea
$Dom_text:=SVG_New_textArea($Dom_svg;$Txt_buffer;50;50)
SVGTool_SHOW_IN_VIEWER($Dom_svg)
SVG_CLEAR($Dom_svg)
SVG_APPEND_TEXT_TO_TEXTAREA
SVG_New_text
SVG_New_vertical_text
SVG_SET_TEXTAREA_TEXT
Produkt: 4D
Thema: Text
Nummer:
65955
Erstellt: Composant 4D SVG v11.3
Geändert: 4D v12
Geändert: 4D v13
4D SVG ( 4D v20 R7)