Mason Font: Difference between revisions
m →Resulting Bitmaps within GIMP, as Source: fix URL |
Rewrite |
||
Line 3: | Line 3: | ||
PAGE UNDER CONSTRUCTION | PAGE UNDER CONSTRUCTION | ||
Mason is a highly stylized font found in the large headlines of the main menu pages. For example, at the top of the Load/Save and Download pages. Only the 48pt font size is supplied, for English (including Latin/European) and for Russian, because this font is not positioned for use in FMs. Headline characters are rendered in black surrounded by a static golden-white "glow". | Mason is a highly stylized font found in the large headlines of the main menu pages. For example, at the top of the Load/Save and Download pages. Only the 48pt font size is supplied, for English (including Latin/European) and for Russian, because this font is not positioned for use in FMs. Headline characters are rendered in black, surrounded by a static golden-white "glow" (or a different effect if Russian). | ||
This page will be of most interest to anyone seeking to extend or manipulate this font. The historical context is to shed light on current complexities. | |||
== Origins == | == Origins == | ||
Line 11: | Line 11: | ||
== 2010-14 Era - A New Font to Support Translations == | == 2010-14 Era - A New Font to Support Translations == | ||
''Drawing from Tels' "Translating the TDM GUI" thread, particularly [https://forums.thedarkmod.com/index.php?/topic/12863-translating-the-tdm-gui/page/14/#findComment-274467 here].'' | ''Drawing from Springheel’s [https://forums.thedarkmod.com/index.php?/topic/13825-menu-concerns-for-108/ "Menu concerns for 1.08"] and Tels' "Translating the TDM GUI" thread, particularly [https://forums.thedarkmod.com/index.php?/topic/12863-translating-the-tdm-gui/page/14/#findComment-274467 here].'' | ||
When it came time to expand to European languages (an effort Tels led in 2010-14), the original method was replaced by a more flexible one: blank parchment backgrounds overlaid by a text font, plus the glow. | When it came time to expand main menu headlines to European languages (an effort Springheel and Tels led in 2010-14), the original method was replaced by a more flexible one: blank parchment backgrounds overlaid by a text font, plus the glow. | ||
=== TTF Manipulation and Conversion === | === TTF Manipulation and Conversion === | ||
The starting point for that font [one assumes] was some Mason-like TTF font. It was likely Jonathan Barnbrook's 1992 "Mason Alternate", which has no separately styled lower case characters; lower-case is just a smaller version of upper-case. | The starting point for that font [one assumes] was some Mason-like TTF font. It was likely Jonathan Barnbrook's 1992 "Mason Alternate", which has no separately styled lower case characters; lower-case is just a smaller version of upper-case. | ||
Doom-era tools existed to programmatically convert a TTF file into a starting version of a TDM font, namely, a DAT file and a set of TGA (and ultimately DDS) images. (12pt and 24pt sizes were also generated, but only 48pt was pursued.) Furthermore, Tels reported working with graphics apps GIMP and Paintshop, that work directly with TTF fonts as well as TGA image files. | |||
=== Bitmap Tweaking and Character Set Extension === | === Bitmap Tweaking and Character Set Extension === | ||
The 48pt font was then further adapted to "TDM style" (internally, "MasonAlternate"), with some characters morphed to look more like their burned-in TDM predecessors. Substantial additional bitmap editing added Cyrillic and the full panoply of accented Latin characters. The result was a duplicated set of (initially) seven 256x256 bitmaps that would cover English, European, and Russian languages. While the bitmaps were "shared" (by duplication - unlike the case with other TDM fonts), the metadata DAT files for English+European and for Russian had different content (i.e., diverging in their included glyphs and codepoint mapping), and were generated by separate Font Patcher scripts. (Subsequently, the sharing became partial; see " | The 48pt font was then further adapted to "TDM style" (internally, "MasonAlternate"), with some characters morphed to look more like their burned-in TDM predecessors. Substantial additional bitmap editing added Cyrillic and the full panoply of accented Latin characters. The result was a duplicated set of (initially) seven 256x256 bitmaps that would cover English, European, and Russian languages. While the bitmaps were "shared" (by duplication - unlike the case with other TDM fonts), the metadata DAT files for English+European and for Russian had different content (i.e., diverging in their included glyphs and codepoint mapping), and were generated by separate Font Patcher scripts. (Subsequently, the sharing became partial; see "Further Changes..." below.) | ||
=== Enlarging Upper-Case Character of the New Font === | === Enlarging Upper-Case Character of the New Font === | ||
Font Patcher scripting, as it generates a new, modified DAT file from an old one, can be asked to apply a scaling factor to specific characters. This does not affect the bitmap glyphs in any way, but instructs the TDM engine to scale at render-time. (See elsewhere for more about scaling within DAT files.) | Font Patcher scripting, as it generates a new, modified DAT file from an old one, can be asked to apply a scaling factor to specific characters. This does not affect the bitmap glyphs in any way, but instructs the TDM engine to scale at render-time. (See elsewhere for more about scaling within DAT files.) | ||
Recall the starting Mason TTF font had lower case-letters that were the same as upper-case, except for size difference. But that difference seemed insufficient. | Recall the starting Mason TTF font had lower case-letters that were the same as upper-case, except for size difference. But that difference seemed insufficient. After experimentation, it was decided to make the upper-case letter nominally 20% larger, by applying a scaling factor of 1.20 to them. (Actual scaling ratios recalculated from resulting DAT values will vary due to rounding-to-integer quantification.) | ||
This was applied to A-Z, as well as accented uppercase characters at codepoints 0x80-84, a2, a5, a6, a9-ac, b0, b2-b4, bc, be, and c0-dd. | This was applied to A-Z, as well as accented uppercase characters at codepoints 0x80-84, a2, a5, a6, a9-ac, b0, b2-b4, bc, be, and c0-dd. | ||
=== | === Finalizing Russian === | ||
TDM's Mason (as well as Carleton) supports a "glow" around each character. As deployed with Mason, the glow is a static yellowish-white halo around each black character; it does not vary with mouse-over. Indeed, TDM's Mason headlines (as opposed to Carleton) are not mouse-selectable. | At this point, the /russian/ versions of the seven bitmap shaders were frozen, and remain unchanged to the current day (unless DarkFate independently has made further alterations; beyond our scope here). [There was a 2021 touch of all font file dates... was anything changed then?] | ||
The glow is not done with special engine coding, but rather by using the GUI system and separate bitmap sets for the base characters ("mason") and their glows ("mason_glow"). Each pair of base and glow characters will be aligned at render time, so must have compatible DAT metrics. (More about this below in a modern context.) | |||
While a Russian "mason_glow" font was created and shipped, it is merely a placeholder: an exact duplicate of "mason", in regard to the content of their DAT files and their sets of DDS files. Instead, the Russian deployment provides a substitute visual effect by rendering each character twice. | |||
=== Further Changes to English+European Mason During 2010-14 === | |||
==== Bitmap Consolation ==== | |||
While /russian/ kept 7 bitmaps, as discussed, the /english/ set was compacted to 6, by combining characters from Masonalternate_5_48.dds and Masonalternate_6_48.dds into the former alone. The DAT file was appropriated adjusted. | |||
Be aware that the compacted "english" set and the uncompacted "russian" set still encompass the same character glyphs; as before, their DAT files differ in what they expose. | |||
==== Introducing Glow ==== | |||
TDM's Mason (as well as Carleton) supports a "glow" around each character. As deployed with the /english/ version of Mason, the glow is a static yellowish-white halo around each black character; it does not vary with mouse-over. Indeed, TDM's Mason headlines (as opposed to Carleton) are not mouse-selectable. The glow is not done with special engine coding, but rather by using the GUI system and separate bitmap sets for the base characters ("mason") and their glows ("mason_glow"). Each pair of base and glow characters will be aligned at render time, so must have compatible DAT metrics. (More about this below in a modern context.) | |||
To accommodate the extra spacing needed for a glow, some glyphs were moved further away from a shader edge, where they had been placed by the programmatic conversion. Significant adjustments for glow spacing: | |||
* Masonalternate_0_48.dds. No change. | |||
* Masonalternate_1_48.dds. Top row english moved down. | |||
* Masonalternate_2_48.dds. Top row english moved down. | |||
* Masonalternate_3_48.dds. No change. | |||
* Masonalternate_4_48.dds. Top row accented moved down. Left column accented moved right. | |||
* Masonalternate_5_48.dds. (combines russian 5 & 6) Top row accented moved down. | |||
The general GIMP method of creating a glow font bitmap from a copy of a base font bitmap is described | The general GIMP method of creating a glow font bitmap from a copy of a base font bitmap is described | ||
Line 38: | Line 56: | ||
This results in paired base and glow bitmaps having the same character positioning, which while not required, is best practice and simplifies understanding when viewing in GIMP. | This results in paired base and glow bitmaps having the same character positioning, which while not required, is best practice and simplifies understanding when viewing in GIMP. | ||
Be aware that though paired DDS files in /english/mason/ and /english/mason_glow/ have identical filenames, the content is different. For example, mason/masonalternative_0_48.dds and mason_glow/masonalternative_0_48.dds have respectively base content and glow content. | |||
Be aware that though | |||
=== Resulting Bitmaps within GIMP, as Source === | ==== Resulting Bitmaps within GIMP, as Source ==== | ||
This discusses masonalternate_48.xcf, available... | This discusses masonalternate_48.xcf, available... | ||
* with filedate of May 26, 2012, unversioned in TDM SVN | * with filedate of May 26, 2012, unversioned in TDM SVN | ||
Line 66: | Line 79: | ||
* "0" ==> mason/fontimage_0_48.dds | * "0" ==> mason/fontimage_0_48.dds | ||
=== Deployment and European String Support === | ==== Deployment and European String Support ==== | ||
Regarding Mason, it was the | Regarding Mason, it was the plan to provide translated text and GUI methodology to all the main menu headlings, e.g., "Settings", "Load/Save", and "Mission Archive". [There are indications this was only realized for some headlines, and finally completed during the 2017-18 update.] | ||
=== MORE COMING SOON === | === MORE COMING SOON === |
Revision as of 03:28, 10 December 2024
By Geep, 2024
PAGE UNDER CONSTRUCTION
Mason is a highly stylized font found in the large headlines of the main menu pages. For example, at the top of the Load/Save and Download pages. Only the 48pt font size is supplied, for English (including Latin/European) and for Russian, because this font is not positioned for use in FMs. Headline characters are rendered in black, surrounded by a static golden-white "glow" (or a different effect if Russian).
This page will be of most interest to anyone seeking to extend or manipulate this font. The historical context is to shed light on current complexities.
Origins
Back when the founders created TDM, the main menu headlines (including glow) were burnt into the parchment backgrounds of main pages. This was no doubt done with a font (likely Adobe's "Mason Alternate Serif") available within a graphics editor. And presumably with different page images for English and Russian, the two initial languages. [Please expand/refine this section if you were around then.]
2010-14 Era - A New Font to Support Translations
Drawing from Springheel’s "Menu concerns for 1.08" and Tels' "Translating the TDM GUI" thread, particularly here.
When it came time to expand main menu headlines to European languages (an effort Springheel and Tels led in 2010-14), the original method was replaced by a more flexible one: blank parchment backgrounds overlaid by a text font, plus the glow.
TTF Manipulation and Conversion
The starting point for that font [one assumes] was some Mason-like TTF font. It was likely Jonathan Barnbrook's 1992 "Mason Alternate", which has no separately styled lower case characters; lower-case is just a smaller version of upper-case.
Doom-era tools existed to programmatically convert a TTF file into a starting version of a TDM font, namely, a DAT file and a set of TGA (and ultimately DDS) images. (12pt and 24pt sizes were also generated, but only 48pt was pursued.) Furthermore, Tels reported working with graphics apps GIMP and Paintshop, that work directly with TTF fonts as well as TGA image files.
Bitmap Tweaking and Character Set Extension
The 48pt font was then further adapted to "TDM style" (internally, "MasonAlternate"), with some characters morphed to look more like their burned-in TDM predecessors. Substantial additional bitmap editing added Cyrillic and the full panoply of accented Latin characters. The result was a duplicated set of (initially) seven 256x256 bitmaps that would cover English, European, and Russian languages. While the bitmaps were "shared" (by duplication - unlike the case with other TDM fonts), the metadata DAT files for English+European and for Russian had different content (i.e., diverging in their included glyphs and codepoint mapping), and were generated by separate Font Patcher scripts. (Subsequently, the sharing became partial; see "Further Changes..." below.)
Enlarging Upper-Case Character of the New Font
Font Patcher scripting, as it generates a new, modified DAT file from an old one, can be asked to apply a scaling factor to specific characters. This does not affect the bitmap glyphs in any way, but instructs the TDM engine to scale at render-time. (See elsewhere for more about scaling within DAT files.)
Recall the starting Mason TTF font had lower case-letters that were the same as upper-case, except for size difference. But that difference seemed insufficient. After experimentation, it was decided to make the upper-case letter nominally 20% larger, by applying a scaling factor of 1.20 to them. (Actual scaling ratios recalculated from resulting DAT values will vary due to rounding-to-integer quantification.) This was applied to A-Z, as well as accented uppercase characters at codepoints 0x80-84, a2, a5, a6, a9-ac, b0, b2-b4, bc, be, and c0-dd.
Finalizing Russian
At this point, the /russian/ versions of the seven bitmap shaders were frozen, and remain unchanged to the current day (unless DarkFate independently has made further alterations; beyond our scope here). [There was a 2021 touch of all font file dates... was anything changed then?]
While a Russian "mason_glow" font was created and shipped, it is merely a placeholder: an exact duplicate of "mason", in regard to the content of their DAT files and their sets of DDS files. Instead, the Russian deployment provides a substitute visual effect by rendering each character twice.
Further Changes to English+European Mason During 2010-14
Bitmap Consolation
While /russian/ kept 7 bitmaps, as discussed, the /english/ set was compacted to 6, by combining characters from Masonalternate_5_48.dds and Masonalternate_6_48.dds into the former alone. The DAT file was appropriated adjusted.
Be aware that the compacted "english" set and the uncompacted "russian" set still encompass the same character glyphs; as before, their DAT files differ in what they expose.
Introducing Glow
TDM's Mason (as well as Carleton) supports a "glow" around each character. As deployed with the /english/ version of Mason, the glow is a static yellowish-white halo around each black character; it does not vary with mouse-over. Indeed, TDM's Mason headlines (as opposed to Carleton) are not mouse-selectable. The glow is not done with special engine coding, but rather by using the GUI system and separate bitmap sets for the base characters ("mason") and their glows ("mason_glow"). Each pair of base and glow characters will be aligned at render time, so must have compatible DAT metrics. (More about this below in a modern context.)
To accommodate the extra spacing needed for a glow, some glyphs were moved further away from a shader edge, where they had been placed by the programmatic conversion. Significant adjustments for glow spacing:
- Masonalternate_0_48.dds. No change.
- Masonalternate_1_48.dds. Top row english moved down.
- Masonalternate_2_48.dds. Top row english moved down.
- Masonalternate_3_48.dds. No change.
- Masonalternate_4_48.dds. Top row accented moved down. Left column accented moved right.
- Masonalternate_5_48.dds. (combines russian 5 & 6) Top row accented moved down.
The general GIMP method of creating a glow font bitmap from a copy of a base font bitmap is described here.
This results in paired base and glow bitmaps having the same character positioning, which while not required, is best practice and simplifies understanding when viewing in GIMP.
Be aware that though paired DDS files in /english/mason/ and /english/mason_glow/ have identical filenames, the content is different. For example, mason/masonalternative_0_48.dds and mason_glow/masonalternative_0_48.dds have respectively base content and glow content.
Resulting Bitmaps within GIMP, as Source
This discusses masonalternate_48.xcf, available...
- with filedate of May 26, 2012, unversioned in TDM SVN
- with filedate of March 28, 2014, within Tels' bloodgate archive of translated FMs. Font Patcher scripts (as .txt files) are found here too.
All 12 /english/ bitmaps are found as separate layers within a GIMP .xcf (project) file. The base character layers are called simply "0" to "5". The glow characters are called "New Layer", "New Layer #2", and so on. (Unfortunately, in this .xcf, they are unhelpfully misnumbered. Just know that a "New Layer" pairs with the base numbered layer immediately below it.) In addition, the early base seventh bitmap is represented here by the extra "Pasted Layer", whose characters (for /english/ not /russian/) were subsequently copied into layer 5.
So, as layers are individually exported as DDS files, they must be manually distributed appropriately:
- "New Layer" above "5" ==> mason_glow/fontimage_5_48.dds
- "5" ==> mason/fontimage_5_48.dds
- "New Layer" above "4" ==> mason_glow/fontimage_4_48.dds
- "4" ==> mason/fontimage_4_48.dds
- "New Layer" above "3" ==> mason_glow/fontimage_3_48.dds
- "3" ==> mason/fontimage_3_48.dds
- "New Layer" above "2" ==> mason_glow/fontimage_2_48.dds
- "2" ==> mason/fontimage_2_48.dds
- "New Layer" above "1" ==> mason_glow/fontimage_1_48.dds
- "1" ==> mason/fontimage_1_48.dds
- "New Layer" above "0" ==> mason_glow/fontimage_0_48.dds
- "0" ==> mason/fontimage_0_48.dds
Deployment and European String Support
Regarding Mason, it was the plan to provide translated text and GUI methodology to all the main menu headlings, e.g., "Settings", "Load/Save", and "Mission Archive". [There are indications this was only realized for some headlines, and finally completed during the 2017-18 update.]