Mason Font: Difference between revisions
m →Bitmap Tweaking and Character Set Extension: partial sharing |
m →Resulting Bitmaps within GIMP, as Source: fix URL |
||
Line 48: | Line 48: | ||
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 | ||
* with filedate of March 28, 2014, within Tels' [http bloodgate.com/mirrors/tdm/pub/tdm_i18n.zip bloodgate archive of translated FMs]. Font Patcher scripts (as .txt files) are found here too. | * with filedate of March 28, 2014, within Tels' [http://bloodgate.com/mirrors/tdm/pub/tdm_i18n.zip 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. | 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. |
Revision as of 17:28, 8 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".
Some historical context is provided here, 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 Tels' "Translating the TDM GUI" thread, particularly 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.
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.
Tels used graphics apps GIMP and Paintshop that work directly with TTF fonts. Also, 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.)
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 "Resulting Bitmaps as Files" 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. 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.
Introducing the "Glow"
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. 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.)
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.
Resulting Bitmaps as Files
Be aware that though the DDS files for mason and mason_glow have identical filenames, the content is different. That is, mason/masonalternative_0_48.dds and mason_glow/masonalternative_0_48.dds have respectively base content and glow content.
At some point in this process, the /english/ and /russian/ sets diverged. The latter kept 7 bitmaps (for base and for glow), while the former was compacted to 6, by combining the characters from the highest two bitmaps in numerical order. That is, the total number of "english" bitmaps was reduced from seven to six, by combining characters from Masonalternate_5_ and _6_ into _5_ alone. So the revised "english" set and the "russian" set still both offer the same characters. The Russian set remains to the present day (at least from the TDM perspective; whether it was further updated at DarkFate is beyond scope here.)
So, for /english/, the English/Latin and (in this context, unused) Russian base characters are contained in a shared set of 6 bitmaps. Similarly, the glow characters are in a different shared set of 6 bitmaps.
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 intension 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.]