Re: Wrapping Text in SVG

Hello,

to fit text into a rectangular area, the approach of
SVG tiny 1.2 textArea is already not bad - why not
to continue with this?


But what one needs additionally, from my point of view:
a) overflow: scroll and overflow: auto for text boxes
with a behaviour as known from ordinary CSS.
b) Additionally an alternative approach for the
situation, that the text with line wrapping does
not fit into the rectangular box.
To be able to have a method to adjust the
font-size automatically would be a good
idea, for example a property named
scale-font-size with values like auto,
resize,  reduce,  increase, none.
reduce only applies in case there is a
need to reduce the font-size, that the 
text fits into the box.
increase only applies to in case there
is a need to increase the font-size,
that text fits into the box.
resize fits in both cases the text into
the box.
c) Increase the box (depending on
the text direction either horizontally or
vertically) including wrapping
to a size, that the text fits and be 
able to reuse this size for backgrounds
or positions of other elements and
the size of the viewBox
(maybe difficult to do this, if one
does not use such a content model
as assumed for XHTML+CSS).

Currently one does not even have
all of this, if one puts an XHTML fragment
into a foreignObject.

At least for use cases I have in mind,
it is typically not meaningful to clip text,
if there is more text that fits into the box.
And if there is no clipping and the text
flows out of the box there is at least
a need to require the user agent to
extent the viewBox on demand in an
easy way, that the reader has a chance
to read all the text.

Clipping text is maybe of some relevance
only, if the text consists of repeated segments
like a pattern and there is no really need to
see more than one segment at all to
understand the message.


Olaf

Received on Tuesday, 4 June 2013 09:23:25 UTC