Gah - a solution with more questions. – EntropicLqd

UE3:Font (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UDK Object >> Font
Package: 
Engine
Direct subclass:
MultiFont
This class in other games:
UT, RTNP, U1, U2XMP, U2, UE2Runtime, UT2004, UT3

A font object, containing information about a set of glyphs. The glyph bitmaps are stored in the contained textures, while the font database only contains the coordinates of the individual glyph.

Constants

NULLCHARACTER

Value: 127


Properties

Property group 'Font'

Characters

Type: array<FontCharacter>

Modifiers: editinline

List of characters in the font. For a MultiFont, this will include all characters in all sub-fonts! Thus, the number of characters in this array isn't necessary the number of characters available in the font

ImportOptions

Type: FontImportOptions.FontImportOptionsData

Options used when importing this font

Default value:

Member Value
bEnableAntialiasing True
bIncludeASCIIRange True
DistanceFieldScaleFactor 16
FontName "Arial"
ForegroundColor
Member Value
A 1.0
B 1.0
G 1.0
R 1.0
Height 16.0
TexturePageMaxHeight 256
TexturePageWidth 256
XPadding 1
YPadding 1

Kerning

Type: int

Default horizontal spacing between characters when rendering text with this font

Internal variables

CharRemap

Type: Map{WORD,WORD}

Modifiers: private, const, native

When IsRemapped is true, this array maps unicode values to entries in the Characters array

IsRemapped

Type: int

True if font is 'remapped'. That is, the character array is not a direct mapping to unicode values. Instead, all characters are indexed indirectly through the CharRemap array

MaxCharHeight

Type: array<int>

Modifiers: transient

The maximum height of a character in this font. For multi-fonts, this array will contain a maximum character height for each multi-font, otherwise the array will contain only a single element. This is cached at load-time or creation time, and is never serialized.

NumCharacters

Type: int

Modifiers: transient

Number of characters in the font, not including multiple instances of the same character (for multi-fonts). This is cached at load-time or creation time, and is never serialized.

Textures

Type: array<Texture2D>

Textures that store this font's glyph image data

Structs

FontCharacter

Modifiers: immutable, native

this struct is serialized using binary serialization so any changes to it require a package version bump

int StartU 
int StartV 
int USize 
int VSize 
byte TextureIndex 
int VerticalOffset 

Native functions

GetAuthoredViewportHeight

native final function virtual float GetAuthoredViewportHeight (float ViewportHeight) const

Determine the height of the mutli-font resolution page which will be used for the specified resolution.

Parameters:

  • ViewportHeight - the height (in pixels) of the viewport being rendered to.

GetMaxCharHeight

native function float GetMaxCharHeight () const

Returns the maximum height for any character in this font

GetResolutionPageIndex

native function int GetResolutionPageIndex (float HeightTest) const

Calulate the index for the texture page containing the multi-font character set to use, based on the specified screen resolution.

Parameters:

  • HeightTest - the height (in pixels) of the viewport being rendered to.

Returns:

the index of the multi-font "subfont" that most closely matches the specified resolution. this value is used as the value for "ResolutionPageIndex" when calling other font-related methods.

GetScalingFactor

native function float GetScalingFactor (float HeightTest) const

Calculate the amount of scaling necessary to match the multi-font subfont which most closely matches the specified resolution.

Parameters:

  • HeightTest - the height (in pixels) of the viewport being rendered to.

Returns:

the percentage scale required to match the size of the multi-font's closest matching subfont.