Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Physical and logical fonts

Reply
Thread Tools

Physical and logical fonts

 
 
failure_to@yahoo.co.uk
Guest
Posts: n/a
 
      01-08-2008
hello

I'm learning a bit about fonts and while the following link did help
to some extent,

http://mindprod.com/jgloss/font.html

there are still questions bugging me about the subject!

Again, I apologize for so many questions, but I think other thread
makers would not appreciate it much if threads on first page were all
made by little me ( I realize all bunch of questions in one thread may
turn off potential helpers and thus may not give long and thorough
explanations on all individual questions asked )



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. So
what property makes physical fonts fall into one of five categories,
thus why not have just one logical category which could map to all
physical fonts?



2) I know java has build in physical fonts, but can logical fonts
themselves represent characters visually, or must they always be
mapped to physical fonts? Why?



3) I've read that logical fonts represent more characters than most
physical fonts do. Huh?! If logical fonts themselves can represent
characters, then why the need for mapping to physical fonts?




4) Can particular font support several encoding sets?



5) If answer is yes to the above question, then how do fonts relate to
character sets? For example:

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 )

thank you


 
Reply With Quote
 
 
 
 
RedGrittyBrick
Guest
Posts: n/a
 
      01-08-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      01-09-2008
(E-Mail Removed) wrote:
> Again, I apologize for so many questions, but I think other thread
> makers would not appreciate it much if threads on first page were all


First page of what?

If you're referring to the display from a particular newsreader, be aware that
people use quite a variety of products to access Usenet. Heree, for example,
the newsreader is not page oriented.

--
Lew
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      01-09-2008
RedGrittyBrick wrote:
> 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.


If the foolishness of an action restricted human behavior, there'd be a lot
less of it.

--
Lew
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      01-09-2008
(E-Mail Removed) wrote:
>> thus why not have just one logical category which could map to all
>> physical fonts?


RedGrittyBrick wrote:
> Firstly because most GUI apps need more than [one] font. Five visually
> distinct fonts is a reasonable number to have available for most GUI apps.


Any more runs you into ransom-note typography, a common but egregious layout
mistake.

One guide I read years ago, and I believe Microsoft has some online material
to support this, suggested that one select one each of three types of font
family: a proportional serif font, a proportional sans serif font, and a
monospace font. Use the serif one for explanatory text, the sans serif one
for headlines and subject headings, prompts and the like, and the monospaced
one for special purposes. Rarely if ever should one put a fourth font family
into the mix. Size and stroke (normal vs. oblique) one may vary sparingly at
need.

Microsoft specifically recommends the Windows fonts Georgia (proportional
serif), Verdana (proportional sans serif) and Courier New (monospaced) for web
pages. Most places I've worked use Times New Roman (in a larger point size
than you'd use for Georgia), Arial and Courier or Courier New, respectively.

I personally am fond of the "Book(man)" and "Bitstream" category of fonts.
They have near equivalents in both the Linux and Windows worlds, too.

--
Lew
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-09-2008
On Tue, 8 Jan 2008 09:30:29 -0800 (PST), (E-Mail Removed) wrote,
quoted or indirectly quoted someone who said :

>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. So
>what property makes physical fonts fall into one of five categories,
>thus why not have just one logical category which could map to all
>physical fonts?


Even though your computer may have hundreds of fonts installed, with
AWT, you can only get at five of them, five chosen by Sun (unless you
use drawString). Sun chooses the physical fonts from ones it bundles
and ones known to be installed with the OS, and then maps the five
logical fonts onto the five chosen physical ones.

I am updating the entry at http://mindprod.com/jgloss/font.html to
clarify.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-09-2008
On Tue, 8 Jan 2008 09:30:29 -0800 (PST), (E-Mail Removed) wrote,
quoted or indirectly quoted someone who said :

>2) I know java has build in physical fonts, but can logical fonts
>themselves represent characters visually, or must they always be
>mapped to physical fonts? Why?


If there were no logical fonts it would be impossible to write a
program guaranteed to run everywhere since they are no physical fonts
guaranteed to be installed everywhere. By mapping logical fonts to
physical fonts, monospaced for example can be mapped onto the most
popular monospaced font on a given platform, without Sun having to
licence and provide the physical font for every conceivable platform.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-09-2008
On Tue, 8 Jan 2008 09:30:29 -0800 (PST), (E-Mail Removed) wrote,
quoted or indirectly quoted someone who said :

>3) I've read that logical fonts represent more characters than most
>physical fonts do. Huh?! If logical fonts themselves can represent
>characters, then why the need for mapping to physical fonts?


Which fonts get mapped is a property of the physical font. Sun chose
physical fonts with support for a wide selection of Unicode characters
to represent its logical fonts.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-09-2008
On Tue, 8 Jan 2008 09:30:29 -0800 (PST), (E-Mail Removed) wrote,
quoted or indirectly quoted someone who said :

>
>4) Can particular font support several encoding sets?


Modern fonts often come with several encodings. Java just uses the
Unicode encoding.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-09-2008
On Tue, 8 Jan 2008 09:30:29 -0800 (PST), (E-Mail Removed) wrote,
quoted or indirectly quoted someone who said :

>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 ).


Java just uses the Unicode encoding and ignores the rest. Read up on
the OpenType format to understand how you can have multiple encodings.

see http://mindprod.com/jgloss/opentype.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Logical Pages vs Physical Pages Jose Barragan ASP .Net 1 10-23-2008 07:27 PM
DAL is physical mapping and BLL logical? =?Utf-8?B?TWF0dE0=?= ASP .Net 1 12-07-2006 02:38 PM
Physical Addresses VS. Logical Addresses namespace1 C++ 3 11-29-2006 03:07 PM
Confusion regarding logical vs. physical drawings unixzip@yahoo.com Cisco 0 07-18-2005 03:20 PM
Re: Are 2 physical / 4 logical processors supported? ocbwilg Windows 64bit 2 05-11-2005 06:21 AM



Advertisments