Hello all, I have a question about line breaking. I'm working in an environment where text going off the page should be avoided at all costs. Even when using hyphenation in FOP, it seems like some strings (e.g. only numbers) cannot be broken and therefore can go off the page. This seems especially prevalent when using table cells. One of the common recommendations seems to be introducing zero width spaces into the string. However, I'm more interested in seeing if it's possible for FOP to detect this issue automatically and force a line break.
My current understanding of the line breaking algorithm is that each "word" will be a single KnuthInlineBox. If hyphenation is enabled and hyphenation points are found, it will break this KnuthInlineBox into multiple KnuthInlineBoxes that are groups of characters; penalties and glues are then placed between each new KnuthInlineBox (representing each hyphenation point). I'm wondering how realistic it would be to further break these new KnuthInlineBoxes into KnuthInlineBoxes for each character. Then, add glue and even higher penalities between these character KnuthInlineBoxes. The goal would be to prefer the standard hyphenation points, but have even higher penalty places to break just in case. If there are no hyphenation points found, it will just break the original KnuthInlineBox into KnuthInlineBoxes for each character. I have created a simple proof of concept and it "seems" to work. My question is: how reasonable does this strategy sound? Is there a better way to accomplish this that someone could recommend? I suppose it's less efficient since multiple objects will be created for each character. Additionally, since hyphens could be added anywhere in a string, it could be added somewhere that changes the meaning of the string. I consider that a reasonable alternative to text going off the screen though. Thanks!  Here is an example where the string of characters will go off of the page since it is only numbers: <?xml version="1.0" encoding="UTF-8"?><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" language="en"><fo:layout-master-set><fo:simple-page-master master-name="all" page-width="8.5in" page-height="11in" margin-left="1in" margin-right="1in" margin-top="1in" margin-bottom="1in"><fo:region-body/></fo:simple-page-master></fo:layout-master-set><fo:page-sequence master-reference="all"><fo:flow flow-name="xsl-region-body"><fo:block hyphenate="true"><fo:block><fo:inline>1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112</fo:inline></fo:block></fo:block></fo:flow></fo:page-sequence></fo:root> CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.