| 

.NET C# Java Javascript Exception

1
Ich habe gehört, dass es für eine Java-Anwendung mehrere Möglichkeiten gibt, die Fonts festzulegen, die sie verwenden kann. Welchen Unterschied macht es, ob ich beispielsweise logische oder physikalische Font-Namen verwende?
06.12.2011
1 Antwort
1
Ganz einfach. Physikalische Font kannst du dir aussuchen, logische nur bedingt. Wie beim Browser. Da kannst du auch einstellen (ich zumindest kann das) welcher Font gezogen wird, wenn ein Sans Serif gewählt wird.

Die Doku sagt dazu:

Physical and Logical Fonts
The Java 2 platform distinguishes between two kinds of fonts: physical fonts and logical fonts.

Physical fonts are the actual font libraries containing glyph data and tables to map from character sequences to glyph sequences, using a font technology such as TrueType or PostScript Type 1. All implementations of the Java 2 platform must support TrueType fonts; support for other font technologies is implementation dependent. Physical fonts may use names such as Helvetica, Palatino, HonMincho, or any number of other font names. Typically, each physical font supports only a limited set of writing systems, for example, only Latin characters or only Japanese and Basic Latin. The set of available physical fonts varies between configurations. Applications that require specific fonts can bundle them and instantiate them using the createFont method.

Logical fonts are the five font families defined by the Java platform which must be supported by any Java runtime environment:
Serif, SansSerif, Monospaced, Dialog, and DialogInput. These logical fonts are not actual font libraries. Instead, the logical font names are mapped to physical fonts by the Java runtime environment. The mapping is implementation and usually locale dependent, so the look and the metrics provided by them vary. Typically, each logical font name maps to several physical fonts in order to cover a large range of characters.

Quelle: http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Font.html
06.12.2011
Karl 958 1 8
Karl 958 1 8

Stelle deine Java-Frage jetzt!