FXY File Format: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "[[Operation_Flashpoint:_Resistance_Introduction" to "[[Operation_Flashpoint:_Resistance")
(17 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{SideTOC}}
{{unsupported-doc}}
{{unsupported-doc}}
== Introduction ==


==Introduction==
[[Image:LucidaConsoleB11-01.paa.gif|thumb|right|150px|PAA layout of a font]]
[[Image:LucidaConsoleB11-01.paa.gif|thumb|right|150px|PAA layout of a font]]
The [[OFP]] and [[ArmA]] engines use a limited set of bit mapped fonts developed by Bohemia Interactive for the engine. They are bitmaps and each glyph within is treated as a texture.
The [[OFP]] and [[ArmA]] engines use a limited set of bit mapped fonts developed by Bohemia Interactive for the engine. They are bitmaps and each glyph within is treated as a texture.
Line 9: Line 10:
The character set for all BI fonts in OFP is different for each language version. For Western languages it approximates [http://en.wikipedia.org/wiki/Code_page_437 US-Ascii codepage 437]. In ArmA Unicode is used for fonts.
The character set for all BI fonts in OFP is different for each language version. For Western languages it approximates [http://en.wikipedia.org/wiki/Code_page_437 US-Ascii codepage 437]. In ArmA Unicode is used for fonts.


A font set is a collection of displayable characters (termed glyphs) that have a common appearance. Eg all glyphs in THIS set are bold, or all the glyphs are italic, all the glyphs are Times Roman (seriffed).
A font set is a collection of displayable characters (termed glyphs) that have a common appearance. E.g all glyphs in THIS set are bold, or all the glyphs are italic, all the glyphs are Times Roman (seriffed).


Individual font sets exist for Tahoma, Garamond, and so on.
Individual font sets exist for Tahoma, Garamond, and so on.
Line 17: Line 18:
And, because these are bitmapped fonts, eg fixed dimensions, non-scaleable, there are unique font sets, for, unique sizes.
And, because these are bitmapped fonts, eg fixed dimensions, non-scaleable, there are unique font sets, for, unique sizes.


For example, in [[Operation_Flashpoint:_Resistance_Introduction|Resistance]] engine, the popular Tahoma font is in three different font sets. 24 point, 36 point, 48 point.
For example, in [[Operation_Flashpoint:_Resistance|Resistance]] engine, the popular Tahoma font is in three different font sets. 24 point, 36 point, 48 point.


A 'point' approximates 1/72th of an inch. Thus the Tahoma fonts available (for Resistance) are approximately a third, a half, and two thirds of an inch tall when displayed.
A 'point' approximates 1/72th of an inch. Thus the Tahoma fonts available (for Resistance) are approximately a third, a half, and two thirds of an inch tall when displayed.


==Description==
== Description ==


An fxy file is the 'character set' index. It is, the codepage.
An fxy file is the 'character set' index. It is, the codepage.
Line 29: Line 30:
Association of files between fxy and paa is implicit. The CourierNewB64.fxy is implicitly associated with the CourierNewB64-xx.paa file(s). xx indicating one of several CourierNewB64 paa's.
Association of files between fxy and paa is implicit. The CourierNewB64.fxy is implicitly associated with the CourierNewB64-xx.paa file(s). xx indicating one of several CourierNewB64 paa's.


===Struct===
=== Legend ===


The fxy is a contiguous series of 12 byte entries. For OFP, the typically contain 224 entries, because the first 32 indexes of an Ascii codepage are unprintable, which leaves 256-32= 224. ArmA fxy's have 1088 entries, as each font supports both Western European, Eastern European and Cyrillic characters.  
see [[Generic FileFormat Data Types]].


Since ArmA, the fxy files contain 8 byte prefix (magic 32b value followed by a font version number, which is 0x101 for ArmA).
=== Struct ===


Each entry can be described in the following struct
<syntaxhighlight lang="cpp">
Fxy
{
bytes ArmaSignature[8]; // ARMA ONLY
FxyEntry Entry1;
(...)
FxyEntry EntryLast;
}
</syntaxhighlight>


struct FxyEntry {
==== ArmaSignature ====
  ushort  CharCode;    // '''0x21''' = 'A' <<< see note
<syntaxhighlight lang="cpp">
  ushort  PaaFileNumber; // 01
ArmaSignature
  ushort  X,Y            // Top-left Corner of char on the texture in pixels
{
  ushort  Width,Height; // Size of the char on the texture in pixels
char Magic[4]; //"BIFo"
  /* since ArmA */ ushort KerningWidth; // width used to determine this character spacing
ulong Version; // 0x101
};
}
'''CharCode'''
</syntaxhighlight>


ASCII (OFP) or Unicode (ArmA) code of the character. While OFP fonts released with the game contain continuous range of characters 0x20-0xff, it is not necessary for each font to implement it. Any font file can skip any characters not supported by it.
==== FxyEntry ====
<syntaxhighlight lang="cpp">
FxyEntry
{
ushort CharCode; // '''0x21''' = 'A' <<< see note
ushort PaaFileNumber; // 01
ushort X,Y; // Offset (in pixels) in the paa file, to the Top-left of this glyph.
ushort Width,Height; // area (number of) pixels used from the paa file for this glyph.
ushort KerningWidth; // ARMA only. Width used to determine this character spacing
};
</syntaxhighlight>


'''PaaFileNumber''' -number of texture file:
Apart from the ARMA header (in Arma fxy files only), the fxy is a contiguous series of 12 byte (ofp) or 14 byte (Arma) entries.
This is simply a convenience to allow large fonts to be spread across several paa's.
font name is "CourierNewB64"
Fxy file is "CourierNewB64.fxy",  
First texture file is "CourierNewB64-01.paa",
second is "CourierNewB64-02.paa".


==Usage==
==== CharCode ====
OFP uses a USASCII character set. Arma uses Unicode.


This example using the new font name in a [[ArmA]] description.ext.
The first 256 unicodes ARE us-ascii. For this reason, the first 32 (x20) glyphs in EITHER character set, are control characters, never intended for display, and not included in the paa file(s) nor the fxy header. For that reason, in all circumstances, *the* displayed character is charcode+x20. Thus


  class RscText
  'Actual Character' = charcode+x20;
{
        type = CT_STATIC;
        idc = -1;
        style = ST_LEFT;
        colorBackground[] = {0, 0, 0, 0};
        colorText[] = {1, 1, 1, 1};
        font = '''Bitstream''';
        sizeEx = '''0.04''';
};


==Paa Content==
Charcode x21 = index-entry =x21 = character x20+x21 = 0x41 = Glyph 'A'.
===Resistance===
 
This is a constant, irrespective of the number of fxy tables (fonts) now or in the future. Charcode x21 can only ever be glyph 'A' (rendered in whatever style and size the font wants to render it)
 
*For OFP, there are 224 entries in any fxy table. (which therefore covers the 256 (224+32) possible us ascii 'characters'.
 
*ArmA fxy's have 448 character entries + 16 specials, as each font supports both Western European, Eastern European and Cyrillic character sets.
 
: Bearing in mind that basic 16 bit Unicode can display 65,000 glyphs, standard Arma fonts only use (and are only capable of displaying) a small selection:
 
*  x20...17F Us Ascii + (most) European Languages
*  400...45F Cyrillic
* 2010...201F Special chars. unknown how they work.
 
You could extend this range in custom fonts of course to whatever you need from 16bit Unicode.
 
Note that index entries happen to be linear sequential. The nth index entry is also CharCode n. Which way, the engine actually accesses this table for character 'n' is up to the engine.
 
==== PaaFileNumber ====
 
<tt>-number</tt> of texture file:
This is simply a convenience to allow large fonts to be spread across several paa's. For example if font name is "CourierNewB64":
* The fxy file is <tt>CourierNewB64.fxy</tt>
* The first texture file is <tt>CourierNewB64'''-01'''.paa</tt>
* The second texture file is <tt>CourierNewB64'''-02'''.paa</tt>
* etc.
 
{{Informative | Note that you cannot assume the glyph character 'A' (nor any other glyph) is ordered the same way in any given paa font-set, nor, in fact that the glyph will 'always be' in e.g fontfile 1.}}
 
Order of glyphs is entirely random in the sense that binarising these files uses a 'best fit' method to squeeze as much content into that file. Not perfect, but not badly done either.
 
 
== Usage ==
 
This example uses the new font name in a [[Description.ext]]:
 
<syntaxhighlight lang="cpp">
class RscText
{
type = CT_STATIC;
idc = -1;
style = ST_LEFT;
colorBackground[] = {0, 0, 0, 0};
colorText[] = {1, 1, 1, 1};
font = Bitstream;
sizeEx = 0.04;
};
</syntaxhighlight>
 
== Paa Content ==
 
=== Resistance ===
[[PAA|.paa]] files used for the font must be in 8080 format: (Alpha luminosity)
[[PAA|.paa]] files used for the font must be in 8080 format: (Alpha luminosity)
* 8bit - Brightness (all with 255 value - "white")
* 8bit - Alpha (255 for character, 0 for space)


8bit - Brightness (all with 255 value - "white");
=== ArmA ===
8bit - Alpha (255 for character, 0 for space);
 
===ArmA===


Arma Glyph files (paa) are formatted in DXT5 compressed textures. Using the TAGG labelling, they must additionally specify
Arma Glyph files (paa) are formatted in DXT5 compressed textures. Using the TAGG labelling, they must additionally specify
Line 85: Line 140:
  AlphaFlag: 1
  AlphaFlag: 1


==Available Fonts==
 
===Resistance and CWC ===
== Available Fonts ==
  AudreysHand 48pt Italic
 
  AudreysHand 48pt Bold
[[Image:Arma3Fonts.png|thumb|280px|right|ArmA3's fonts]]
  CourierNew Bold 64pt
=== {{arma3}} ===
  Garamond 64
 
  Steelfish bold 64 and 128 pt
EtelkaMonospacePro
  SteelfishCE bold 64
EtelkaMonospaceProBold
  Tahoma 24/36/48 bold
EtelkaNarrowMediumPro
===Elite===
LucidaConsoleB
  Arial Bold 7,8,10,11,12 pt
PuristaBold
  Arial Italic 9,13,18,48
PuristaLight
PuristaMedium
PuristaSemiBold
RobotoCondensed
RobotoCondensedBold
RobotoCondensedLight
TahomaB
 
<div style="clear: both"></div>
[[Image:ArmA2OAFonts CO.png|thumb|280px|right|ArmA2's fonts]]
=== {{arma2}} ===
 
LucidaConsoleB
Zeppelin33
Zeppelin33Italic
Zeppelin32
EtelkaNarrowMediumPro
Bitstream
  TahomaB
  EtelkaMonospaceProBold
 
<div style="clear: both"></div>
=== {{arma}} ===
 
  Arial Bold 7 -> 24 pt
  BitStream
  Versans bold 7 -> 20, 22, 28 pt
Zeppelin32 12 -> 20, 22, 28 pt
  Zeppelin33 12 -> 20, 22, 28 pt
  Zeppelin33 italic 12 -> 20, 22, 28pt
 
=== {{ofpe}} ===
 
  Arial Bold 7, 8, 10, 11, 12 pt
  Arial Italic 9, 13, 18, 48 pt
  CourierNew 9pt
  CourierNew 9pt
  Hel67-CM 10,11 pt
  Hel67-CM 10, 11 pt
  HelvCondLight 8,9,10 pt
  HelvCondLight 8, 9, 10 pt
  Helvetica-Narrow 11pt
  Helvetica-Narrow 11pt
  Helvetica-Narrow Bold 8pt
  Helvetica-Narrow Bold 8pt
  Helvetica37-CondensedThin bold 10pt
  Helvetica37-CondensedThin bold 10pt
  Helvetica57-Condensed 10,13,16pt
  Helvetica57-Condensed 10, 13, 16pt
  Helvetica57-Condensed 9 ,13,14 pt Bold  
  Helvetica57-Condensed 9, 13, 14 pt Bold  
  Helvetica67-Condensed 10,11,9pt Medium
  Helvetica67-Condensed 9, 10, 11pt Medium
  HelveticaNarrow 10,11pt
  HelveticaNarrow 10, 11pt
  HelveticaNarrow bold 10,13,18,22
  HelveticaNarrow bold 10, 13, 18, 22pt
  HelveticaNeue 10,11,12,13,14,22
  HelveticaNeue 10 -> 14, 22pt
  HelveticaNeue Bold 22 B22-01.paa
  HelveticaNeue Bold 22pt
  LucidaConsole Bold 11,8
  LucidaConsole Bold 8, 11pt
  MSS Bold 9
  MSS Bold 9pt
  System 10pt
  System 10pt
  System 10pt Bold
  System Bold 10pt
  Tahoma 10,11,12,14,16,20,21pt
  Tahoma 10, 11, 12, 14, 16, 20, 21pt
  Tahoma 5,6,7,9,10,11,12,13,14,16,20,21 pt bold
  Tahoma bold 5, 6, 7, 9 -> 14, 16, 20, 21pt
  Tahoma 12pt Bold Italic
  Tahoma Bold Italic 12pt


===ArmA===
=== {{ofp}} ===
  Arial Bold 7->24 pt
 
  BitStreamVersans bold 7->20, 22, 28 pt
AudreysHand Italic 48pt
  Zeppelin32 12->20,22,28 pt
  AudreysHand Bold 48pt
  Zeppelin33 12->20,22,28 pt
CourierNew Bold 64pt
  Zeppelin33 12->20,22,28 pt italic
  Garamond 64pt
  Steelfish bold 64, 128pt
  SteelfishCE bold 64 pt
  Tahoma bold 24, 36, 48pt


[[category:Operation Flashpoint: Addons]]
[[Category:ArmA: Addon Editing]]


[[category:Operation Flashpoint: Modelling]]
[[Category:BIS_File_Formats]]
[[Category:BIS_File_Formats]]
[[Category:ArmA: File Formats]]

Revision as of 12:51, 8 August 2020

Template:SideTOC Template:unsupported-doc

Introduction

PAA layout of a font

The OFP and ArmA engines use a limited set of bit mapped fonts developed by Bohemia Interactive for the engine. They are bitmaps and each glyph within is treated as a texture.

A character set (such as Ascii) is a series of 'glyphs' (characters) where any one of these characters is always identified by the same index value. For example the letter A is always hex 41 and so on. Regardless of the font set employed, the character set within it, is set-in-concrete. Hex 41 always renders a glyph that 'looks like' the letter A. Be it bold, italic, or fills the entire screen, it is the letter 'A'.

The character set for all BI fonts in OFP is different for each language version. For Western languages it approximates US-Ascii codepage 437. In ArmA Unicode is used for fonts.

A font set is a collection of displayable characters (termed glyphs) that have a common appearance. E.g all glyphs in THIS set are bold, or all the glyphs are italic, all the glyphs are Times Roman (seriffed).

Individual font sets exist for Tahoma, Garamond, and so on.

The glyphs within these sets, are contained in .paa files. Generally, the entire font set = one, paa file.

And, because these are bitmapped fonts, eg fixed dimensions, non-scaleable, there are unique font sets, for, unique sizes.

For example, in Resistance engine, the popular Tahoma font is in three different font sets. 24 point, 36 point, 48 point.

A 'point' approximates 1/72th of an inch. Thus the Tahoma fonts available (for Resistance) are approximately a third, a half, and two thirds of an inch tall when displayed.

Description

An fxy file is the 'character set' index. It is, the codepage.

An fxy file is implicitly associated with one or more paa files within the same folder. The fxy file is the header entry for these files, it describes the position in the paa file and the size to be rendered on screen, for a 'glyph'.

Association of files between fxy and paa is implicit. The CourierNewB64.fxy is implicitly associated with the CourierNewB64-xx.paa file(s). xx indicating one of several CourierNewB64 paa's.

Legend

see Generic FileFormat Data Types.

Struct

Fxy
{
	bytes		ArmaSignature[8]; // ARMA ONLY
	FxyEntry	Entry1;
	(...)
	FxyEntry	EntryLast;
}

ArmaSignature

ArmaSignature
{
	char Magic[4]; //"BIFo"
	ulong Version; // 0x101
}

FxyEntry

FxyEntry 
{
	ushort CharCode;		// '''0x21''' = 'A' <<< see note
	ushort PaaFileNumber;	// 01
	ushort X,Y;				// Offset (in pixels) in the paa file, to the Top-left of this glyph.
	ushort Width,Height;	// area (number of) pixels used from the paa file for this glyph.
	ushort KerningWidth;	// ARMA only. Width used to determine this character spacing
};

Apart from the ARMA header (in Arma fxy files only), the fxy is a contiguous series of 12 byte (ofp) or 14 byte (Arma) entries.

CharCode

OFP uses a USASCII character set. Arma uses Unicode.

The first 256 unicodes ARE us-ascii. For this reason, the first 32 (x20) glyphs in EITHER character set, are control characters, never intended for display, and not included in the paa file(s) nor the fxy header. For that reason, in all circumstances, *the* displayed character is charcode+x20. Thus

'Actual Character' = charcode+x20;
Charcode x21 = index-entry =x21 = character x20+x21 = 0x41 = Glyph 'A'.

This is a constant, irrespective of the number of fxy tables (fonts) now or in the future. Charcode x21 can only ever be glyph 'A' (rendered in whatever style and size the font wants to render it)

  • For OFP, there are 224 entries in any fxy table. (which therefore covers the 256 (224+32) possible us ascii 'characters'.
  • ArmA fxy's have 448 character entries + 16 specials, as each font supports both Western European, Eastern European and Cyrillic character sets.
Bearing in mind that basic 16 bit Unicode can display 65,000 glyphs, standard Arma fonts only use (and are only capable of displaying) a small selection:
  • x20...17F Us Ascii + (most) European Languages
  • 400...45F Cyrillic
  • 2010...201F Special chars. unknown how they work.

You could extend this range in custom fonts of course to whatever you need from 16bit Unicode.

Note that index entries happen to be linear sequential. The nth index entry is also CharCode n. Which way, the engine actually accesses this table for character 'n' is up to the engine.

PaaFileNumber

-number of texture file: This is simply a convenience to allow large fonts to be spread across several paa's. For example if font name is "CourierNewB64":

  • The fxy file is CourierNewB64.fxy
  • The first texture file is CourierNewB64-01.paa
  • The second texture file is CourierNewB64-02.paa
  • etc.
Note that you cannot assume the glyph character 'A' (nor any other glyph) is ordered the same way in any given paa font-set, nor, in fact that the glyph will 'always be' in e.g fontfile 1.

Order of glyphs is entirely random in the sense that binarising these files uses a 'best fit' method to squeeze as much content into that file. Not perfect, but not badly done either.


Usage

This example uses the new font name in a Description.ext:

class RscText
{
	type = CT_STATIC;
	idc = -1;
	style = ST_LEFT;
	colorBackground[] = {0, 0, 0, 0};
	colorText[] = {1, 1, 1, 1};
	font = Bitstream;
	sizeEx = 0.04;
};

Paa Content

Resistance

.paa files used for the font must be in 8080 format: (Alpha luminosity)

  • 8bit - Brightness (all with 255 value - "white")
  • 8bit - Alpha (255 for character, 0 for space)

ArmA

Arma Glyph files (paa) are formatted in DXT5 compressed textures. Using the TAGG labelling, they must additionally specify

Avg Color: any
Max Color: always FFFFFFFF
AlphaFlag: 1


Available Fonts

ArmA3's fonts

Arma 3

EtelkaMonospacePro
EtelkaMonospaceProBold
EtelkaNarrowMediumPro
LucidaConsoleB
PuristaBold
PuristaLight
PuristaMedium
PuristaSemiBold
RobotoCondensed
RobotoCondensedBold 
RobotoCondensedLight
TahomaB
ArmA2's fonts

Arma 2

LucidaConsoleB
Zeppelin33
Zeppelin33Italic
Zeppelin32
EtelkaNarrowMediumPro
Bitstream
TahomaB
EtelkaMonospaceProBold

Arma

Arial Bold 7 -> 24 pt
BitStream
Versans bold 7 -> 20, 22, 28 pt
Zeppelin32 12 -> 20, 22, 28 pt
Zeppelin33 12 -> 20, 22, 28 pt
Zeppelin33 italic 12 -> 20, 22, 28pt

Operation Flashpoint: Elite

Arial Bold 7, 8, 10, 11, 12 pt
Arial Italic 9, 13, 18, 48 pt
CourierNew 9pt
Hel67-CM 10, 11 pt
HelvCondLight 8, 9, 10 pt
Helvetica-Narrow 11pt
Helvetica-Narrow Bold 8pt
Helvetica37-CondensedThin bold 10pt
Helvetica57-Condensed 10, 13, 16pt
Helvetica57-Condensed 9, 13, 14 pt Bold 
Helvetica67-Condensed 9, 10, 11pt Medium
HelveticaNarrow 10, 11pt
HelveticaNarrow bold 10, 13, 18, 22pt
HelveticaNeue 10 -> 14, 22pt
HelveticaNeue Bold 22pt
LucidaConsole Bold 8, 11pt
MSS Bold 9pt
System 10pt
System Bold 10pt
Tahoma 10, 11, 12, 14, 16, 20, 21pt
Tahoma bold 5, 6, 7, 9 -> 14, 16, 20, 21pt
Tahoma Bold Italic 12pt

Operation Flashpoint

AudreysHand Italic 48pt
AudreysHand Bold 48pt
CourierNew Bold 64pt
Garamond 64pt
Steelfish bold 64, 128pt
SteelfishCE bold 64 pt
Tahoma bold 24, 36, 48pt