This topic covers the implementation details of TmcFontSettings.
Scope: TypeDefinitions.pas; record. Prepared from the curated implementation supplied for this review on 2 October 2026.
StylesAdded and StylesRemoved use comma-delimited uppercase markers, not enum ordinals. A nonempty list has leading and trailing commas. HIDE short-circuits ordinary font payload processing.
The reader initializes font settings on entry. Individual numeric fields are integers in their stored internal units; FontShade and FontOpacity default to 100, horizontal/vertical scale to 10000 and FontSize to 800. Do not infer all physical units from these defaults.
The writer emits each ordinary payload only when the corresponding style is selected. CombinedFrameShadeRec, ShadeRec, FrameRec and StrokeRec are separate nested mechanisms. A declared member is not automatically part of this serializer.
Notation and shared helper rules: Reading this reference.
Literal rec_type values emitted within these routines: TmcFontSettings. Nested values may belong to child wrappers rather than this owner itself; the attribute entries below give their exact locations.
Structures used directly by this XML implementation:
Exact XML fields and attributes
The paths below start at this record or property node. A slash identifies a child element; @ identifies an attribute. Curly braces mark a variable index or expression, not literal XML text. Initial values describe initialization; they do not establish what an omitted individual element does. The Implementation toggle below contains the supplied routines for exact branch order and conversions.
StylesAdded
XML representation: The text of the StylesAdded element.
Reading: Reads the element into s when the record node exists. The subsequent conversion is shown in Implementation.
Writing: Stores TextStyleToString (StylesAdded) whenever the writer reaches this field.
StylesRemoved
XML representation: The text of the StylesRemoved element.
Reading: Reads the element into s when the record node exists. The subsequent conversion is shown in Implementation.
Writing: Stores TextStyleToString (StylesRemoved) whenever the writer reaches this field.
FontName
XML representation: The text of the FontName element.
Initial value: an empty string (TmcFontSettings.Initialize).
Reading: Reads the element into FontName when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores FontName when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoFontName is selected in StylesAdded.
FontSize
XML representation: The text of the FontSize element.
Initial value: 800 (TmcFontSettings.Initialize).
Reading: Reads the element into FontSize when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of FontSize when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoFontSize is selected in StylesAdded.
FontShade
XML representation: The text of the FontShade element.
Initial value: 100 (TmcFontSettings.Initialize).
Reading: Reads the element into FontShade when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of FontShade when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoFontShade is selected in StylesAdded.
Text
XML representation: The text of the Text element.
Initial value: an empty string (TmcFontSettings.Initialize).
Reading: Reads the element into Text when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores Text when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoChangeText is selected in StylesAdded.
TextMode
XML representation: The text of the TextMode element.
Initial value: 0 (TmcFontSettings.Initialize).
Reading: Reads the element into TextMode when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of TextMode when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoChangeText is selected in StylesAdded.
AddedTextMode
XML representation: The text of the AddedTextMode element.
Initial value: 0 (TmcFontSettings.Initialize).
Reading: Reads the element into AddedTextMode when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of AddedTextMode when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoChangeText is selected in StylesAdded.
HorScale
XML representation: The text of the HorScale element.
Initial value: 10000 (TmcFontSettings.Initialize).
Reading: Reads the element into HorScale when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of HorScale when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoHorScale is selected in StylesAdded.
VertScale
XML representation: The text of the VertScale element.
Initial value: 10000 (TmcFontSettings.Initialize).
Reading: Reads the element into VertScale when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of VertScale when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoVertScale is selected in StylesAdded.
Track
XML representation: The text of the Track element.
Initial value: 0 (TmcFontSettings.Initialize).
Reading: Reads the element into Track when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of Track when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoTrack is selected in StylesAdded.
Kern
XML representation: The text of the Kern element.
Initial value: 0 (TmcFontSettings.Initialize).
Reading: Reads the element into Kern when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of Kern when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoKern is selected in StylesAdded.
BaseShift
XML representation: The text of the BaseShift element.
Initial value: 0 (TmcFontSettings.Initialize).
Reading: Reads the element into BaseShift when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of BaseShift when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoBaseShift is selected in StylesAdded.
FontOpacity
XML representation: The text of the FontOpacity element.
Initial value: 100 (TmcFontSettings.Initialize).
Reading: Reads the element into FontOpacity when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of FontOpacity when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoFontOpacity is selected in StylesAdded.
Skew
XML representation: The text of the Skew element.
Initial value: 0 (TmcFontSettings.Initialize).
Reading: Reads the element into Skew when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of Skew when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoSkew is selected in StylesAdded.
Leading
XML representation: The text of the Leading element.
Initial value: 0 (TmcFontSettings.Initialize).
Reading: Reads the element into Leading when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores the numeric value of Leading when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoLeading is selected in StylesAdded.
ColorName
XML representation: The text of the ColorName element.
Initial value: “BLACK:1” (TmcFontSettings.Initialize).
Reading: Reads the element into ColorName when the record node exists; tsoHide is not selected in StylesAdded; StylesAdded contains selected options.
Writing: Stores ColorName when tsoHide is not selected in StylesAdded; StylesAdded contains selected options; tsoFontColor is selected in StylesAdded.
@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TmcFontSettings” whenever the writer reaches this field.
Nested records and repeated elements
Operation |
XML location |
When it is processed |
Read CombinedFrameShadeRec |
CombinedFrameShadeRec |
the record node exists; tsoHide is not selected in StylesAdded |
Read ShadeRec |
ShadeRec |
the record node exists; tsoHide is not selected in StylesAdded; node2 exists |
Read FrameRec |
FrameRec |
the record node exists; tsoHide is not selected in StylesAdded; node2 exists |
Read StrokeRec |
StrokeRec |
the record node exists; tsoHide is not selected in StylesAdded; node2 exists |
Write CombinedFrameShadeRec |
CombinedFrameShadeRec |
tsoHide is not selected in StylesAdded; CombinedFrameShadeRec.ComboType is not cfsNone (0) |
Write ShadeRec |
ShadeRec |
tsoHide is not selected in StylesAdded; CombinedFrameShadeRec.ComboType is one of [cfsText, cfsBoxCreate, cfsBoxModify]; ShadeRec.DoesSomething is true |
Write FrameRec |
FrameRec |
tsoHide is not selected in StylesAdded; CombinedFrameShadeRec.ComboType is one of [cfsText, cfsBoxCreate, cfsBoxModify]; FrameRec.DoesSomething is true |
Write StrokeRec |
StrokeRec |
tsoHide is not selected in StylesAdded; StrokeRec.DoesSomething is true |
Initialization and reset values
TmcFontSettings.Initialize
Setting or temporary variable |
Initial value |
When it is assigned |
self |
Default (TmcFontSettings) |
Always |
Text |
an empty string |
Always |
TextMode |
0 |
Always |
AddedTextMode |
0 |
Always |
FontName |
an empty string |
Always |
FontSize |
800 |
Always |
FontShade |
100 |
Always |
FontOpacity |
100 |
Always |
Cyan |
12 |
Always |
Magenta |
34 |
Always |
Yellow |
56 |
Always |
Black |
78 |
Always |
ColorName |
“BLACK:1” |
Always |
HorScale |
10000 |
Always |
VertScale |
10000 |
Always |
Track |
0 |
Always |
Kern |
0 |
Always |
BaseShift |
0 |
Always |
Skew |
0 |
Always |
Leading |
0 |
Always |
IsCombinedDateBoxSettings |
false |
Always |
ReallyUsesCombinedDateBoxSettings |
false |
Always |
This routine also calls self.CombinedFrameShadeRec.Initialize; self.ShadeRec.Initialize; self.FrameRec.Initialize; self.StrokeRec.Initialize; self.StylesAttr.Initialize. See Implementation for their order and any conditional calls.
Value namespaces used by this implementation
These are declared Pascal ordinal values. Use the ordinal only where the field serializer actually writes ord(...), an integer cast or an equivalent value. Set-marker strings and local option lists have their own representation; sentinel members in an enum are not automatically legal XML choices.
TmcTextStyleOption
Ordinal |
Declared member |
0 |
tsoHide |
1 |
tsoBold |
2 |
tsoItalic |
3 |
tsoOutline |
4 |
tsoShadow |
5 |
tsoStrikeThru |
6 |
tsoUnderline |
7 |
tsoWordUnderline |
8 |
tsoSmallCaps |
9 |
tsoAllCaps |
10 |
tsoSuperScript |
11 |
tsoSubscript |
12 |
tsoFontName |
13 |
tsoFontSize |
14 |
tsoFontShade |
15 |
tsoFontColor |
16 |
tsoChangeText |
17 |
tsoHorScale |
18 |
tsoVertScale |
19 |
tsoTrack |
20 |
tsoKern |
21 |
tsoBaseShift |
22 |
tsoAppend |
23 |
tsoReset |
24 |
tsoIgnoreAllOthers |
25 |
tsoFontOpacity |
26 |
tsoOverprint |
27 |
tsoSkew |
28 |
tsoLeading |
TCombinedFrameShadeType
Ordinal |
Declared member |
0 |
cfsNone |
1 |
cfsText |
2 |
cfsBoxCreate |
3 |
cfsBoxKeep |
4 |
cfsBoxModify |
5 |
cfsBoxDelete |
Text-style marker encoding
An empty style set is the empty string. A nonempty set has a leading comma, a comma after every marker and a trailing comma: for example ,B,I,FOSI,. The parser looks for complete case-sensitive marker substrings. HIDE replaces the ordinary style selection; RSET and IGNR are still processed. tsoAppend is declared but is not encoded by these two helpers.
Stored marker |
Style member |
HIDE |
tsoHide |
B |
tsoBold |
I |
tsoItalic |
UL |
tsoUnderline |
O |
tsoOutline |
SHD |
tsoShadow |
STRK |
tsoStrikeThru |
WUL |
tsoWordUnderline |
SCAP |
tsoSmallCaps |
ALLC |
tsoAllCaps |
SUP |
tsoSuperScript |
SUB |
tsoSubscript |
OVRPRT+ |
tsoOverprint |
FONA |
tsoFontName |
FOSI |
tsoFontSize |
FOSH |
tsoFontShade |
FOOP |
tsoFontOpacity |
FOCO |
tsoFontColor |
CHTX |
tsoChangeText |
HOSC |
tsoHorScale |
VESC |
tsoVertScale |
TRAK |
tsoTrack |
KERN |
tsoKern |
BASH |
tsoBaseShift |
SKW |
tsoSkew |
LEAD |
tsoLeading |
RSET |
tsoReset |
IGNR |
tsoIgnoreAllOthers |
Storage declarations relevant to interpretation
These are in-memory member and property types, not a list of mandatory XML children. They retain array bounds, fixed buffers and selector types. The field reference above defines what is actually serialized.
Name |
Declared type / bounds |
Kind |
FFontName |
array [1..256] of Char |
member |
FontSize |
integer |
member |
FontShade |
Byte |
member |
WordCyan |
Word |
member |
WordMagenta |
Word |
member |
WordYellow |
Word |
member |
WordBlack |
Word |
member |
FText |
array [1..25] of Char |
member |
TextMode |
Byte |
member |
HorScale |
integer |
member |
VertScale |
integer |
member |
Track |
integer |
member |
Kern |
integer |
member |
BaseShift |
integer |
member |
AddedTextMode |
Byte |
member |
FColorName |
array [1..50] of Char |
member |
FontOpacity |
Byte |
member |
CombinedFrameShadeRec |
TCombinedFrameShadeRec |
member |
ShadeRec |
TTextShadeRec |
member |
FrameRec |
TTextFrameRec |
member |
StrokeRec |
TTextStrokeRec |
member |
Skew |
integer |
member |
Leading |
integer |
member |
IsCombinedDateBoxSettings |
boolean |
member |
ReallyUsesCombinedDateBoxSettings |
boolean |
member |
StylesAttr |
TStylesAttributesRec |
member |
ColorName |
string |
property/accessor |
Cyan |
Integer |
property/accessor |
Magenta |
Integer |
property/accessor |
Yellow |
Integer |
property/accessor |
Black |
Integer |
property/accessor |
FontName |
string |
property/accessor |
Text |
string |
property/accessor |
The Implementation toggle contains only TmcFontSettings methods. Initializers and helpers belonging to other types are identified separately below. Shared XML-helper limitations are explained in Reading this reference.
Declaration reproduces this record’s complete declaration from the supplied source, including its fields, properties and method signatures.