XML:TSFF: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(OniBrowser for the win)
m (copy-edit/revision)
Line 1: Line 1:
You can visualize the data in [http://mods.oni2.net/node/256 OniBrowser.] Be sure to also install the XNA package from the Microsoft site.
{{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.


===File structure===
==Hierarchy==
 
  TSFF instance
  TSFF file
  |
  +-- TSFL instance
   |
   |
   +-- TSFF instance
   +-- TSFT instances
       |
       |
       +-- TSFT instance (x15, for different styles and sizes)
       +-- TSGA instances
            |
            +-- TSGA instance
 
 
List of available Tahoma sizes and styles.
: 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
 


===TSFF tags===
==TSFF tag==
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|-
|valign=top| <TSFF>
|valign=top| <TSFF>
|valign=top| -
|valign=top| -
| parent tag
| Parent tag
|-
|-
| <Language>
| <Language>
| link
| link
| link to TSFL file
| Link to TSFL file (there is only one in Oni, TSFLRoman)
|-
|-
| <Fonts>
| <Fonts>
| -
| -
| parent tag, instance link list
| 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.


===TSFT tags===
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! 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>
|
|
| parent tag, array
| List of links to TSGAs
|-
|-
| <Link>
| <Link>
Line 102: Line 120:
| <GlyphBitmaps>
| <GlyphBitmaps>
|
|
| parent tag, array
| Elements of pixel data
|-
|-
|valign=top| <Int32>
|valign=top| <Int32>
|valign=top| int32
|valign=top| int32
| Has to be converted back to 4 bytes, each byte can be read as a hex color code for a pixel
| 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===
==TSGA tags==
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|-
|valign=top| <TSGA>
|valign=top| <TSGA>
Line 122: Line 156:
| <Glyphs>
| <Glyphs>
|
|
| glyph array for character codes 0-255 (ASCII)
| 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?? Picture please.
| 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 complete zero.
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 (fonts are antialiased so shades of gray are needed rather than storing each pixel in one bit) so each element in the TSFT file contains 4 pixels. Rows of pixels are not 4 bytes aligned so a row can start inside an element.
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 modding tips
  • See HERE to start learning about XML modding.
  • See HERE if you are searching for information on how to handle object coordinates.
  • See HERE for some typical modding errors and their causes.
XML.png
XML

TRTA << Other file types >> TSFL

switch to OBD page

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
0 - normal font
1 - bold font
2 - italic font
<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.