indent fonts.c fonts.h

This commit is contained in:
Bill Kendrick 2017-10-15 10:53:55 -07:00
parent b37621c2f0
commit 81ff48ccbc
2 changed files with 804 additions and 782 deletions

File diff suppressed because it is too large Load diff

View file

@ -63,10 +63,10 @@
#define SDL_WaitThread(tid,rcp) do{(void)tid;(void)rcp;}while(0) #define SDL_WaitThread(tid,rcp) do{(void)tid;(void)rcp;}while(0)
#define SDL_Thread int #define SDL_Thread int
#define SDL_mutex int #define SDL_mutex int
#define SDL_CreateMutex() 0 // creates in released state #define SDL_CreateMutex() 0 // creates in released state
#define SDL_DestroyMutex(lock) #define SDL_DestroyMutex(lock)
#define SDL_mutexP(lock) // take lock #define SDL_mutexP(lock) // take lock
#define SDL_mutexV(lock) // release lock #define SDL_mutexV(lock) // release lock
#endif #endif
#endif #endif
@ -91,21 +91,23 @@ TTF_Font *BUGFIX_TTF_OpenFont206(const char *const file, int ptsize);
/* Stuff that wraps either SDL_Pango or SDL_TTF for font rendering: */ /* Stuff that wraps either SDL_Pango or SDL_TTF for font rendering: */
enum { enum
{
#ifndef NO_SDLPANGO #ifndef NO_SDLPANGO
FONT_TYPE_PANGO, FONT_TYPE_PANGO,
#endif #endif
FONT_TYPE_TTF FONT_TYPE_TTF
}; };
typedef struct TuxPaint_Font_s { typedef struct TuxPaint_Font_s
{
#ifndef NO_SDLPANGO #ifndef NO_SDLPANGO
SDLPango_Context * pango_context; SDLPango_Context *pango_context;
#endif #endif
int typ; int typ;
TTF_Font * ttf_font; TTF_Font *ttf_font;
int height; int height;
char * desc; char *desc;
} TuxPaint_Font; } TuxPaint_Font;
int TuxPaint_Font_FontHeight(TuxPaint_Font * tpf); int TuxPaint_Font_FontHeight(TuxPaint_Font * tpf);
@ -140,7 +142,7 @@ static int text_sizes[] = {
#endif #endif
12, 18, 24, 36, 48, 12, 18, 24, 36, 48,
56, 64, 96, 112, 128, 160 56, 64, 96, 112, 128, 160
}; // point sizes }; // point sizes
#define MIN_TEXT_SIZE 0u #define MIN_TEXT_SIZE 0u
#define MAX_TEXT_SIZE (sizeof text_sizes / sizeof text_sizes[0] - 1) #define MAX_TEXT_SIZE (sizeof text_sizes / sizeof text_sizes[0] - 1)
@ -150,12 +152,12 @@ typedef struct style_info
{ {
char *filename; char *filename;
char *directory; char *directory;
char *family; // name like "FooCorp Thunderstruck" char *family; // name like "FooCorp Thunderstruck"
char *style; // junk like "Oblique Demi-Bold" char *style; // junk like "Oblique Demi-Bold"
int italic; int italic;
int boldness; int boldness;
int score; int score;
int truetype; // Is it? (TrueType gets priority) int truetype; // Is it? (TrueType gets priority)
} style_info; } style_info;
// user's notion of a font // user's notion of a font
@ -183,15 +185,15 @@ TuxPaint_Font *getfonthandle(int desire);
int charset_works(TuxPaint_Font * font, const char *s); int charset_works(TuxPaint_Font * font, const char *s);
TuxPaint_Font * TuxPaint_Font_OpenFont(const char * pangodesc, const char * ttffilename, int size); TuxPaint_Font *TuxPaint_Font_OpenFont(const char *pangodesc, const char *ttffilename, int size);
void TuxPaint_Font_CloseFont(TuxPaint_Font * tpf); void TuxPaint_Font_CloseFont(TuxPaint_Font * tpf);
const char * TuxPaint_Font_FontFaceFamilyName(TuxPaint_Font * tpf); const char *TuxPaint_Font_FontFaceFamilyName(TuxPaint_Font * tpf);
const char * TuxPaint_Font_FontFaceStyleName(TuxPaint_Font * tpf); const char *TuxPaint_Font_FontFaceStyleName(TuxPaint_Font * tpf);
#ifdef NO_SDLPANGO #ifdef NO_SDLPANGO
TuxPaint_Font *load_locale_font(TuxPaint_Font * fallback, int size); TuxPaint_Font *load_locale_font(TuxPaint_Font * fallback, int size);
#else #else
void sdl_color_to_pango_color(SDL_Color sdl_color, SDLPango_Matrix *pango_color); void sdl_color_to_pango_color(SDL_Color sdl_color, SDLPango_Matrix * pango_color);
#endif #endif
int load_user_fonts(SDL_Surface * screen, void *vp, const char *restrict const locale); int load_user_fonts(SDL_Surface * screen, void *vp, const char *restrict const locale);