Re: [svgwg] lengthAdjust values just for shrinking

This is definitely a behavior (`textLength` as a max-length) that I've felt is sorely missing from SVG. You usually only *need* to squish text to prevent it from getting too long and spilling out of a container (or the SVG borders).

The intended purpose of `textLength` is to accommodate differences from using a fallback font or different text shaping software.  But in those cases, if the result is slightly shorter text than your original design, your anchor and alignment settings should be able to still ensure a good appearance in most cases—one that is usually better than messing with the spacing of the letters.

For dynamic text content, `textLength` is currently not a useful option at all, as it will be just as likely to make things worse as to make them better.  A "shrink-only" option (so that `textLength` is treated as the maximum inline length) would be much more useful.

However, I agree with @fsoder that a "shrink-only" option is _independent_ of the `lengthAdjust` options, which control _how_ the length is adjusted, when it is adjusted.  You might want shrink-only, but only adjusting spacing, or you might want it to be shrink-only, but also scaling glyphs.  So a separate attribute should be used (`adjustIf="scale-down"`), or maybe an extra token on `textLength` itself (`textLength="max 320"`, or maybe `textLength="minmax(100,320)"`).

_________________________________________

I think it's also worth discussing whether it's feasible to add a `lengthAdjust` option that scales uniformly (effectively adjusting the `font-size`), instead of only in the inline-direction.  That's something that many people want. But it's a little more complicated: do you scale that span, without adjusting the line-height/em-value (like the way `font-size-adjust` works), or do you also adjust the block spacing (which is often what is wanted for  "text lock-up" designs)? 

But this should be a separate issue, as it is independent of the "shrink-only" adjustment request.

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/341#issuecomment-324452507 using your GitHub account

Received on Wednesday, 23 August 2017 20:26:55 UTC