Class FntFile
Opens FONT000*.FNT files and reads glyph data.
Namespace: DaggerfallConnect.Arena2
Assembly: Assembly-CSharp.dll
Syntax
public class FntFile
Constructors
| Improve this Doc View SourceFntFile()
Default constructor.
Declaration
public FntFile()
FntFile(String, FileUsage, Boolean)
Load constructor.
Declaration
public FntFile(string filePath, FileUsage usage, bool readOnly)
Parameters
Type | Name | Description |
---|---|---|
String | filePath | Absolute path to FONT000*.FNT file. |
FileUsage | usage | Determines if the FNT file will read from disk or memory. |
Boolean | readOnly | File will be read-only if true, read-write if false. |
Fields
| Improve this Doc View SourceGlyphDataLength
Declaration
public const int GlyphDataLength = 32
Field Value
Type | Description |
---|---|
Int32 |
GlyphFixedDimension
Declaration
public const int GlyphFixedDimension = 16
Field Value
Type | Description |
---|---|
Int32 |
MaxGlyphCount
Declaration
public const int MaxGlyphCount = 240
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceFileData
Gets FNT file data.
Declaration
public FntFile.FntFileData FileData { get; }
Property Value
Type | Description |
---|---|
FntFile.FntFileData |
FixedHeight
Gets fixed glyph height.
Declaration
public int FixedHeight { get; }
Property Value
Type | Description |
---|---|
Int32 |
FixedWidth
Gets fixed glyph width.
Declaration
public int FixedWidth { get; }
Property Value
Type | Description |
---|---|
Int32 |
IsLoaded
True if a file is loaded.
Declaration
public bool IsLoaded { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceGetGlyphBytes(Int32)
Gets raw glyph data bytes.
Declaration
public byte[] GetGlyphBytes(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of glyph. |
Returns
Type | Description |
---|---|
Byte[] | Buffer of GlyphDataLength or null on error. |
GetGlyphPixels(Int32, Int32)
Gets fixed glyph pixel 2D array where 0 is "off" and colorIndex (or just non-zero) is "on". Always GlyphFixedDimension*GlyphFixedDimension bytes (i.e. 16x16 bytes). Glyph data aligned to top-left.
Declaration
public byte[] GetGlyphPixels(int index, int colorIndex = 127)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of glyph. |
Int32 | colorIndex | Palette colour index for "on" pixels. |
Returns
Type | Description |
---|---|
Byte[] | Glyph pixel array or null on error. |
GetGlyphWidth(Int32)
Gets actual pixel width of glyph.
Declaration
public int GetGlyphWidth(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of glyph. |
Returns
Type | Description |
---|---|
Int32 | Pixel width of glyph or -1 on error. |
Load(String, FileUsage, Boolean)
Loads a FONT000*.FNT file.
Declaration
public bool Load(string filePath, FileUsage usage, bool readOnly)
Parameters
Type | Name | Description |
---|---|---|
String | filePath | Absolute path to FONT000*.FNT file. |
FileUsage | usage | Determines if the FNT file will read from disk or memory. |
Boolean | readOnly | File will be read-only if true, read-write if false. |
Returns
Type | Description |
---|---|
Boolean | True if successful, otherwise false. |