Show / Hide Table of Contents

Class FntFile

Opens FONT000*.FNT files and reads glyph data.

Inheritance
Object
FntFile
Namespace: DaggerfallConnect.Arena2
Assembly: Assembly-CSharp.dll
Syntax
public class FntFile

Constructors

| Improve this Doc View Source

FntFile()

Default constructor.

Declaration
public FntFile()
| Improve this Doc View Source

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 Source

GlyphDataLength

Declaration
public const int GlyphDataLength = 32
Field Value
Type Description
Int32
| Improve this Doc View Source

GlyphFixedDimension

Declaration
public const int GlyphFixedDimension = 16
Field Value
Type Description
Int32
| Improve this Doc View Source

MaxGlyphCount

Declaration
public const int MaxGlyphCount = 240
Field Value
Type Description
Int32

Properties

| Improve this Doc View Source

FileData

Gets FNT file data.

Declaration
public FntFile.FntFileData FileData { get; }
Property Value
Type Description
FntFile.FntFileData
| Improve this Doc View Source

FixedHeight

Gets fixed glyph height.

Declaration
public int FixedHeight { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

FixedWidth

Gets fixed glyph width.

Declaration
public int FixedWidth { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

IsLoaded

True if a file is loaded.

Declaration
public bool IsLoaded { get; }
Property Value
Type Description
Boolean

Methods

| Improve this Doc View Source

GetGlyphBytes(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX