wrote:
> 1) Since there are five logical fonts in java, then that would suggest
> that not all physical fonts can be mapped to single logical font.
It doesn't suggest any such thing to me[1].
On any given system, at any given moment in time, the JRE might map each
logical font name to exactly one physical font name.
In principle any of the five logical fontnames could be mapped to any
physical font present, and vice versa.
As you say, Java typically maps one logical font name to several
physical fonts in order to provide access to a wide range of glyphs.
There is presumably a limit to the number of physical fonts that can be
mapped to a single logical font. Also, on any typical system, adding
more fonts doesn't always extend the set of Unicode characters for which
glyphs are then available.
> So
> what property makes physical fonts fall into one of five categories,
None. There's a file that defines the mapping. Whilst it would be
foolish to map a proportional font to a monospaced font-name I don't
think there's much else to restrict you.
> thus why not have just one logical category which could map to all
> physical fonts?
Firstly because most GUI apps need more than font. Five visually
distinct fonts is a reasonable number to have available for most GUI apps.
Secondly because there is no point. The reason for mapping multiple
fonts to one logical name is simply to increase the number of characters
for which a glyph is available [2]. Since most fonts on your PC define
glyphs for exactly the same set of characters, adding another such font
to the mapping does not make any new glyphs available. See [2]
> 2) I know java has build in physical fonts,
The JRE is shipped with some TTF font files. That doesn't mean that any
physical fonts are built in to the JVM itself.
Java != JRE != JVM
> but can logical fonts
> themselves represent characters visually,
No.
> or must they always be
> mapped to physical fonts?
Yes
> Why?
Because AFAIK [1] logical fonts consist of nothing more than a name and
a few characteristics. They contain no glyph data such as bitmaps or
scalable outlines etc.
> 3) I've read that logical fonts represent more characters than most
> physical fonts do.
I think you've misread something. Where did you read that?
> Huh?!
I expect Java is quite happy to attempt to display any Unicode value
using any logical font. The operating system will probably display most
of them as little boxes because no single physical font contains the
entire Unicode character set.
> If logical fonts themselves can represent
> characters,
> then why the need for mapping to physical fonts?
See above Logical fonts don't contain any information about the visual
appearance of individual glyphs.
> 4) Can particular font support several encoding sets?
You mean UTF-8, ISO-8859-1 and so on? Java supports many such character
encodings / character sets.
It is not necessary for a font to explicitly support, say UTF-8. When
you write text to a UTF-8 text file, fonts are not involved. Ditto for
ISO-8859-1 or any other such encoding.
If you have a wordprocessor that writes files containg text with font
data then the font info is in a separate part of the file from the text,
regardless of what encoding is used for the text.
> 5) If answer is yes to the above question, then how do fonts relate to
> character sets? For example:
I recommend you read Wikipedia, it has some good articles on this subject.
> Say we have a font that is able to display all ascii characters.
> We also have two different 7 bit encodings EN_1 and EN_2. Both are
> able to display all ascii characters. But they have different code
> points for individual characters ( for example in EN_1 code point for
> character A may be 65, while in EN_2 codepoint for A may be 100 ).
>
> Is always creator ( programmer not god ) of this font the one which
> enables support for both EN_1 and EN_2 encodings, or can this also be
> done manually ( by manually I mean by local users who'd somehow map
> individual glyph to particular codepoint )
You seem to be arbitrarily mixing up several concepts:
- character set
- encoding
- fontnames
- font files
In some circumstances you can indeed remap the association of particular
glyphs in a font to particular codepoints. For example this is often
done when printing using postscript type-1 fonts. It is called changing
the encoding vector. I'm not sure this is something a Java programmer
need be concerned with.
[1] Caveat emptor. I am not a Java font expert.
[2]
http://java.sun.com/j2se/1.4.2/docs/...nt.html#lucida