<text>.lbl
This file is used with dynamic materials (as defined in the Livery XML) to generate a texture using adaptive text. The file should contain a number of text alternatives to swap with the XML <Content>
based on the applied labels. This file needs to be included as part of the package that will be referencing it, and will require some setting up.
Before listing the different keys that the LBL file requires, here is an example showing a single livery definition which can be used for reference when setting up your own file:
{
"LabeledTexts": [
{
"Name": "TOR_sr-Cyrl",
"TextLayerAlteration": [
{
"LineId": "0",
"Content": "ТОУРИСОВА ОТКРИЋА"
}
],
"Labels": [
{
"Key": "Category",
"Values": [
"Slogan"
]
},
{
"Key": "Activity",
"Values": [
"TOR"
]
},
{
"Key": "language_code",
"Values": [
"sr-Cyrl"
]
}
]
}
]
}
"LabeledTexts"
This is the top level key of the <text>.lbl
file, and must be included otherwise the file will be invalid. The value for this element is an array, where each object in the array is a single livery definition containing the "Name"
, "TextLayerAlteration"
, and "Labels"
keys.
"Name"
This key expects a single value, which is a string defining the name of the text object. This name is purely orientative and is not used in the simulation. It is simply to help clearly identify each text object within the file.
"TextLayerAlteration"
This key expects an array and must have the following two key / value pairs: "LineId"
, "Content"
. There are also the following optional key / value pairs (which mainly correspond to the same Livery XML Properties for text and will be used to override the base values given in the XML file): "FontFamily"
, "FallbackFontFamily"
, "MacStyle"
, "Color"
, "StrokeColor"
, "Alignement"
, "FontSizeValue"
, "StrokeWidthValue"
, "LetterSpacingValue"
.
"LineId"
This key expects an integer value and sets the line of the text from the XML file to target. Currently this is an unsupported feature, but should always be included in the file. As such, the value for this key must always be "0".
"Content"
This key expects a string value and sets the new text content to be used to override the text defined in the livery.xml
file.
"FontFamily"
This key expects a string value and sets the font-family to use instead of the one defined in the livery.xml
file. The following is a complete list of the fonts that you can use:
ARIAL (regular / bold / bold italic / italic)
ARIAL BLACK (regular)
ARIAL NARROW (regular / bold / bold italic / italic)
MALGUN GOTHIC (regular / bold)
MALGUN GOTHIC SEMILIGHT (regular)
MANGAL (regular)
NSIMSUN (regular)
NIRMALA UI SMILIGHT (regular)
VRINDA (regular)
NOTO SANS KR (regular / bold)
NOTO SANS KR BLACK (regular)
NOTO SANS KR LIGHT (regular)
NOTO SANS KR MEDIUM (regular)
NOTO SANS KR THIN (regular)
NOTO SANS SC (regular / bold)
NOTO SANS SC BLACK (regular)
NOTO SANS SC LIGHT (regular)
NOTO SANS SC MEDIUM (regular)
NOTO SANS SC THIN (regular)
ROBOTO (regular / bold / bold italic / italic)
ROBOTO BLACK (regular / italic)
ROBOTO CONDENSED (regular / bold)
ROBOTO LIGHT (regular / italic)
ROBOTO MEDIUM (regular / bold)
ROBOTO THIN (regular / italic)
ROBOTO MONO (regular / bold / bold italic / italic)
ROBOTO MONO LIGHT (regular / italic)
ROBOTO MONO MEDIUM (regular / italic)
ROBOTO MONO MEDIUM+MEIRYO UI (regular)
ROBOTO MONO THIN (regular / italic)
ROBOTO SLAB (regular / bold)
ROBOTO SLAB LIGHT (regular)
ROBOTO SLAB MEDIUM (regular)
ROBOTO SLAB THIN (regular)
ROBOTOMONO (bold)
"FallbackFontFamily"
This key expects a string value and sets a fallback font to use in the event that the font set in the livery XML is not available or has issues. See the list of fonts given above in the "FontFamily"
key for available fonts.
"MacStyle"
This key expects a string value and will be used to change the bold, italic and underline properties from the livery XML. The value you supply for this is a string made up of a comma separated list of the styles you wish to change where:
- If a style is omitted it will come from the XML file
- If a style is included and is false in the XML then it will be flipped to true.
- If a style is included and is true in the XML then it will remain true.
For example, the following will attempt to change the style of the bold and italic attributes of the text:
"Labels": [
{
"Key": "MacStyle",
"Values": [
"bold, italic"
]
},
"Color"
This key expects a string that contains a hexadecimal (RGB) colour code and will be used to substitue the main text colour set in the livery.xml
.
"StrokeColor"
This key expects a string that contains a hexadecimal (RGB) colour code and will be used to substitue the stroke colour set in the livery.xml
.
"Alignement"
This key expects a string which will be used to replace the alignement set in the livery.xml
file. The available strings are:
- start: Text will be left-justified.
- center: Text will be centered.
- end: Text will be right-justified.
"FontSizeValue"
This key expects an integer value which overrides the pixel size for the font set in the livery.xml
file.
"StrokeWidthValue"
This key expects an integer value which overrides the pixel size for the stroke width set in the livery.xml
file.
"LetterSpacingValue"
This key expects an integer value which overrides the letter spacing value for the font set in the livery.xml
file.
"Labels"
This key expects an array of 1 or more objects, where each object is a "key" and "value" pair. Label keys are used to further filter the list of texts available such that only one is possible under any given situation.
It should be noted that the simulation will automatically check for translated text when the livery XML file has the "language_code" label with no key. In these cases, the library file should contain translated versions of the content text, with the label key
being "language_code" and the value
being the the ISO 639 two letter code for the language (it may also have an additional modifier from ISO 15924 to identify variants). The simulation code will then identify the correct language to use based on the region of the world where the flight or activity is being performed.
Below is an example of how a translation would be set up in the text LBL file (the example shows a label using a standard two letter language code and a label using a variant language code):
{
"Name": "TOR_sr-Cyrl",
"TextLayerAlteration": [
{
"LineId": "0",
"Content": "ТОУРИСОВА ОТКРИЋА"
}
],
"Labels": [
{
"Key": "language_code",
"Values": ["sr-Cyrl"]
}
]
},
{
"Name": "TOR_si",
"TextLayerAlteration": [
{
"LineId": "0",
"Content": "ටුරිස් සොයාගැනීම්"
}
],
"Labels": [
{
"Key": "language_code",
"Values": ["si"]
}
]
},
"Key"
This key is used to define a key parameter to be used as a filter to find the correct text to use.
"Value"
This is an array of values that accompany the given key to generate the filter used to find the correct text to use.