NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
FreeType Class Reference

FreeType library is a C++ library used to print text from TrueType fonts. Since the code is in a native C++ DLL, you will need Unity Pro in order to use it. FreeType project is open source and can be obtained from http://www.freetype.org/ More...

Classes

struct  FT_BBox
 
struct  FT_Bitmap
 
struct  FT_FaceRec
 
struct  FT_Generic
 
struct  FT_Glyph_Metrics
 
struct  FT_GlyphSlotRec
 
struct  FT_ListRec
 
struct  FT_Outline
 
struct  FT_Size_Metrics
 
struct  FT_SizeRec
 
struct  FT_Vector
 

Public Types

enum  FT_Glyph_Format {
  FT_Glyph_Format.FT_GLYPH_FORMAT_NONE, FT_Glyph_Format.FT_GLYPH_FORMAT_COMPOSITE = 1668246896, FT_Glyph_Format.FT_GLYPH_FORMAT_BITMAP = 1651078259, FT_Glyph_Format.FT_GLYPH_FORMAT_OUTLINE = 1869968492,
  FT_Glyph_Format.FT_GLYPH_FORMAT_PLOTTER = 1886154612
}
 
enum  FT_Render_Mode {
  FT_Render_Mode.FT_RENDER_MODE_NORMAL, FT_Render_Mode.FT_RENDER_MODE_LIGHT, FT_Render_Mode.FT_RENDER_MODE_MONO, FT_Render_Mode.FT_RENDER_MODE_LCD,
  FT_Render_Mode.FT_RENDER_MODE_LCD_V, FT_Render_Mode.FT_RENDER_MODE_MAX
}
 

Static Public Member Functions

static string[] GetFaces (Font font)
 Retrieve the list of faces from the specified font. For example: regular, bold, italic. More...
 
static bool CreateFont (Font ttf, int size, int faceIndex, bool kerning, string characters, out BMFont font, out Texture2D tex)
 Create a bitmap font from the specified dynamic font. More...
 

Public Attributes

const int Err_Cannot_Open_Resource = 1
 
const int Err_Unknown_File_Format = 2
 
const int Err_Invalid_File_Format = 3
 
const int Err_Invalid_Version = 4
 
const int Err_Lower_Module_Version = 5
 
const int Err_Invalid_Argument = 6
 
const int Err_Unimplemented_Feature = 7
 
const int Err_Invalid_Table = 8
 
const int Err_Invalid_Offset = 9
 
const int Err_Invalid_Glyph_Index = 16
 
const int Err_Invalid_Character_Code = 17
 
const int Err_Invalid_Glyph_Format = 18
 
const int Err_Cannot_Render_Glyph = 19
 
const int Err_Invalid_Outline = 20
 
const int Err_Invalid_Composite = 21
 
const int Err_Too_Many_Hints = 22
 
const int Err_Invalid_Pixel_Size = 23
 
const int Err_Invalid_Handle = 32
 
const int Err_Invalid_Library_Handle = 33
 
const int Err_Invalid_Driver_Handle = 34
 
const int Err_Invalid_Face_Handle = 35
 
const int Err_Invalid_Size_Handle = 36
 
const int Err_Invalid_Slot_Handle = 37
 
const int Err_Invalid_CharMap_Handle = 38
 
const int Err_Invalid_Cache_Handle = 39
 
const int Err_Invalid_Stream_Handle = 40
 
const int Err_Too_Many_Drivers = 48
 
const int Err_Too_Many_Extensions = 49
 
const int Err_Out_Of_Memory = 64
 
const int Err_Unlisted_Object = 65
 
const int Err_Cannot_Open_Stream = 81
 
const int Err_Invalid_Stream_Seek = 82
 
const int Err_Invalid_Stream_Skip = 83
 
const int Err_Invalid_Stream_Read = 84
 
const int Err_Invalid_Stream_Operation = 85
 
const int Err_Invalid_Frame_Operation = 86
 
const int Err_Nested_Frame_Access = 87
 
const int Err_Invalid_Frame_Read = 88
 
const int Err_Raster_Uninitialized = 96
 
const int Err_Raster_Corrupted = 97
 
const int Err_Raster_Overflow = 98
 
const int Err_Raster_Negative_Height = 99
 
const int Err_Too_Many_Caches = 112
 
const int Err_Invalid_Opcode = 128
 
const int Err_Too_Few_Arguments = 129
 
const int Err_Stack_Overflow = 130
 
const int Err_Code_Overflow = 131
 
const int Err_Bad_Argument = 132
 
const int Err_Divide_By_Zero = 133
 
const int Err_Invalid_Reference = 134
 
const int Err_Debug_OpCode = 135
 
const int Err_ENDF_In_Exec_Stream = 136
 
const int Err_Nested_DEFS = 137
 
const int Err_Invalid_CodeRange = 138
 
const int Err_Execution_Too_Long = 139
 
const int Err_Too_Many_Function_Defs = 140
 
