Hi all,

After some of the recent fixes for default-ignorable characters [1, 2] I'm
wondering what the expected behavior for the following methods is w.r.t.
default-ignorable characters (or really any invisible glyphs):

Font.canDisplay(char)
Font.canDisplay(int)
Font.canDisplayUpTo(String)
Font.canDisplayUpTo(char[], int, int)
Font.canDisplayUpTo(CharacterIterator, int, int)

The JavaDoc for the first two methods explicitly states "checks if this
Font has a glyph for the specified character", which is clear enough, but
doesn't match the method name since in reality any font can display e.g.
U+200B (zero width space) regardless of whether it has a glyph in the font,
since U+200B will always map to the invisible glyph and will be skipped
during layout / rendering.

The JavaDoc for the last three methods is more ambiguous, seeming to focus
on whether or not the font "can display" the string. Again, characters
which map to invisible glyphs do not need glyphs in the font, so flagging
them as "can't display" seems questionable.

Basically, I'm wondering whether these five methods should be communicating
that chars which map to invisible glyphs can be displayed, regardless of
whether the font has a glyph for them.

Thoughts?

Take care,

Daniel

[1] http://www.unicode.org/L2/L2002/02368-default-ignorable.html
[2] https://github.com/openjdk/jdk/pull/22670

Reply via email to