KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: SVG 'textArea' Element Now Supported
PRODUCT: 4D | VERSION: 11.3 | PLATFORM: Mac & Win
Published On: February 11, 2009

Starting with 4D v11 SQL Release 3 the 4D SVG rendering engine can handle the 'textArea' element from the SVG Tiny 1.2 Specification.

This is valuable because text wrapping is not available by default in the SVG specification when using the 'text' tag. The SVG Tiny 1.2 specification allows the 'textArea' element to be used in singular rectangular regions. It is a simplistic text wrapping use, but can save a lot of development time and effort if only a rectangular text box is necessary.

Here is the code for a sample text area, 200 by 300 that wraps the text "Place your sample text here..." within the rectangular box. Border sizes (x and y attributes) and font size and family are also specified within the 'textArea' element:

<textArea font-size="25" font-family="Georgia" x="10" y="10" width="200" height="300">Place your sample text here...</textArea>

Commented by Charlie Vass on July 20, 2009 at 4:20 PM
An SVG texArea is a part of the 1.2 specification. When exporting and SVG object for viewing in a third party application, such as a web browser, the textArea will only be visible if the application is SVG 1.2 complient.
Commented by Charlie Vass on March 30, 2009 at 1:55 PM
Text placed with "SVG_New_text" will respond to User Clicks, Text Areas placed with "SVG_New_textArea" does not respond to a user click. If you need to know if a user clicked on a Text Area you need to backgound it with a "SVG_New_text" and respond to the click on the associated rect.