Home
Categories
Dictionnary
Download
Project Details
Changes Log
Who We Are
FAQ
License

Fonts


    1  Font resolution
       1.1  Without a font family
       1.2  Pointing to a system font family
       1.3  Pointing to a physical font file
    2  Font characteristics
       2.1  Font size
          2.1.1  Point Unit
       2.2  Font position
    3  Example
    4  See also

The "fonts" element in the XML graphics definition File regroup definition of fonts They will be used for all widgets which uses a font index. Each font has the following attributes:

There are several ways to define a Font:
In all of these cases, the font may have the following attributes:

Font resolution

Without a font family

If no font family is specified, the default java font for the platform will be used. For example:
      <font name="t1" index="1" size="12" />

Pointing to a system font family

If a "fontpath" is specified with a "physicalName" attribute, a system font with the associated font family name will be retrieved. For example:

      <font name="t3" index="3" size="10" >
         <fontPath physicalName="Courier New"/>
      </font>

Pointing to a physical font file

If a "fontpath" is specified with a "path "attribute, the font will be retrieved from a font file. For example:

      <font name="F1" index="4" size="10" >
         <fontPath path="myFont.ttf"/>
      </font>

By default, a TrueType or OpenType font file is assumed, but you can also use a Type1 font file by specifying the "fontFormat" attribute. For example:

      <font name="F1" index="4" size="10" >
         <fontPath fontFormat="TYPE1" path="myFont.pfm"/>
      </font>

Font characteristics

Font size

A Font height is specified by its ascent and descent. The Font size as defined in typography is defined by the distance between the descender line and the ascender line in points (1/72th of inch):


The font size can be defined in: In the default case (point size), the size is defined as in typography as the height between the descender line and the ascender line. I the pixels and arinc cases, the size is define as the height between the basline and the baseline.

Point Unit

The size of a Font is usually set in Points, one Point being equal to 1/72 of an Inch. However this specification of a Point assumes a monitor with 72 DPI, which is not always the case. The result is that the actual size of the Font may not be as expected, for fonts whose size has been specified as Points (the default one).
See www.rfwilmut.clara.net/about/fonts.html for a detailed explanation about the possible differences depending on the Operating System.

Font position

The "fontPosition" attribute allows to specify how the font characters are aligned vertically. Note that by default the font characters are aligned on the descender line, which means that upper case characters won't be aligned on their bottom position. If you mostly deal with upper case characters, and you want to control precisely the height of the characters and their position, you should use the following options:

Example

   <fonts>
      <font index="30" name="default" />
      <font name="t1" index="1" size="12" />
      <font name="t2" index="2" size="14" />
      <font name="t3" index="3" size="10" >
         <fontPath physicalName="Courier New"/>
      </font>
      <font name="F1" index="4" size="10" >
         <fontPath path="myFont.ttf"/>
      </font>
   </fonts>

See Also


Category: server Category: client Category: conf Category: user

Copyright 2016 Dassault Aviation. All Rights Reserved. Documentation and source under the GPL v2 licence

Project Web Hosted by SourceForge.net Copyright 1999-2010 - Geeknet, Inc., All Rights Reserved About - Legal - Help