diff options
| author | Ray <[email protected]> | 2019-02-15 17:58:00 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-02-15 17:58:00 +0100 |
| commit | 8a21830b77eaa76ffe0c31df5f96aecd6bd2eecc (patch) | |
| tree | 2d6f216f70e43ed477c14cf5a1d6a224ed7df379 /src/text.c | |
| parent | bc86b0f78b3f901ddc688f55915d260359f0da15 (diff) | |
| parent | eed69d41271a597c9753605da77281f93231d4f8 (diff) | |
| download | raylib-8a21830b77eaa76ffe0c31df5f96aecd6bd2eecc.tar.gz raylib-8a21830b77eaa76ffe0c31df5f96aecd6bd2eecc.zip | |
Merge pull request #755 from neonmoe/fix-config-flags
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) |
