Glimmr Drawing Commands

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section: Creating new fonts

    It is best to segregate fonts into their own extensions, so that they are available for other projects, and also because they tend to incorporate long stretches of repetitive code (e.g. figure declarations and glyph maps) that aren't nice to have in the main story file anyway.

    Begin the new extension by including this line:

        Use authorial modesty.

    This will suppress the extension's name when the VERSION command is typed in-game, in favor of a custom colophon (see below).

    Next, declare the font. For a bitmap font (actual data from the Glimmr fonts is used for these examples):

        Glimmr C&C is a bitmap font.

    Or, for an image font:

        Glimmr Lucidex is an image font.

    A font provides a "colophon," a bit of text that names and provides credit to the creator(s) of the font. Declare it like so:

        The colophon of Glimmr C&C is "Glimmr C&C is a pixel font based on C&C Red Alert by N3tRunn3r."

    The colophon is appended to the game's normal credits, and will look like this in the finished game:

        Typefaces used include:
        Glimmr C&C: Glimmr C&C is a pixel font based on C&C Red Alert by N3tRunn3r.

    Every font includes a "font table." The font table provides the critical parameters for each glyph. The font table differs significantly between image fonts and bitmap fonts (see the appropriate section below). For now, we will just declare a table name:

        The font table of Glimmr C&C is the Table of Glimmr C&C Parameters.

    A font has a number called the "font height". This number represents the maximum height of the glyph space in the appropriate units. For a bitmap font, this would be the number of bits, while for an image font, it is the number of pixels.

        The font-height of Glimmr C&C is 12.
        The font-height of Glimmr Lucidex is 56.

    This number represents the full height of the font, from the top of the ascenders to the bottom of the descenders. It is used primarily to calculate the height of the rectangle of background color, but it will also be useful to be aware of the height of the font as you design it. (Note that there is no corresponding number for width--all Glimmr fonts are variable width in principle, though it would be easy enough to make a fixed-width font by simply making all characters the same width.)