-
Notifications
You must be signed in to change notification settings - Fork 0
Description
While experimenting with new examples for text file output (effectively a constant width font), I came across a minor problem. It appears that when KP looks at the accumulated line length (when determining where to split), it is failing to account for the hyphen that may need to be added to the end of the line (i.e., the line ends with a word fragment). The issue arises when the line (with fragment) is already close to being full (r = 0). This is not major issue for proportional fonts, although it is possible that a line that was already a bit tight (r approaching -0.5) could end up excessively tight (r < -0.5) once the hyphen is added. This is not applicable if "hanging punctuation" is used (the hyphen ends up past the right margin anyway).
For constant width fonts (such as flat text output), where r must be ≥ 0, the effect of not taking that hyphen into account can be that the line ends up one character too long. A proportional font can largely hide this by tightening the line a bit more than it should, but for constant width, the interword spaces can't be reduced, so the line ends up one too long.
Most typesetting is done with proportional fonts, so this is not a serious shortcoming, but at some point it should be addressed. Possibly, any word fragment could have its width increased by a hyphen, but only if it's likely that this fragment will be at the end of a line. It will take some diving into the algorithm to see what the best course of action is.