XML:TSFF: Difference between revisions
Paradox-01 (talk | contribs) (OniBrowser for the win) |
m (copy-edit/revision) |
||
Line 1: | Line 1: | ||
{{XML_File_Header | type=TSFF | prev=TRTA | next=TSFL | name=Font Family}} | |||
==General information== | |||
*TSFF is a singleton global resource found in level0_Final.dat. | |||
*It describes a font family that Oni can use. The only font family available is Tahoma. | |||
*You can visualize the data in [http://mods.oni2.net/node/256 OniBrowser]. Be sure to also install the XNA package from Microsoft's website. | |||
== | ==Hierarchy== | ||
TSFF instance | |||
TSFF | | | ||
+-- TSFL instance | |||
| | | | ||
+-- | +-- TSFT instances | ||
| | | | ||
+-- TSGA instances | |||
==TSFF tag== | |||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
!width=150px| XML tag | !width=150px| XML tag | ||
!width=120px| | !width=120px| Content type | ||
! | ! Description | ||
|- | |- | ||
|valign=top| <TSFF> | |valign=top| <TSFF> | ||
|valign=top| - | |valign=top| - | ||
| | | Parent tag | ||
|- | |- | ||
| <Language> | | <Language> | ||
| link | | link | ||
| | | Link to TSFL file (there is only one in Oni, TSFLRoman) | ||
|- | |- | ||
| <Fonts> | | <Fonts> | ||
| - | | - | ||
| | | List of instance links for TSFT files representing each style and size (there are 15 available) | ||
|- | |- | ||
| <Link> | | <Link> | ||
Line 54: | Line 38: | ||
|} | |} | ||
==TSFL tag== | |||
The TSFL file (the only one in Oni, TSFLRoman) is extracted to a separate file from the rest of the tags on this page, but we consider it here. | |||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
!width=150px| XML tag | !width=150px| XML tag | ||
!width=120px| | !width=120px| Content type | ||
! | ! Description | ||
|- | |||
|valign=top| <TSFL id="0"> | |||
|valign=top| | |||
| Parent tag | |||
|- | |||
| <Offset_0008> | |||
| string | |||
| Unused | |||
|- | |||
| <Breaking> | |||
| string | |||
| What characters a line can break on. There is only a space character here. | |||
|- | |||
| <Offset_0088> | |||
| string | |||
| Unused | |||
|- | |||
| <Offset_00C8> | |||
| string | |||
| Unused | |||
|- | |||
| <Offset_0108> | |||
| string | |||
| Unused | |||
|} | |||
==TSFT tags== | |||
The TSFT is where the actual pixel data for the glyphs is stored, however the TSGAs underneath this tag define the bounds of each glyph's pixels within the data blob. | |||
{| class="wikitable" width="100%" | |||
!width=150px| XML tag | |||
!width=120px| Content type | |||
! Description | |||
|- | |- | ||
|valign=top| <TSFT> | |valign=top| <TSFT> | ||
|valign=top| | |valign=top| | ||
| | | Parent tag | ||
|- | |- | ||
| <FontSize> | | <FontSize> | ||
Line 94: | Line 112: | ||
| <Glyphs> | | <Glyphs> | ||
| | | | ||
| | | List of links to TSGAs | ||
|- | |- | ||
| <Link> | | <Link> | ||
Line 102: | Line 120: | ||
| <GlyphBitmaps> | | <GlyphBitmaps> | ||
| | | | ||
| | | Elements of pixel data | ||
|- | |- | ||
|valign=top| <Int32> | |valign=top| <Int32> | ||
|valign=top| int32 | |valign=top| int32 | ||
| | | Once each element is split into 4 individual bytes, each byte can be read as a hex color code for a pixel. | ||
|} | |} | ||
Here's the list of available Tahoma sizes and styles in the TSFTs: | |||
: ID 2, FontSize 7, FontStyle 1 | |||
: ID 3, FontSize 7, FontStyle 0 | |||
: ID 4, FontSize 7, FontStyle 2 | |||
: ID 5, FontSize 14, FontStyle 1 | |||
: ID 6, FontSize 14, FontStyle 0 | |||
: ID 7, FontSize 14, FontStyle 2 | |||
: ID 8, FontSize 10, FontStyle 1 | |||
: ID 9, FontSize 10, FontStyle 0 | |||
: ID 10, FontSize 10, FontStyle 2 | |||
: ID 11, FontSize 12, FontStyle 1 | |||
: ID 12, FontSize 12, FontStyle 0 | |||
: ID 13, FontSize 12, FontStyle 2 | |||
: ID 14, FontSize 9, FontStyle 1 | |||
: ID 15, FontSize 9, FontStyle 0 | |||
: ID 16, FontSize 9, FontStyle 2 | |||
==TSGA tags== | |||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
!width=150px| XML tag | !width=150px| XML tag | ||
!width=120px| | !width=120px| Content type | ||
! | ! Description | ||
|- | |- | ||
|valign=top| <TSGA> | |valign=top| <TSGA> | ||
Line 122: | Line 156: | ||
| <Glyphs> | | <Glyphs> | ||
| | | | ||
| | | Glyph array for character codes 0-255 (ASCII) | ||
|- | |- | ||
| <TSGAGlyph> | | <TSGAGlyph> | ||
Line 134: | Line 168: | ||
| <Width> | | <Width> | ||
| int16 | | int16 | ||
| What is the difference of Width and GlyphWidth | | What is the difference of Width and GlyphWidth? Picture please. | ||
|- | |- | ||
| <GlyphWidth> | | <GlyphWidth> | ||
Line 153: | Line 187: | ||
|- | |- | ||
| <GlyphBitmapOffset> | | <GlyphBitmapOffset> | ||
| int32 | | int32 | ||
| | | | ||
|} | |} | ||
Every TSGA file contains 256 elements. One element stands for one of the 256 signs of the ASCII table. The first 32 signs are reserved control characters, so these elements are always | Every TSGA file contains 256 elements. One element stands for one of the 256 signs of the ASCII table. The first 32 signs are reserved control characters, so these elements are always all-zero. | ||
A glyph is basically a monochrome bitmap width * height pixels in size. Each pixel is stored in one byte in the TSFT file ( | A glyph is basically a monochrome bitmap that's (width * height) pixels in size. Each pixel is stored in one byte in the TSFT file. (Fonts are antialiased, so shades of gray are needed rather than storing each pixel in one bit.) Each element in the TSFT file, being 32-bits, contains 4 pixels. The rows are not 32-bit aligned, so a new row of pixels can start inside an element. | ||
{{XML}} | {{XML}} |
Revision as of 01:34, 27 March 2021
TSFF : Font Family | ||
---|---|---|
XML
TRTA << Other file types >> TSFL |
General information
- TSFF is a singleton global resource found in level0_Final.dat.
- It describes a font family that Oni can use. The only font family available is Tahoma.
- You can visualize the data in OniBrowser. Be sure to also install the XNA package from Microsoft's website.
Hierarchy
TSFF instance | +-- TSFL instance | +-- TSFT instances | +-- TSGA instances
TSFF tag
XML tag | Content type | Description |
---|---|---|
<TSFF> | - | Parent tag |
<Language> | link | Link to TSFL file (there is only one in Oni, TSFLRoman) |
<Fonts> | - | List of instance links for TSFT files representing each style and size (there are 15 available) |
<Link> | # + instance number |
TSFL tag
The TSFL file (the only one in Oni, TSFLRoman) is extracted to a separate file from the rest of the tags on this page, but we consider it here.
XML tag | Content type | Description |
---|---|---|
<TSFL id="0"> | Parent tag | |
<Offset_0008> | string | Unused |
<Breaking> | string | What characters a line can break on. There is only a space character here. |
<Offset_0088> | string | Unused |
<Offset_00C8> | string | Unused |
<Offset_0108> | string | Unused |
TSFT tags
The TSFT is where the actual pixel data for the glyphs is stored, however the TSGAs underneath this tag define the bounds of each glyph's pixels within the data blob.
XML tag | Content type | Description |
---|---|---|
<TSFT> | Parent tag | |
<FontSize> | int16 | |
<FontStyle> | int16 |
|
<AscenderHeight> | int16 | |
<DescenderHeight> | int16 | |
<LeadingHeight> | int16 | |
<Offset_001A> | int16 | |
<Glyphs> | List of links to TSGAs | |
<Link> | ||
<GlyphBitmaps> | Elements of pixel data | |
<Int32> | int32 | Once each element is split into 4 individual bytes, each byte can be read as a hex color code for a pixel. |
Here's the list of available Tahoma sizes and styles in the TSFTs:
- ID 2, FontSize 7, FontStyle 1
- ID 3, FontSize 7, FontStyle 0
- ID 4, FontSize 7, FontStyle 2
- ID 5, FontSize 14, FontStyle 1
- ID 6, FontSize 14, FontStyle 0
- ID 7, FontSize 14, FontStyle 2
- ID 8, FontSize 10, FontStyle 1
- ID 9, FontSize 10, FontStyle 0
- ID 10, FontSize 10, FontStyle 2
- ID 11, FontSize 12, FontStyle 1
- ID 12, FontSize 12, FontStyle 0
- ID 13, FontSize 12, FontStyle 2
- ID 14, FontSize 9, FontStyle 1
- ID 15, FontSize 9, FontStyle 0
- ID 16, FontSize 9, FontStyle 2
TSGA tags
XML tag | Content type | Description |
---|---|---|
<TSGA> | ||
<Glyphs> | Glyph array for character codes 0-255 (ASCII) | |
<TSGAGlyph> | ||
<Index> | int16 | |
<Width> | int16 | What is the difference of Width and GlyphWidth? Picture please. |
<GlyphWidth> | int16 | |
<GlyphHeight> | int16 | |
<GlyphXOrigin> | int16 | |
<GlyphYOrigin> | int16 | |
<GlyphBitmapOffset> | int32 |
Every TSGA file contains 256 elements. One element stands for one of the 256 signs of the ASCII table. The first 32 signs are reserved control characters, so these elements are always all-zero.
A glyph is basically a monochrome bitmap that's (width * height) pixels in size. Each pixel is stored in one byte in the TSFT file. (Fonts are antialiased, so shades of gray are needed rather than storing each pixel in one bit.) Each element in the TSFT file, being 32-bits, contains 4 pixels. The rows are not 32-bit aligned, so a new row of pixels can start inside an element.