Seitenhierarchie

  Wiki Navigation

    Loading...


 Recently Updated


 Latest Releases

 MediaPortal 1.32
            Releasenews | Download
 MediaPortal 2.5
            Releasenews | Download


Overview

The fonts that are available to the skin are defined in the fonts.xml file.

Introduction

The MediaPortal 1 skin engine allows for a limited number of font definitions in fonts.xml (~19 fonts). This limitation is established to bound the number of textures created in the run-time environment - each font character is established as a texture at run-time. As the number of textures increases so do the machine requirements to contain the textures in memory. 

Changelog

Change

Date

Version

Font Aliases

2010/10/05

1.1.0 to 1.2.0

 

 

Fonts.xml

 The actual fonts are stored in the Windows fonts sub-folder (e.g. C:\Windows\Fonts).

 In Fonts.xml each font element defines:

  • The name that the font will be referenced as in the skin files
  • The filename of the actual font file
  • The height of the font
  • Whether the font is bold
  • Whether the font is italic
  • The numeric start character (default 0)
  • The numeric end character (default 255)

Note: MediaPortal 1 handles fonts as textures. So the more fonts (different sizes) you use in your skin, the higher the GPU-memory load will be.

Sample XML

<font>
<name>fontB12</name>
<filename>AvalonType Bold</filename>
<height>12</height>
<start>0</start>
<end>1536</end>
<bold>yes</bold>
</font>

Font Aliases

The implementation of aliases in fonts.xml provides flexibility for skinners to name fonts according to their use in the skin implementation; this allows for easy maintenance of the skin; e.g., name the font "menu" rather than "font10" (or similar). Using these flexible font names without aliases introduces the possibility of having to define the same font more than once (with different font names). Doing this not only wastes texture space but also rapidly exhausts the available (limited) pool of available font texture space. Using font aliases the skinner may have a (virtually) unlimited number of alias names against the ~19 font definitions. 

GUIFontManager maintains a list of alias names that map to font definition names. The alias names are specified inside of fonts.xml using <alias> nodes as follows. In this example myFont simply point at font1. Use of either name results in the rendering of font1.

<fonts>
  <font>
    <name>font1</name>
    ...
  </font>
  <alias>
    <name>myFont</name>
    <fontname>font1</fontname>
  </alias>
</fonts>

   

 

This page has no comments.