const int Err_Too_Many_Instruction_Defs = 141
 
const int Err_Table_Missing = 142
 
const int Err_Horiz_Header_Missing = 143
 
const int Err_Locations_Missing = 144
 
const int Err_Name_Table_Missing = 145
 
const int Err_CMap_Table_Missing = 146
 
const int Err_Hmtx_Table_Missing = 147
 
const int Err_Post_Table_Missing = 148
 
const int Err_Invalid_Horiz_Metrics = 149
 
const int Err_Invalid_CharMap_Format = 150
 
const int Err_Invalid_PPem = 151
 
const int Err_Invalid_Vert_Metrics = 152
 
const int Err_Could_Not_Find_Context = 153
 
const int Err_Invalid_Post_Table_Format = 154
 
const int Err_Invalid_Post_Table = 155
 
const int Err_Syntax_Error = 160
 
const int Err_Stack_Underflow = 161
 
const int Err_Ignore = 162
 
const int Err_Missing_Startfont_Field = 176
 
const int Err_Missing_Font_Field = 177
 
const int Err_Missing_Size_Field = 178
 
const int Err_Missing_Chars_Field = 179
 
const int Err_Missing_Startchar_Field = 180
 
const int Err_Missing_Encoding_Field = 181
 
const int Err_Missing_Bbx_Field = 182
 
const int FT_LOAD_CROP_BITMAP = 64
 
const int FT_LOAD_DEFAULT = 0
 
const int FT_LOAD_FORCE_AUTOHINT = 32
 
const int FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH = 512
 
const int FT_LOAD_IGNORE_TRANSFORM = 2048
 
const int FT_LOAD_LINEAR_DESIGN = 8192
 
const int FT_LOAD_MONOCHROME = 4096
 
const int FT_LOAD_NO_BITMAP = 8
 
const int FT_LOAD_NO_HINTING = 2
 
const int FT_LOAD_NO_RECURSE = 1024
 
const int FT_LOAD_NO_SCALE = 1
 
const int FT_LOAD_PEDANTIC = 128
 
const int FT_LOAD_RENDER = 4
 
const int FT_LOAD_SBITS_ONLY = 16384
 
const int FT_LOAD_VERTICAL_LAYOUT = 16
 

Properties

static bool isPresent [get]
 Whether the freetype library will be usable. More...
 

Detailed Description

FreeType library is a C++ library used to print text from TrueType fonts. Since the code is in a native C++ DLL, you will need Unity Pro in order to use it. FreeType project is open source and can be obtained from http://www.freetype.org/

A big thank you goes to Amplitude Studios for coming up with the idea on how to do this in the first place. As a side note, their game "Endless Space" is pretty awesome! http://www.amplitude-studios.com/

If you are curious where all these values come from, check the FreeType docs: http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html

Member Enumeration Documentation

Enumerator
FT_GLYPH_FORMAT_NONE 
FT_GLYPH_FORMAT_COMPOSITE 
FT_GLYPH_FORMAT_BITMAP 
FT_GLYPH_FORMAT_OUTLINE 
FT_GLYPH_FORMAT_PLOTTER 
Enumerator
FT_RENDER_MODE_NORMAL 
FT_RENDER_MODE_LIGHT 
FT_RENDER_MODE_MONO 
FT_RENDER_MODE_LCD 
FT_RENDER_MODE_LCD_V 
FT_RENDER_MODE_MAX 

Member Function Documentation

static bool FreeType.CreateFont ( Font  ttf,
int  size,
int  faceIndex,
bool  kerning,
string  characters,
out BMFont  font,
out Texture2D  tex 
)
static

Create a bitmap font from the specified dynamic font.

static string [] FreeType.GetFaces ( Font  font)
static

Retrieve the list of faces from the specified font. For example: regular, bold, italic.

Member Data Documentation

