summaryrefslogtreecommitdiffhomepage
path: root/cheatsheet/raylib_text.c
diff options
context:
space:
mode:
authorRay <[email protected]>2021-04-06 12:57:43 +0200
committerRay <[email protected]>2021-04-06 12:57:43 +0200
commit8940a2f553026e46fc97f49c449fe199df36745a (patch)
tree7ac79edc9205f1e1741fea38344c4a7a3c2068d8 /cheatsheet/raylib_text.c
parent0e9fa0a3f99813f5bacee372ada1f3e874981e9c (diff)
downloadraylib.com-8940a2f553026e46fc97f49c449fe199df36745a.tar.gz
raylib.com-8940a2f553026e46fc97f49c449fe199df36745a.zip
Update cheatsheet for raylib 3.7
Diffstat (limited to 'cheatsheet/raylib_text.c')
-rw-r--r--cheatsheet/raylib_text.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/cheatsheet/raylib_text.c b/cheatsheet/raylib_text.c
index 9ee6f0b..172e9de 100644
--- a/cheatsheet/raylib_text.c
+++ b/cheatsheet/raylib_text.c
@@ -1,51 +1,51 @@
// Font loading/unloading functions
- Font GetFontDefault(void); // Get the default Font
- Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
- Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // Load font from file with extended parameters
- Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style)
+ Font GetFontDefault(void); // Get the default Font
+ Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
+ Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // Load font from file with extended parameters
+ Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style)
Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount); // Load font from memory buffer
- CharInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use
- Image GenImageFontAtlas(const CharInfo *chars, Rectangle **recs, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info
- void UnloadFontData(CharInfo *chars, int charsCount); // Unload font chars info data (RAM)
- void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
+ CharInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use
+ Image GenImageFontAtlas(const CharInfo *chars, Rectangle **recs, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info
+ void UnloadFontData(CharInfo *chars, int charsCount); // Unload font chars info data (RAM)
+ void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
// Text drawing functions
- void DrawFPS(int posX, int posY); // Shows current FPS
- void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
+ void DrawFPS(int posX, int posY); // Draw current FPS
+ void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits
void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint,
- int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection
- void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint)
+ int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection
+ void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint)
// Text misc. functions
- int MeasureText(const char *text, int fontSize); // Measure string width for default font
- Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
- int GetGlyphIndex(Font font, int codepoint); // Get index position for a unicode character on font
+ int MeasureText(const char *text, int fontSize); // Measure string width for default font
+ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
+ int GetGlyphIndex(Font font, int codepoint); // Get index position for a unicode character on font
+
+ // Text strings management functions (no utf8 strings, only byte chars)
+ // NOTE: Some strings allocate memory internally for returned strings, just be careful!
+ int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied
+ bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal
+ unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending
+ const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf style)
+ const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string
+ char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (memory must be freed!)
+ char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (memory must be freed!)
+ const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter
+ const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings
+ void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor!
+ int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string
+ const char *TextToUpper(const char *text); // Get upper case version of provided string
+ const char *TextToLower(const char *text); // Get lower case version of provided string
+ const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string
+ int TextToInteger(const char *text); // Get integer value from text (negative values not supported)
+ char *TextToUtf8(int *codepoints, int length); // Encode text codepoint into utf8 text (memory must be freed!)
- // Text strings management functions (no utf8 strings, only byte chars)
- // NOTE: Some strings allocate memory internally for returned strings, just be careful!
- int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied
- bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal
- unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending
- const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf style)
- const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string
- char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (memory must be freed!)
- char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (memory must be freed!)
- const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter
- const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings
- void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor!
- int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string
- const char *TextToUpper(const char *text); // Get upper case version of provided string
- const char *TextToLower(const char *text); // Get lower case version of provided string
- const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string
- int TextToInteger(const char *text); // Get integer value from text (negative values not supported)
- char *TextToUtf8(int *codepoints, int length); // Encode text codepoint into utf8 text (memory must be freed!)
-
// UTF8 text strings management functions
- int *GetCodepoints(const char *text, int *count); // Get all codepoints in a string, codepoints count returned by parameters
- int GetCodepointsCount(const char *text); // Get total number of characters (codepoints) in a UTF8 encoded string
- int GetNextCodepoint(const char *text, int *bytesProcessed); // Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure
- const char *CodepointToUtf8(int codepoint, int *byteLength); // Encode codepoint into utf8 text (char array length returned as parameter)
+ int *GetCodepoints(const char *text, int *count); // Get all codepoints in a string, codepoints count returned by parameters
+ int GetCodepointsCount(const char *text); // Get total number of characters (codepoints) in a UTF8 encoded string
+ int GetNextCodepoint(const char *text, int *bytesProcessed); // Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure
+ const char *CodepointToUtf8(int codepoint, int *byteLength); // Encode codepoint into utf8 text (char array length returned as parameter)