ligatures in Java 2D

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
 
C

Chris Uppal

Thomas said:
Do you happen to have the GoF book at hand? For example the first
paragraph of the first page (xi) of the prefix contains a ligature.
"This book assumes you are reasonably proficient ...". See the "fi" in
"proficient"? IMHO it is printed as a ligature.

Oddly enough, my copy of GoF (11th printing, May '97) does not appear to use
ligatures. The f and i in that word are clearly separated, and the i has a dot
of its own.

-- chris
 
D

Des Small

Chris Uppal said:
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.
Noted.
[...]
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.

From 1999 to 2005 is a lot of yet, in my considered. And Java's
roadmap doesn't look very client-bound.
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.

Well, it's uglier than that. Since I also want goodies like search
and replace, I have to keep a spare copy of the umunged text as well
as a munged copy for the typesetting outside of the rendering pipeline
where we both (and the docs) agree it properly belongs.
It already has one, U+FB06. ;-)

D'oh said:
Which confirms that the Java standard font stuff is not suitable for
your purposes.

Vigorous agreement there. I didn't especially come here for an
argument, I thought my information might have been out of date or
incomplete.

Thanks to everyone who has helped clear this up.

Des
 
R

Roedy Green

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.

For future reference, these are documented at
http://mindprod.com/jgloss/ligature.html
 
R

Roedy Green

Which confirms that the Java standard font stuff is not suitable for your
purposes.

to handle that in Java you could modify the encoding of the font to
insert the ligature glyphs into the private area of Unicode, if they
were not already there. Then you would have to use the roll your own
GlyphVector technique.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top