Table of Contents

Class ConfigFormatFactory

Namespace
KernSmith
Assembly
KernSmith.dll

Dispatches config read/write operations to the correct format implementation. ReadConfig(string) auto-detects the format by inspecting the file CONTENT, falling back to the extension only when the content is inconclusive. WriteConfig(BmfcConfig, string) selects by extension (.hiero selects Hiero; any other extension, including none, selects BMFont).

public static class ConfigFormatFactory
Inheritance
ConfigFormatFactory
Inherited Members

Methods

ReadConfig(string)

Reads a config file, auto-detecting the format from its CONTENT. A definitive or majority Hiero signal selects the Hiero format; a majority BMFont signal selects BMFont. When the content is inconclusive, the extension is used as a tiebreaker: .hiero selects Hiero and any other extension (including none) selects BMFont. This means a mistyped or mismatched extension is still parsed according to the actual file contents.

public static BmfcConfig ReadConfig(string filePath)

Parameters

filePath string

Path to a config file.

Returns

BmfcConfig

A BmfcConfig containing parsed options and font source info.

Exceptions

FileNotFoundException

Thrown when filePath does not exist.

WriteConfig(BmfcConfig, string)

Writes a config file, auto-detecting the format from its extension. The .hiero extension selects the Hiero format; any other extension (including none) is written as BMFont.

public static void WriteConfig(BmfcConfig config, string filePath)

Parameters

config BmfcConfig

The configuration to serialize.

filePath string

Path to the destination file.