Commit Graph

275 Commits

Author SHA1 Message Date
raysan5 621a8766a8 WARNING: BREAKING: Renamed CharInfo to GlyphInfo and more...
This commit introduces some breaking changes for library consistency, hopefully not too dramatic... Here the full list:
 - RENAMED: struct `CharInfo` to `GlyphInfo`, actually that's the correct naming for the data contained. It contains the character glyph metrics and the glyph image; in the past it also contained rectangle within the font atlas but that data has been moved to `Font` struct directly, so, `GlyphInfo` is a more correct name.
 - RENAMED: `CodepointToUtf8()` to `CodepointToUTF8()`, capitalization of UTF-8 is the correct form, it would also require de hyphen but it can be omitted in this case.
 - RENAMED: `TextToUtf8()` to `TextCodepointsToUTF8` for consistency and more detail on the functionality.
 - ADDED: `GetGlyphInfo()` to get glyph info for a specific codepoint
 - ADDED: `GetGlyphAtlasRec()` to get glyph rectangle within the generated font atlas
 - Some additional tweaks for consistency
2021-08-11 21:16:39 +02:00
raysan5 b6541b7a55 REVIEWED: DrawTextPro()
WARNING: DrawTextPro() requires including `rlgl.h`, before it was only dependant on `textures` module.
2021-08-11 19:02:15 +02:00
raysan5 7e27c2ffa8 TODO: DrawTextPro() rotation not working? 2021-08-11 18:53:06 +02:00
raysan5 b55418effd ADDED: DrawTextPro() with text rotation support 2021-08-11 18:31:56 +02:00
raysan5 5a259fa10f WARNING: REMOVED: DrawTextRec() and DrawTextRecEx()
- DrawTextRec() and DrawTextRecEx() have been moved to example, those functions could be very specific depending on user needs so it's better to give the user the full source in case of special requirements instead of allowing a function with +10 input parameters.
2021-08-11 18:31:32 +02:00
raysan5 559f1919c6 REVIEWED: Improved font loading info 2021-07-31 18:41:44 +02:00
raysan5 9e7ca41f58 Remove trailing spaces 2021-06-30 16:39:07 +02:00
raysan5 5f03201616 Minor tweaks 2021-06-26 22:43:20 +02:00
raysan5 2f75657350 WARNING: REMOVED: Some deprecated function names mapping
Some functions/values have been deprecated for long time but some mapping was kept for convenience. Some of those mappings have been removed...
2021-06-26 21:07:00 +02:00
Ray 46ad7b87e8 Update text.c 2021-06-24 18:11:48 +02:00
Ray 3db26f82ea WARNING: BREAKING: Functions renamed!
RENAMED: GetCodepoints() -> LoadCodepoints(), now codepoint array data is loaded dynamically instead of reusing a limited static buffer.
ADDED: UnloadCodepoints() to safely free loaded codepoints
RENAMED: GetNextCodepoint() -> GetCodepoint()
2021-06-23 09:58:49 +02:00
Ray 7f2a071c51 Formatting review 2021-06-22 20:14:44 +02:00
Diesirae 30a0f6f292 Fix DrawTextRec (#1843)
* fix text wrapping

* fix indent

* fix indent

* fix indent

* fix DrawTextRec
2021-06-22 18:16:04 +02:00
Ray 4b93feb172 Remove trail spaces 2021-06-13 17:08:30 +02:00
Ray b188008a1c Review code formatting 2021-06-10 18:00:44 +02:00
Ray b0dcdf688f Reviewed functions description
Replaced: Returns -> Get
2021-06-10 17:43:58 +02:00
raysan5 e95d8bc655 Minor format tweaks 2021-06-05 12:33:05 +02:00
Ray 0369ec9adf Some code tweaks 2021-05-30 11:50:32 +02:00
Ray 03710c9d8e Some code tweaks for consistency 2021-05-22 16:54:04 +02:00
Ray 2015828fc6 Security check in case of not valid font 2021-05-03 19:05:43 +02:00
Ray 640fc4d0a0 Minor tweaks 2021-04-16 21:19:28 +02:00
Jeffery Myers 13f97471a2 Change the color of the FPS display if the FPS is low (orange for <30, red for < 15). (#1676)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-03-24 17:59:05 +01:00
Ray bb73a8089a Reviewed DrawFPS() comment 2021-03-24 17:06:32 +01:00
Ray f7e48c95cd Added some comments on libc dependencies 2021-03-14 14:14:51 +01:00
Ray 01e28263be WARNING: VERY BREAKING CHANGE: Renamed some enum values for consistency
Some enums values have been renamed to be more consistent and also provide a more detailed description:
 - ShaderLocationIndex:    LOC_VERTEX_POSITION -> SHADER_SHADER_LOC_VERTEX_POSITION
 - ShaderUniformDataType:  UNIFORM_VEC2 -> SHADER_UNIFORM_VEC2
 - MaterialMapType: MAP_ALBEDO -> MATERIAL_MAP_ALBEDO
 - PixelFormat: UNCOMPRESSED_GRAYSCALE -> PIXELFORMAT_UNCOMPRESSED_GRAYSCALE
2021-03-14 11:05:51 +01:00
Ray ca22a87949 REVIEWED: TextFormat() #1626 2021-03-03 19:55:09 +01:00
Ray dfe797060a WARNING: BREAKING: RENAMED: enums values
RENAMED: TextureFilterMode values
RENAMED: TextureWrapMode values
2021-03-03 19:47:37 +01:00
Ray bcc4418ff0 REVIEWED: GetFileExtension() to include the dot #1523 2021-03-02 01:07:08 +01:00
Ray c256b26629 Reorder function 2021-01-12 20:24:58 +01:00
raysan5 d7b4b9e485 Update year to 2021 2021-01-02 18:15:13 +01:00
raysan5 0a9e080998 Remove trailing spaces 2020-12-23 15:03:26 +01:00
Ray 015e715278 Corrected DrawTextRecEx() bug 2020-12-19 19:12:51 +01:00
Ray e404a18226 Support font chars padding on drawing #1432
Previous implementation did not consider any padding while drawing the characters on screen (despite being available on the font atlas), so, only minimum character area was drawn.

If some text effect shader was required (shadow, glow, outline...), there was no space in the drawn quad to draw that pixels effect.

This commit corrects that issue.
2020-12-19 12:16:23 +01:00
Ray e07bc372a1 WARNING: RENAMED several functions for consistency #1440
This is a BREAKING CHANGE!

To address the linked issue, several functions have been renamed and couterpart functions have been created to free loaded memory:
 - RENAMED: GetImageData() -> LoadImageColors()
 - RENAMED: GetImagePalette() -> LoadImagePalette()
 - RENAMED: GetWaveData() -> LoadWaveSamples()
 - ADDED: UnloadImageColors()
 - ADDED: UnloadImagePalette()
 - ADDED: UnloadWaveSamples()
2020-12-18 21:03:08 +01:00
Ray f5b4656801 Added additional charsPadding initialization #1432 2020-12-14 23:51:55 +01:00
raysan5 14c1ee2681 ADDED: UnloadFontData() 2020-11-28 19:07:41 +01:00
raysan5 9b2b660f91 Commented new feature 2020-11-15 13:10:12 +01:00
raysan5 55dc8171f8 [text] Consider characters padding -WIP- #1432 2020-11-15 12:39:59 +01:00
Ray 3e1cd487df Remove trailing spaces 2020-11-03 23:47:33 +01:00
raysan5 43d82c1f21 Add security checks when loading data from memory 2020-09-16 11:33:56 +02:00
Ray 8cf0be4b6c Review memory loading functions signesness 2020-09-14 19:20:38 +02:00
Ray db652daf42 ADDED: LoadFontFromMemory() (TTF only) #1327 2020-09-13 16:42:31 +02:00
Ray 88c5deac87 WARNING: REDESIGNED: LoadFontData() 2020-09-13 16:41:52 +02:00
raysan5 945a02798b DrawTextEx(): Minor tweak 2020-08-29 13:57:59 +02:00
Ray 7b346dbbe1 Review issue with .fnt -> .png path #1351
When .fnt file is in the .exe path, image path was wrongly calculated
2020-08-15 11:32:23 +02:00
raysan5 b00ab118c6 [examples] text_font_sdf - Corrected bug 2020-06-02 23:07:11 +02:00
raysan5 c43e889e39 Corrected bug on TextJoin() 2020-05-27 13:45:11 +02:00
raysan5 b95673f701 Use RL_FREE() instead of free() 2020-05-23 19:21:46 +02:00
raysan5 c1e0978555 Replaced strncat() by memcpy() in some functions 2020-05-23 18:05:41 +02:00
raysan5 c1bb051e61 Avoid some warnings 2020-05-22 02:26:47 +02:00