*/
private static boolean isSpace(final char ch) {
return ch == CharUtilities.SPACE
- || ch == CharUtilities.NBSPACE
+ || CharUtilities.isNonBreakableSpace(ch)
|| CharUtilities.isFixedWidthSpace(ch);
}
(short) 1, (short) 0,
wordSpaceIPD, false, true, breakOpportunity);
iThisStart = (short) (iNextStart + 1);
- } else if (CharUtilities.isFixedWidthSpace(ch)) {
+ } else if (CharUtilities.isFixedWidthSpace(ch) || CharUtilities.isZeroWidthSpace(ch)) {
// create the AreaInfo object
MinOptMax ipd = new MinOptMax(font.getCharWidth(ch));
ai = new AreaInfo(iNextStart, (short) (iNextStart + 1),
public static final char NBSPACE = '\u00A0';
/** zero-width space */
public static final char ZERO_WIDTH_SPACE = '\u200B';
+ /** word joiner */
+ public static final char WORD_JOINER = '\u2060';
/** zero-width no-break space (= byte order mark) */
public static final char ZERO_WIDTH_NOBREAK_SPACE = '\uFEFF';
/** soft hyphen */
*/
public static boolean isZeroWidthSpace(char c) {
return c == ZERO_WIDTH_SPACE // 200Bh
+ || c == WORD_JOINER // 2060h
|| c == ZERO_WIDTH_NOBREAK_SPACE; // FEFFh (also used as BOM)
}
* @return true if the character has a fixed-width
*/
public static boolean isFixedWidthSpace(char c) {
- return (c >= '\u2000' && c <= '\u200B') || c == '\u3000';
+ return (c >= '\u2000' && c <= '\u200B')
+ || c == '\u3000';
// c == '\u2000' // en quad
// c == '\u2001' // em quad
// c == '\u2002' // en space
(c == NBSPACE // no-break space
|| c == '\u202F' // narrow no-break space
|| c == '\u3000' // ideographic space
+ || c == WORD_JOINER // word joiner
|| c == ZERO_WIDTH_NOBREAK_SPACE); // zero width no-break space
}
<changes>
<release version="FOP Trunk">
+ <action context="Code" dev="MM" type="fix">
+ Fixed incomplete support for Unicode Word Joiner characters (U+2060 and U+FEFF).
+ </action>
<action context="code" dev="AD" type="add" fixes-bug="42785" due-to="Max Berger">
Support alignment-adjust for images.
</action>
<fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
No-break-point-in-normal-dates-12/12/2006-or-fractions-12345678/67890112
</fo:block>
+ <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
+ WJ -- Word Joiner (XB/XA)
+ </fo:block>
+ <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
+ Here we/⁠prevent/⁠any/⁠breaks/⁠after the/⁠solidus
+ </fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
<eval expected="114460" xpath="//flow/block[27]/lineArea[1]/text/@ipd"/>
<eval expected="93380" xpath="//flow/block[27]/lineArea[2]/text/@ipd"/>
<eval expected="132860" xpath="//flow/block[27]/lineArea[3]/text/@ipd"/>
+
+ <eval expected="3" xpath="count(//flow/block[29]/lineArea)"/>
+ <eval expected="21670" xpath="//flow/block[29]/lineArea[1]/text/@ipd"/>
+ <eval expected="145630" xpath="//flow/block[29]/lineArea[2]/text/@ipd"/>
+ <eval expected="53360" xpath="//flow/block[29]/lineArea[3]/text/@ipd"/>
</checks>
</testcase>