C
Chris Uppal
Des said:The problem with that is there is no protocol to ask fonts whether
they do or not have such ligatures.
If you were content to use the 7+4 common ligatures found in English text then
you could use Font.canDisplay() with the corresponding Unicode code point. I
know you are not content to limit yourself thusly, but just for completeness.
[The Unicode English text ligatures] are essentially deprecated:
"Deprecated" is the wrong word. It is true that they are purely
presentational, and that that does not fit with what Unicode is intended for.
Nevertheless, they exist, and they always /will/ exist (Unicode code points
never change once assigned). They are indeed intended for legacy purposes, and
while they probably should not appear in Unicode /text/ (i.e. shared between
applications), using them internally to an application is a legitimate use. In
this case, using them to "talk" to the Java font APIs is legitimate.
For reference, Unicode defines ligatured characters for the following:
ff
fi
fl
ffi
ffl
ft
st
starting at U+FB00. It also defines ae, oe, AE, and OE (plus various accented
derivatives). This is a superset of the ligatures in the Adobe "Standard
Roman" + "Expert" character sets.
It's the rendering engine's job to do this stuff.
Agreed.
The current Java rendering engine does not do this stuff.
Agreed. Although it does have the hooks internally, as I said before they are
not (yet) exposed in the public API.
The current Java rendering engine does not have hooks to allow me to
do this stuff. (Yes, I can feed it deprecated characters. No, I'm
not going to.)
If the Unicode-derived restrictions are too much for you then the existing API
is undoubtedly inadequate. But if it /would/ suffice if you were willing to
use it, then refusing to do so just because you think the character assignments
are "deprecated" would be a mistake.
Note that some fonts have a fancy 'st' ligature which has no Unicode
codepoint and which isn't going to get one.
It already has one, U+FB06. ;-)
Just to put the matter beyond reasonable doubt, though, I have decided
that the showpiece for my implementation will be the correct handling
of Fraktur writing, which has many ligatures not encoded in Unicode
code-points.
Which confirms that the Java standard font stuff is not suitable for your
purposes.
-- chris