Documentation for graphex.ew v0.10.0
Table of Contents

Font

Drawing text on a gfx.


This uses line drawing fonts.

  • func enumGfxFonts()    Get a list of known font names
  • proc gfxCharOurAt(gfx, x, y, ch, colour)   Draw a single character of colour at x,y on the gfx
  • proc gfxTextOutAt(gfx, x, y, string, colour)   Draw text in the line drawing font at x,y in one colour on the gfx
  • func setGfxFont("font-name")   Select the font by name.
  • func setGfxFontScale(scale)    Change the size of the font characters that will be drawn by a gfxCharOutAt or gfxTextOutAt

    Documentation for graphex.ew v0.10.0
    Table of Contents

    [func]
    enumGfxFonts
    ()

    Get a list of known font names

    Returns: a sequence of text names of fonts.

    Category: Font

    See Also: gfxCharOurAt, gfxTextOutAt, setGfxFont, setGfxFontScale


    Documentation for graphex.ew v0.10.0
    Table of Contents

    [proc]
    gfxCharOurAt
    (gfx, x, y, ch, colour)

    Draw a single character of colour at x,y on the gfx

    Category: Font

    This is used by gfxTextOutAt but can be called separately. ch is a character literal not a string.

    See Also: enumGfxFonts, gfxTextOutAt, setGfxFont, setGfxFontScale


    Documentation for graphex.ew v0.10.0
    Table of Contents

    [proc]
    gfxTextOutAt
    (gfx, x, y, string, colour)

    Draw text in the line drawing font at x,y in one colour on the gfx

    Category: Font

    This uses the selected line drawing font to draw text at the specified location. The text does not wrap.

    See Also: enumGfxFonts, gfxCharOurAt, setGfxFont, setGfxFontScale


    Documentation for graphex.ew v0.10.0
    Table of Contents

    [func]
    setGfxFont
    ("font-name")

    Select the font by name.

    Returns: The index into the global gfxfonts sequence

    Category: Font

    See Also: enumGfxFonts, gfxCharOurAt, gfxTextOutAt, setGfxFontScale


    Documentation for graphex.ew v0.10.0
    Table of Contents

    [func]
    setGfxFontScale
    (scale)

    Change the size of the font characters that will be drawn by a gfxCharOutAt or gfxTextOutAt

    Returns: The old scale factor to ease setting the size back to what it was before

    Category: Font

    will not be pretty since the rounding makes the characters look wonky.

    See Also: enumGfxFonts, gfxCharOurAt, gfxTextOutAt, setGfxFont