[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug awt/30106] JDK-1.0-style logical font names
From: |
hendrich at informatik dot uni-hamburg dot de |
Subject: |
[Bug awt/30106] JDK-1.0-style logical font names |
Date: |
14 Dec 2006 10:14:14 -0000 |
------- Comment #6 from hendrich at informatik dot uni-hamburg dot de
2006-12-14 10:14 -------
> This is not a case of compatibility only. What if an application requests
> TimesRoman in the expectation to get a TimesRoman (the real one) but gets an
> arbitrary other font that we decide to map to?
Good point. I distinctly remember exactly that happening with an older IBM JDK
for "Courier" and "Helvetica", but nor for "TimesRoman" (because the actual
font is called Times. The JDK 1.0 font names were rather crazy.).
However, current JDKs seem to agree to map those names to the same fonts as
the logical fonts "Monospaced", "SansSerif", and "Serif", regardless of whether
those fonts are installed or not. IIRC, last time I tested this on a system
with the actual fonts, I actually could not load "Helvetica" because it got
substituted by LucidaSans.
> > Excatly. An (outdated) application that requests "TimesRoman" or "Courier"
> > expects to get those, but with current classpath its gets "Dialog" in both
> > cases.
>
> It wouldn't get TimesRoman anyway. At the very best it could get a similar
> font
> family of the same class. E.g. for courier, we could map to monospace etc,
> like
> you proposed. That is still not Courier though.
Don't tell me. I am painfully aware that I ask for "Courier" and get
LucidaTypewriter... This is ugly, but at least it is monospaced,
while the replacement for "Dialog" is not.
> Yeah. Fonts are (or at least should be - if not then this is clearly a bug)
> looked up as physical font names first. If a TimesRoman font is installed it
> should be loaded. Remember that there are real fonts with the names that you
> mention above.
I am not so certain about that. In my opion, the Font( logicalfontname, x, y )
constructor is only supposed to recognize the logical font names and returns
whatever the runtime thinks is the best replacement; even if a nice "Helvetica"
request maps to a fat wide "LucidaSans".
The behaviour for other font names seems mostly unspecified to me. I agree
that "Courier" and "Helvetica" SHOULD map to the actual fonts when they are
installed on a system, but the JDKs seem to have their own opinion about
this. The case of "TimesRoman" might require special treatment, because
the actual fonts are just called "Times".
An application that really wants to load a specific font is supposed to call
GraphicsEnvironment.getAllFonts() and search that list, or to load its own
font via Font.createFont( Font.TRUETYPE_FONT, inputstream ).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30106
- [Bug awt/30106] New: JDK-1.0-style logical font names, hendrich at informatik dot uni-hamburg dot de, 2006/12/07
- [Bug awt/30106] JDK-1.0-style logical font names, hendrich at informatik dot uni-hamburg dot de, 2006/12/07
- [Bug awt/30106] JDK-1.0-style logical font names, roman at kennke dot org, 2006/12/13
- [Bug awt/30106] JDK-1.0-style logical font names, hendrich at informatik dot uni-hamburg dot de, 2006/12/14
- [Bug awt/30106] JDK-1.0-style logical font names, roman at kennke dot org, 2006/12/14
- [Bug awt/30106] JDK-1.0-style logical font names, roman at kennke dot org, 2006/12/14
- [Bug awt/30106] JDK-1.0-style logical font names,
hendrich at informatik dot uni-hamburg dot de <=
- [Bug awt/30106] JDK-1.0-style logical font names, roman at kennke dot org, 2006/12/14