Detailed Description

The main class for handling global font settings.

Static Public Member Functions

static void OnLogMessage (string message)
 Logs a message. More...
 
static FontFace Load (byte[] data)
 Wrapper function for loading a font from the given data. Note that loaded fonts are cached once loaded. More...
 
static void Clear ()
 Clears all fonts. More...
 
static FontFamily GetOrCreate (string name)
 Gets or creates a font family by name. More...
 
static FontFamily Get (string name)
 Tries to get a font family by name. More...
 

Static Public Attributes

static bool AlwaysUseTypo =true
 Should InfiniText always use the OS/2 'typo' metrics when an OS/2 table is present? This is the W3C specification but it seems browsers vary in unclear ways. More...
 
static int GlyphID =1
 A globally unique glyph ID. Used when placing glyphs on atlases. More...
 
static bool UseGPU =true
 Should fonts be rendered using the GPU? Strongly advised they are! More...
 
static readonly float[] AutoAliasHints
 A tuned set of points which hint the auto-alias system. More...
 
static float Aliasing =0.3f
 The current text aliasing value. More...
 
static Scanner Rasteriser
 The main rasteriser used for drawing fonts. Sets itself up as an SDF rasteriser by default. More...
 
static bool Preload =true
 Should font glyphs be loaded when the font is? If yes, font loading takes slightly longer (especially if you use large fonts) but you'll instead have the entire font loaded which can be useful. More...
 
static bool DeferLoad =false
 Should font faces be entirely deferred? If yes, font faces are loaded up only when they are first used (at which point preloading may also occur). More...
 
static bool InvertedNormals =false
 See InvertNormals. More...
 
static float SdfPixelHeight =40f
 Change PixelHeight instead. The SDF draw height. More...
 
static float SdfOffset =0.05f
 The SDF offset. SDFSize / SdfPixelHeight. More...
 
static int SdfSize =2
 Change SDFSpread instead. The raw size of the default SDF spread. The bigger this is, the more anti-aliasing and bigger glows you can use. More...
 
static int DoubleSdfSize =SdfSize*2
 Change SDFSpread instead. Simply 2 times SdfSize. More...
 
static float OutlineLocation =0.35f
 The SDF outline location. 0-1. More...
 
static Dictionary< string,
FontFamily
All
 All available font families. More...
 
static OnLogEvent OnLog
 The delegate used when InfiniText logs a message. More...
 

Static Package Functions

static void Start ()
 Sets up InfiniText. Called automatically when the first font is loaded. More...
 

Properties

static int SDFSpread [get, set]
 The size of the default SDF spread around glyphs. More...
 
static float PixelHeight [get, set]
 The SDF draw height. Default is 40. More...
 

Member Function Documentation

static void InfiniText.Fonts.Clear ( )
inlinestatic

Clears all fonts.

static FontFamily InfiniText.Fonts.Get ( string  name)
inlinestatic

Tries to get a font family by name.

Returns
Null if the family isn't loaded.
static FontFamily InfiniText.Fonts.GetOrCreate ( string  name)
inlinestatic

Gets or creates a font family by name.

static FontFace InfiniText.Fonts.Load ( byte[]  data)
inlinestatic

Wrapper function for loading a font from the given data. Note that loaded fonts are cached once loaded.

static void InfiniText.Fonts.OnLogMessage ( string  message)
inlinestatic

Logs a message.

static void InfiniText.Fonts.Start ( )
inlinestaticpackage

Sets up InfiniText. Called automatically when the first font is loaded.

Member Data Documentation

float InfiniText.Fonts.Aliasing =0.3f
static

The current text aliasing value.

Dictionary<string,FontFamily> InfiniText.Fonts.All
static

All available font families.

bool InfiniText.Fonts.AlwaysUseTypo =true
static

Should InfiniText always use the OS/2 'typo' metrics when an OS/2 table is present? This is the W3C specification but it seems browsers vary in unclear ways.

readonly float [] InfiniText.Fonts.AutoAliasHints
static
Initial value:
=new float[]{
6f, 0f, 0.1f,
12f, 0f, 0.7f,
50f, 0.12f, 0.5f,
100f, 0.24f, 0.34f,
200f, 0.28f, 0.32f
}

A tuned set of points which hint the auto-alias system.

bool InfiniText.Fonts.DeferLoad =false
static

Should font faces be entirely deferred? If yes, font faces are loaded up only when they are first used (at which point preloading may also occur).

int InfiniText.Fonts.DoubleSdfSize =SdfSize*2
static

Change SDFSpread instead. Simply 2 times SdfSize.

int InfiniText.Fonts.GlyphID =1
static

A globally unique glyph ID. Used when placing glyphs on atlases.

bool InfiniText.Fonts.InvertedNormals =false
static

See InvertNormals.

OnLogEvent InfiniText.Fonts.OnLog
static

The delegate used when InfiniText logs a message.

float InfiniText.Fonts.OutlineLocation =0.35f
static

The SDF outline location. 0-1.

bool InfiniText.Fonts.Preload =true
static

Should font glyphs be loaded when the font is? If yes, font loading takes slightly longer (especially if you use large fonts) but you'll instead have the entire font loaded which can be useful.

Scanner InfiniText.Fonts.Rasteriser
static

The main rasteriser used for drawing fonts. Sets itself up as an SDF rasteriser by default.

float InfiniText.Fonts.SdfOffset =0.05f
static

The SDF offset. SDFSize / SdfPixelHeight.

float InfiniText.Fonts.SdfPixelHeight =40f
static

Change PixelHeight instead. The SDF draw height.

int InfiniText.Fonts.SdfSize =2
static

Change SDFSpread instead. The raw size of the default SDF spread. The bigger this is, the more anti-aliasing and bigger glows you can use.

bool InfiniText.Fonts.UseGPU =true
static

Should fonts be rendered using the GPU? Strongly advised they are!

Property Documentation

float InfiniText.Fonts.PixelHeight
staticgetset

The SDF draw height. Default is 40.

int InfiniText.Fonts.SDFSpread
staticgetset

The size of the default SDF spread around glyphs.