PDA

View Full Version : Font and fgf file



Mask_of_winter
June 8th, 2014, 05:56
I'm looking to modify font types for an extension. How do you go on creating an fgf file? Would simply renaming a ttf file work?

Trenloe
June 8th, 2014, 14:17
See the FGF font generator here: https://www.fantasygrounds.com/wiki/index.php/Developer_Guides

TTF files are used for a couple of headers in FG now (windowtitle and reference-h FG font names). However, I'm not sure which controls they are fully supported in at this point. See graphics\graphics_fonts.xml in CoreRPG for the 2 font entries using TTFs.

Mask_of_winter
June 8th, 2014, 14:29
Right now it's for Savage Worlds theme extension. Once SW is ported over to CoreRPG I'll probably have to make adjustments. Thank you.

Moon Wizard
June 8th, 2014, 19:57
Basically, the font generator tool available in Downloads converts a TTF into a series of bitmaps for each single-byte character in the font and saves into a FGF file.

The font.ttf ruleset tag basically incorporates that conversion into the FG client, bypassing the need for the FGF intermediate step.

The reason it hasn't been documented in detail in the reference guide up to this point and more generally announced is that I felt it had not been as heavily tested as I would like. At this point, I'm feeling fairly comfortable with it, since it's been in the client since v3.0.0.

Format is:


<font name="FG Font Name">
<ttf file="TTF File Path" name="TTF Font Name" size="Desired Font Height" />
<color value="Color Hex Value" />
</font>


Let me know if you have any problems.

Cheers,
JPG

Trenloe
June 8th, 2014, 20:16
Basically, the font generator tool available in Downloads converts a TTF into a series of bitmaps for each single-byte character in the font and saves into a FGF file.
I was wondering exactly how it worked/what the TTF support was.

Thanks for explaining, very useful. :)

Mask_of_winter
June 8th, 2014, 23:15
It worked without a problem! :) Thanks guys.

Mask_of_winter
June 8th, 2014, 23:43
6697

Code:
<font name="sheetlabel">
<fgffile name="graphics/fonts/abaddon_bold_14.fgf" />
<color value="#000000" />
</font>

I applied this code. It changed the font alright but not the color. I changed all three tags that had that yellow/brown color (#261A12) to the black color code but it's not changing it to black. What am I missing here?

Trenloe
June 8th, 2014, 23:56
I applied this code. It changed the font alright but not the color. I changed all three tags that had that yellow/brown color (#261A12) to the black color code but it's not changing it to black. What am I missing here?
Does the colour get overridden when the "sheetlabel" font is used within the XML sheet data, or a template used?

The font definition for sheetlabel is the lowest level of definition, this could very well be overridden by a control template or when the control is used within the sheet.

Mask_of_winter
June 9th, 2014, 00:48
Does the colour get overridden when the "sheetlabel" font is used within the XML sheet data, or a template used?

The font definition for sheetlabel is the lowest level of definition, this could very well be overridden by a control template or when the control is used within the sheet.

Yes, it was in the template_charsheet.xml file, sheetlabel font. It did change the sheetlabel font to black for the Attributes but not for the Derived Stats. Hmmm

Trenloe
June 9th, 2014, 01:04
Yes, it was in the template_charsheet.xml file, sheetlabel font. It did change the sheetlabel font to black for the Attributes but not for the Derived Stats. Hmmm
Are the derived stats using a different control?