Created
November 12, 2012 23:21
-
-
Save singpolyma/4062751 to your computer and use it in GitHub Desktop.
Minimal font test for ellipsis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test: test.c | |
gcc -o test -ansi -pedantic -Wall test.c `sdl-config --cflags --libs` -lSDL_ttf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL/SDL.h> | |
#include <SDL/SDL_ttf.h> | |
int main(int argc, char *argv[]) { | |
SDL_Init(SDL_INIT_EVERYTHING); | |
TTF_Init(); | |
{ | |
SDL_Event ev; | |
SDL_Color color = {255,255,255}; | |
SDL_Surface *win = SDL_SetVideoMode(640, 480, 16, SDL_HWSURFACE | SDL_DOUBLEBUF); | |
TTF_Font *drawfont = TTF_OpenFont("./ProggySquareSZ.ttf", 22); | |
SDL_Surface *text_surface = TTF_RenderUTF8_Solid(drawfont,"…",color); | |
SDL_Rect r = {10, 10, 0, 0}; | |
SDL_BlitSurface(text_surface,NULL,win,&r); | |
SDL_Flip(win); | |
while(SDL_WaitEvent(&ev)) { | |
if(ev.type == SDL_QUIT) break; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment