diff options
| author | Jens Pitkanen <jens@neon.moe> | 2019-02-14 12:32:23 +0200 |
|---|---|---|
| committer | Jens Pitkanen <jens@neon.moe> | 2019-02-14 13:52:18 +0200 |
| commit | f9963d4ed48db37bfeed53e26879078e1d8b9ca8 (patch) | |
| tree | 29886e764704ede674d5c402a5c2fc7de455a494 /src/text.c | |
| parent | bc86b0f78b3f901ddc688f55915d260359f0da15 (diff) | |
| download | raylib-f9963d4ed48db37bfeed53e26879078e1d8b9ca8.tar.gz raylib-f9963d4ed48db37bfeed53e26879078e1d8b9ca8.zip | |
Fix config.h flags
Diffstat (limited to 'src/text.c')
| -rw-r--r-- | src/text.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -309,6 +309,7 @@ Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCou font.charsCount = (charsCount > 0) ? charsCount : 95; font.chars = LoadFontData(fileName, font.baseSize, fontChars, font.charsCount, FONT_DEFAULT); +#if defined(SUPPORT_FILEFORMAT_TTF) if (font.chars != NULL) { Image atlas = GenImageFontAtlas(font.chars, font.charsCount, font.baseSize, 2, 0); @@ -316,6 +317,9 @@ Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCou UnloadImage(atlas); } else font = GetFontDefault(); +#else + font = GetFontDefault(); +#endif return font; } @@ -449,6 +453,7 @@ CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int c CharInfo *chars = NULL; +#if defined(SUPPORT_FILEFORMAT_TTF) // Load font data (including pixel data) from TTF file // NOTE: Loaded information should be enough to generate font image atlas, // using any packaging method @@ -537,12 +542,16 @@ CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int c if (genFontChars) free(fontChars); } else TraceLog(LOG_WARNING, "[%s] TTF file could not be opened", fileName); +#else + TraceLog(LOG_WARNING, "[%s] TTF support is disabled", fileName); +#endif return chars; } // Generate image font atlas using chars info // NOTE: Packing method: 0-Default, 1-Skyline +#if defined(SUPPORT_FILEFORMAT_TTF) Image GenImageFontAtlas(CharInfo *chars, int charsCount, int fontSize, int padding, int packMethod) { Image atlas = { 0 }; @@ -667,6 +676,7 @@ Image GenImageFontAtlas(CharInfo *chars, int charsCount, int fontSize, int paddi return atlas; } +#endif // Unload Font from GPU memory (VRAM) void UnloadFont(Font font) |
