Quote:
Originally Posted by knc1
In truth, it is much more complicated than I made it out to be.
If I can translate my own post:
Just be happy with the way it works, ignore the width of the last space on a justified line and the non-processed last line.
Anything else would probably double or triple the amount of code.
|
Text justification rules interact in unexpected ways, so that even a small "obvious" fix for one rule can unexpectedly cause other rules to break. Even the smallest of changes requires full regression testing of all of the text justification code to discover what else you just broke. Simple fixes often ended up not-so-simple when everything was working well again. And remember that text justification interacts with font and kerning changes too, and on video displays even anti-aliasing can affect text justification depending on how it is implemented. Things that sound simple in theory often become rather complicated in practice, and text formatting is one of those things.
EDIT: You may ask "How can anti-aliasing affect text justification?", and the answer would be "sub-pixel kerning and micro-justification". Kerning is the horizontal position adjustment of letters to place them closer together depending on the relative shape of the two adjacent letters, and some display technology allows you to adjust this to fractions of a pixel. Sub-pixel kerning depends on anti-aliasing to determine the sub-pixel boundaries. And micro-justification is used to justify columns of text on both the left and right boundaries, to eliminate visually unappealing "ragged-right" text, such as you see in these posts. To spread a line of text to the right boundary, you need to distribute the extra white space evenly throughout the line, preferrably on sub-pixel positions.
The reason for providing these details (which may be very interesting for some people, while annoying others) is to show that fixing the little "glitch" mentioned in previous posts could interact with other text-formatting in unexpected and undesirable ways. Or, it MIGHT be just a simple adjustment. You won't know until you try it. Trying to estimate the time required to perform this task is itself a waste of time. Even for a simple change, significant regression testing is required.