Skip to content
Prev 31170 / 63424 Next

Automatic shortening of text to fit into area

Hi
Prof Brian Ripley wrote:
As a measure of the rarity, I wrote that code almost 10 years ago and
this is the first mention of this problem (though perhaps there are
millions out there suffering in silence ...).

I agree that dropping one character at a time and trying again would be
better than just not drawing anything, and your patch is nice and light
(especially given the nasty complexity of the GEText code), but the
suggested patch only addresses the case where the text extends out the
right hand side of the device (and is not rotated).  The modification
also needs to handle the case(s) where the characters should be dropped
from the front of the text.  I also wonder whether it might be possible
to make the patch local to just the clipTextCode() function (because the
clipTextCode function that it calls does its own calculation of the text
width and height).

Paul