New text icons?

Text icons require the following components:
  • A 22x22 DDS icon
  • An entry for the text icon name you specified - something like [ICON_YOURICONNAME] - within the table <IconFontMapping>. <IconFontMapping> takes the columns of IconFontTexture (referencing IconFontTexture from <IconFontTextures>), IconMapping (basically PortraitIndex) and IconName (your text icon's name, sans brackets)
  • An entry for the IconFontTexture in the table <IconFontTextures>. <IconFontTextures> takes the columns IconFontTexture (essentially the name of the "icon atlas" that holds your icon) and IconFontTextureFile (name is self-explanatory).
  • A .ggxml file mapping the DDS file into XML one additional time; see this thread for how to write it.

For example, I have this from my Dan the Squid mod:
Code:
</IconTextureAtlases>-<IconFontTextures>
		<Row IconFontTexture="ICON_FONT_TEXTURE_DAN_THE_SQUID_RESOURCES" IconFontTextureFile="Resource_FontIcons"/>
	</IconFontTextures>-<IconFontMapping>
		<Row IconName="ICON_RES_INK" IconFontTexture="ICON_FONT_TEXTURE_DAN_THE_SQUID_RESOURCES" IconMapping="1"/>
		<Row IconName="ICON_RES_CORAL" IconFontTexture="ICON_FONT_TEXTURE_DAN_THE_SQUID_RESOURCES" IconMapping="2"/>
		<Row IconName="ICON_RES_KELP" IconFontTexture="ICON_FONT_TEXTURE_DAN_THE_SQUID_RESOURCES" IconMapping="3"/>
		<Row IconName="ICON_RES_CAVIAR" IconFontTexture="ICON_FONT_TEXTURE_DAN_THE_SQUID_RESOURCES" IconMapping="4"/>
		<Row IconName="ICON_RES_BLUE_CRAB" IconFontTexture="ICON_FONT_TEXTURE_DAN_THE_SQUID_RESOURCES" IconMapping="5"/>
		<Row IconName="ICON_RES_MARLIN" IconFontTexture="ICON_FONT_TEXTURE_DAN_THE_SQUID_RESOURCES" IconMapping="6"/>
	</IconFontMapping>
As you can see, I had some fun experimenting with XML syntax in that mod. :p

GGXML looks like this:
Code:
?xml version="1.0" encoding="UTF-8" ?>
<!-- Created by AW -->
<glyphgen>
    <textures width="66" height="44">
		<texture name="" src="Resource_FontIcons.dds" allowcolor="1" alloweffects="1" inuse="1" />
	</textures>
	<styles count="1">
        <style name="">
            <layers count="1">
                <layer tex="" />
            </layers>
        </style>
    </styles>
	<glyphs fudgeadv="0" ascadj="-6" spacing="0" count="18" height="0" ascent="0" descent="0">
		<glyph ch="1" u="0" v="0" width="22" height="22" a="0" b="22" c="0" originx="0" originy="22" />
        <glyph ch="2" u="22" v="0" width="22" height="22" a="0" b="22" c="0" originx="0" originy="22" />
        <glyph ch="3" u="44" v="0" width="22" height="22" a="0" b="22" c="0" originx="0" originy="22" />
        <glyph ch="4" u="0" v="22" width="22" height="22" a="0" b="22" c="0" originx="0" originy="22" />
        <glyph ch="5" u="22" v="22" width="22" height="22" a="0" b="22" c="0" originx="0" originy="22" />
        <glyph ch="6" u="44" v="22" width="22" height="22" a="0" b="22" c="0" originx="0" originy="22" />
	</glyphs>
	<imports />
    <toolonly>
        <metainfo pt="0.000000" width="256" height="256" alphabias="64" maxsize="256" bestfit="0" pow2="1" freetype="2" fontsrc="" />
        <glyphsets>
            <set name="GlyphSetAscii" />
        </glyphsets>
    </toolonly>
</glyphgen>

I recommend Tomatekh's Historical Religions as a prime example of how this works, or, if you'd rather tackle something with considerably less icons, either my Dan the Squid mod or CL's Blackfoot.
 
Top Bottom