Author Topic: Private Font (cheap and easy sprite creation)  (Read 1850 times)

0 Members and 1 Guest are viewing this topic.

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2003
    • www.zapsolution.com
Private Font (cheap and easy sprite creation)
« on: December 02, 2013, 12:16:57 PM »
Private Font

Is a 64-bit GDImage project, to create easy sprites from a provided sets of True Type Font.

There is no need to install the font(s) first, thus preserving the Windows memory, and insuring that it would be always available what ever the computer being used.

Example using USA map:
Code: [Select]
    x = RND(100, rc.right); y = RND(0, rc.bottom );
    sLabel = EXEpath(); sLabel.append(L"geobats.ttf");
    hBitmap = ZD_CreateBitmapFromText(L"1",                               // Text to render
                                      (WCHAR*)sLabel.c_str(),             // Font name
                                      -60,                                // Font size (abs), use negative to disable creation of rectangular background region.
                                      ZD_ColorARGB(225,RGB(65,128,32)),   // ARGB color
                                      2,                                  // Shadow/3D
                                      0);                                 // String format
    ZD_DrawBitmapToCtrl(hCtrl, x, y, hBitmap, 0xFFFFFFFF, ID_USA, ZS_VISIBLE);
    ZD_SetObjectImageLabel(ID_USA, L"United States of America");
    ZD_SetObjectScroll(ID_USA, TRUE);

Example using celeb faces:
Code: [Select]
    x = RND(100, rc.right); y = RND(0, rc.bottom);
    sLabel = EXEpath(); sLabel.append(L"Celeb_Faces.ttf");
    hBitmap = ZD_CreateBitmapFromText(L"h",                               // Text to render
                                      (WCHAR*)sLabel.c_str(),             // Font name
                                      -320,                               // Font size (abs), use negative to disable creation of rectangular background region.
                                      ZD_ColorARGB(255, RGB(255,192,32)), // ARGB color
                                      0,                                  // Shadow/3D
                                      0);                                 // String format
    ZD_DrawBitmapToCtrl(hCtrl, x, y, hBitmap, 0xFFFFFFFF, ID_HALLE, ZS_VISIBLE);
    ZD_SetObjectImageLabel(ID_HALLE, L"Halle Berry");
    ZD_SetObjectScroll(ID_HALLE, TRUE);

You can find plainty of nice free fonts there.

« Last Edit: December 03, 2013, 10:55:22 AM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com