const int FreeType.Err_Bad_Argument = 132
const int FreeType.Err_Cannot_Open_Resource = 1
const int FreeType.Err_Cannot_Open_Stream = 81
const int FreeType.Err_Cannot_Render_Glyph = 19
const int FreeType.Err_CMap_Table_Missing = 146
const int FreeType.Err_Code_Overflow = 131
const int FreeType.Err_Could_Not_Find_Context = 153
const int FreeType.Err_Debug_OpCode = 135
const int FreeType.Err_Divide_By_Zero = 133
const int FreeType.Err_ENDF_In_Exec_Stream = 136
const int FreeType.Err_Execution_Too_Long = 139
const int FreeType.Err_Hmtx_Table_Missing = 147
const int FreeType.Err_Horiz_Header_Missing = 143
const int FreeType.Err_Ignore = 162
const int FreeType.Err_Invalid_Argument = 6
const int FreeType.Err_Invalid_Cache_Handle = 39
const int FreeType.Err_Invalid_Character_Code = 17
const int FreeType.Err_Invalid_CharMap_Format = 150
const int FreeType.Err_Invalid_CharMap_Handle = 38
const int FreeType.Err_Invalid_CodeRange = 138
const int FreeType.Err_Invalid_Composite = 21
const int FreeType.Err_Invalid_Driver_Handle = 34
const int FreeType.Err_Invalid_Face_Handle = 35
const int FreeType.Err_Invalid_File_Format = 3
const int FreeType.Err_Invalid_Frame_Operation = 86
const int FreeType.Err_Invalid_Frame_Read = 88
const int FreeType.Err_Invalid_Glyph_Format = 18
const int FreeType.Err_Invalid_Glyph_Index = 16
const int FreeType.Err_Invalid_Handle = 32
const int FreeType.Err_Invalid_Horiz_Metrics = 149
const int FreeType.Err_Invalid_Library_Handle = 33
const int FreeType.Err_Invalid_Offset = 9
const int FreeType.Err_Invalid_Opcode = 128
const int FreeType.Err_Invalid_Outline = 20
const int FreeType.Err_Invalid_Pixel_Size = 23
const int FreeType.Err_Invalid_Post_Table = 155
const int FreeType.Err_Invalid_Post_Table_Format = 154
const int FreeType.Err_Invalid_PPem = 151
const int FreeType.Err_Invalid_Reference = 134
const int FreeType.Err_Invalid_Size_Handle = 36
const int FreeType.Err_Invalid_Slot_Handle = 37
const int FreeType.Err_Invalid_Stream_Handle = 40
const int FreeType.Err_Invalid_Stream_Operation = 85
const int FreeType.Err_Invalid_Stream_Read = 84
const int FreeType.Err_Invalid_Stream_Seek = 82
const int FreeType.Err_Invalid_Stream_Skip = 83
const int FreeType.Err_Invalid_Table = 8
const int FreeType.Err_Invalid_Version = 4
const int FreeType.Err_Invalid_Vert_Metrics = 152
const int FreeType.Err_Locations_Missing = 144
const int FreeType.Err_Lower_Module_Version = 5
const int FreeType.Err_Missing_Bbx_Field = 182
const int FreeType.Err_Missing_Chars_Field = 179
const int FreeType.Err_Missing_Encoding_Field = 181
const int FreeType.Err_Missing_Font_Field = 177
const int FreeType.Err_Missing_Size_Field = 178
const int FreeType.Err_Missing_Startchar_Field = 180
const int FreeType.Err_Missing_Startfont_Field = 176
const int FreeType.Err_Name_Table_Missing = 145
const int FreeType.Err_Nested_DEFS = 137
const int FreeType.Err_Nested_Frame_Access = 87
const int FreeType.Err_Out_Of_Memory = 64
const int FreeType.Err_Post_Table_Missing = 148
const int FreeType.Err_Raster_Corrupted = 97
const int FreeType.Err_Raster_Negative_Height = 99
const int FreeType.Err_Raster_Overflow = 98
const int FreeType.Err_Raster_Uninitialized = 96
const int FreeType.Err_Stack_Overflow = 130
const int FreeType.Err_Stack_Underflow = 161
const int FreeType.Err_Syntax_Error = 160
const int FreeType.Err_Table_Missing = 142
const int FreeType.Err_Too_Few_Arguments = 129
const int FreeType.Err_Too_Many_Caches = 112
const int FreeType.Err_Too_Many_Drivers = 48
const int FreeType.Err_Too_Many_Extensions = 49
const int FreeType.Err_Too_Many_Function_Defs = 140
const int FreeType.Err_Too_Many_Hints = 22
const int FreeType.Err_Too_Many_Instruction_Defs = 141
const int FreeType.Err_Unimplemented_Feature = 7
const int FreeType.Err_Unknown_File_Format = 2
const int FreeType.Err_Unlisted_Object = 65
const int FreeType.FT_LOAD_CROP_BITMAP = 64
const int FreeType.FT_LOAD_DEFAULT = 0
const int FreeType.FT_LOAD_FORCE_AUTOHINT = 32
const int FreeType.FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH = 512
const int FreeType.FT_LOAD_IGNORE_TRANSFORM = 2048
const int FreeType.FT_LOAD_LINEAR_DESIGN = 8192
const int FreeType.FT_LOAD_MONOCHROME = 4096
const int FreeType.FT_LOAD_NO_BITMAP = 8
const int FreeType.FT_LOAD_NO_HINTING = 2
const int FreeType.FT_LOAD_NO_RECURSE = 1024
const int FreeType.FT_LOAD_NO_SCALE = 1
const int FreeType.FT_LOAD_PEDANTIC = 128
const int FreeType.FT_LOAD_RENDER = 4
const int FreeType.FT_LOAD_SBITS_ONLY = 16384
const int FreeType.FT_LOAD_VERTICAL_LAYOUT = 16

Property Documentation

bool FreeType.isPresent
staticget

Whether the freetype library will be usable.


The documentation for this class was generated from the following file: