Re: Possible to resize text to max size within a box?

Cameron McCormack <[email protected]>
Newsgroups gmane.comp.web.svg
Organization Mozilla Corporation
Message-ID <[email protected]>
Hi David and Mats,

> http://srufaculty.sru.edu/david.dailey/svg/test/bubbles2.svg (works
> in Chrome but not in Firefox – there was some part of textLength,(
> maybe?) that either Firefox hadn’t done or I had done wrong –
> don’t really remember) and of course Chrome will want me to rewrite
> all these examples before SVG2 moves to recommended status in 2023
> (barring objections) and is implemented cross browser in 2033. (humor)

The stretching of text there seems to work for me in Firefox.  (Firefox
doesn’t support textLength="" on <tspan>s, but does on a top <text>
element.)

I agree with Mats that adjusting the font-size to fit text in a
particular space is a useful effect, and probably something that you’d
want not only in SVG but CSS in general, although I am sure it is a
difficult problem to solve once you have line breaks and floats and so
on.

lengthAdjust="spacingAndGlyphs" just applies a scale in one dimension.
It shouldn’t be hard to extend that with another value that scales in
both dimensions (although note that scaling the text as if it had a
transform on it will not always get you the same result as scaling the
font-size down, due to hinting at least).  (I feel like the group might
have discussed this before…)

-- 
Cameron McCormack ≝ http://mcc.id.au/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.