JDK-6407157 : RFE: Means to specify a Font with fallbacks for additional code point coverage
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 5.0,7,8,9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic,linux,windows_xp
  • CPU: generic,x86
  • Submitted: 2006-03-31
  • Updated: 2018-09-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Duplicate :  
Duplicate :  
Description
Java 2D provides several logical font families that are always present (eg SansSerif,
Serif) and these may be implemented as composites of several physical fonts.
The fonts that are used to implement the logical fonts are selected by the JRE to
be good choices for the platform using criteria such as quality, code point coverage,
expectation of being availabile (installed) and usage by the native desktop so that
the fonts are familiar.

For many applications this is simple and sufficient. However some applications
will prefer to use a specific physical font, perhaps even one created via
Font.createFont(). However it is unlikely that any single physical font will have
the same code point coverage as composite fonts, so in these cases the application
needs a way to specify that some particular font (or fonts) may be used for
additional fallbacks. This is sometimes called "font linking".

One approach to this might be to transparently always imply a composite font
as a fallback to any physical font. However there are semantic questions about
this. For example what should Font.canDisplay() return when the code point is
actually located in a fallback?

It is not clear that Java 2D at the pure Graphics layer should apply such fallbacks
without input from the application.

Perhaps this could be as simple as an API call on a "Font" instance to add
a fallback font, perhaps meaning some default fallback.  Whether that is simple
or practical in implementation terms is TBD, and also TBD is whether there are
issues such as if that is propagated to some place where the pure physical font
was expected.

For cases such as Swing, where it is probably desirable, perhaps the toolkit could
specify this on its Fonts so most applications would not need to do anything.

Perhaps rather than adding to an existing Font, which may be disruptive to code
that was not expecting the Font to be "augmented", we could add new Font constructors
or deriveFont() methods, which may take explicit Font parameters or a new
TextAttribute which references a fallback.

This highlights that are also semantic issues in constructing a new Font instance
where applications may be accustomed to just asking for the string name of a font
and constructing a new Font with the same name and expect it to have the same
behaviour except for perhaps a different size.
Applications which treated a font as fully described by its string name would
not be able to leverage these behaviours, however such applications are already
overlooking many attributes of a font.

Comments
See discussion at http://mail.openjdk.java.net/pipermail/2d-dev/2015-July/005591.html
28-07-2015

EVALUATION As per description, needs further consideration as to the best all round solution.
31-03-2006