• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

Private Font (cheap and easy sprite creation)

Started by Patrice Terrier, December 02, 2013, 12:16:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

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:    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:
    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.

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com