KXL_TextWidth
Author: kacchan

Prev Top Next

Name
KXL_TextWidth
Synopsis

    KXL_PutText -- The drawing width of a text is obtained.

Description

    Uint16 KXL_TextWidth(Uint8 *text);

Arguments

text | Text which draws.

Return Value
Drawing width of a text.
Exsample

    #include <KXL.h>

    int main(void)
    {
      Uint8 *text = "kxl.org";
      Uint16 w;

      KXL_CreateWindow(100, 100, "sample", 0);
      KXL_Font(NULL, 0xff, 0x00, 0x00);
      w = KXL_TextWidth(text);
      KXL_PutText(100 - w / 2, 10, text);
      KXL_UpDateImm(0, 0, 100, 100);
      getchar();
      KXL_DeleteWindow();
      return 0;
    }