summaryrefslogtreecommitdiffhomepage
path: root/release
diff options
context:
space:
mode:
authorRay <[email protected]>2018-06-20 00:52:14 +0200
committerRay <[email protected]>2018-06-20 00:52:14 +0200
commit75ba5aca551d2b16fa75ba31e616b009ac5dde6a (patch)
tree9e2b3d03856958d81ba07161d5c0d0a7e869000f /release
parent372e4a1139f8ac4b5e1220771447f1220104b112 (diff)
downloadraylib-75ba5aca551d2b16fa75ba31e616b009ac5dde6a.tar.gz
raylib-75ba5aca551d2b16fa75ba31e616b009ac5dde6a.zip
Improved font generation and SDF
Added: data to CharInfo struct Added: LoadFontData() Added: GenImageFontAtlas() Removed: LoadFontEx() Removed: LoadTTF() [internal] Some code tweaks
Diffstat (limited to 'release')
-rw-r--r--release/include/raylib.h27
-rw-r--r--release/libs/win32/mingw32/libraylib.abin1103438 -> 1116752 bytes
2 files changed, 14 insertions, 13 deletions
diff --git a/release/include/raylib.h b/release/include/raylib.h
index e0cfaa6d..49434d52 100644
--- a/release/include/raylib.h
+++ b/release/include/raylib.h
@@ -389,6 +389,7 @@ typedef struct CharInfo {
int offsetX; // Character offset X when drawing
int offsetY; // Character offset Y when drawing
int advanceX; // Character advance position X
+ unsigned char *data; // Character pixel data (grayscale)
} CharInfo;
// Font type, includes texture and charSet array data
@@ -955,29 +956,29 @@ RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint);
RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
-
//------------------------------------------------------------------------------------
// Font Loading and Text Drawing Functions (Module: text)
//------------------------------------------------------------------------------------
// Font loading/unloading functions
-RLAPI Font GetDefaultFont(void); // Get the default Font
-RLAPI Font LoadFont(const char *fileName); // Load Font from file into GPU memory (VRAM)
-RLAPI Font LoadFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load Font from file with extended parameters
-RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
+RLAPI Font GetDefaultFont(void); // Get the default Font
+RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
+RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, bool sdf); // Load font data for further use
+RLAPI Image GenImageFontAtlas(CharInfo *chars, int fontSize, int charsCount, int packing); // Generate image font atlas using chars info
+RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
// Text drawing functions
-RLAPI void DrawFPS(int posX, int posY); // Shows current FPS
-RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
-RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using Font and additional parameters
+RLAPI void DrawFPS(int posX, int posY); // Shows current FPS
+RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
+RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
// Text misc. functions
-RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
-RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
-RLAPI const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed'
-RLAPI const char *SubText(const char *text, int position, int length); // Get a piece of a text string
-RLAPI int GetGlyphIndex(Font font, int character); // Returns index position for a unicode character on sprite font
+RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
+RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
+RLAPI const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed'
+RLAPI const char *SubText(const char *text, int position, int length); // Get a piece of a text string
+RLAPI int GetGlyphIndex(Font font, int character); // Get index position for a unicode character on sprite font
//------------------------------------------------------------------------------------
// Basic 3d Shapes Drawing Functions (Module: models)
diff --git a/release/libs/win32/mingw32/libraylib.a b/release/libs/win32/mingw32/libraylib.a
index 2701869a..3425c71a 100644
--- a/release/libs/win32/mingw32/libraylib.a
+++ b/release/libs/win32/mingw32/libraylib.a
Binary files differ