VgaGames4

VgaGames4 - font man-pages

[.. upper level ..]

# vg4->font->getchars()

Get all characters of a font.

SYNTAX
int vg4->font->getchars(const struct VG_Font *fntp, struct VG_Fontchar **carray)
FUNCTION PARAMETERS

fntp | Font, or NULL = default font
carray | For returning characters, must be freed with free() if not NULL

RETURN VALUE
Returns the number of characters
DESCRIPTION
Get all characters of a font.
EXAMPLE

    struct VG_Font *fntp;
    struct VG_Fontchar *carray;
    int narray, n1;

    /* load default font */
    fntp = vg4->font->load(NULL);

    /* get characters */
    narray = vg4->font->getchars(fntp, &carray);
    for (n1 = 0; n1 < narray; n1++) {
      printf("Character %d: size=%d:%d char=%s\n",
             carray[n1].index,
             carray[n1].width,
             carray[n1].height,
             carray[n1].character);
    }

    if (carray != NULL) { free(carray); }