Commit Graph

183 Commits

Author SHA1 Message Date
raysan5
21c30f43d4 Update year to 2020 2020-01-05 20:01:54 +01:00
raysan5
08adb4b8c3 Check and testing timming #865 2019-12-04 17:59:17 +01:00
Ray
3ffe34f9bb ADDED: DrawTextCodepoint()
- Renamed GetGlyphIndex() parameter
 - Review DrawTextEx() implementation
 - Review DrawTextRecEx() implementation
2019-12-01 13:28:14 +01:00
raysan5
d5aab98ac9 Review PR #1015
Just simplified code a bit
2019-11-24 14:08:27 +01:00
brankoku
1f66f0d9a2 [text] TextFormat() caching (#1015) 2019-11-24 14:01:35 +01:00
João Coelho
75b0264f35 fix various problems, thanks CppCheck :) (#1005)
* explained a bit more the core_window_letterbox example

* fixed a few 'ups' moments that could lead to mild head pain and time loss
2019-10-29 15:57:19 +01:00
Ray
d73abe73e5 REDESIGN: TextToUtf8()
ADDED: CodepointToUtf8()
2019-10-28 20:53:32 +01:00
Ray
f6df47dfe5 ADDED: TextToUtf8() -WIP-
RENAMED: TextCountCodepoints() -> GetCodepointsCount()
2019-10-27 23:56:48 +01:00
Ray
06910eedfd Minor comment tweak 2019-10-22 23:15:26 +02:00
Ray
ca92f43c27 Review some defines 2019-10-22 00:37:10 +02:00
Ray
ab52f98480 Update text.c 2019-10-21 17:37:47 +02:00
Ray
b75511248d Remove trailing spaces 2019-10-17 17:18:03 +02:00
Ray
e40c26dea5 REVIEWED: GetCodepoints() issue
- Improved LoadBMFont()
2019-10-17 17:07:09 +02:00
Ray
7baa2975ec REDESIGNED: IsFileExtension()
Now it accepts a ';' separated list of extensions, useful to check multiple extensions
2019-10-11 20:13:11 +02:00
Ray
e0cb892d2d ADDED: GetCodepoints()
Get the unicode equivalent characters (as int array) from a UTF-8 text array... maybe this function is renamed to be clearer to users...
2019-10-11 20:12:15 +02:00
Ray
e67c842faa Tweak on atlas size computing
Some generated fonts were not fitting the image...
2019-08-24 20:03:47 +02:00
Ray
2f42b0ce85 REVIEW: TextSplit()
Just adding a security check
2019-08-19 15:09:54 +02:00
Ray
b4d67499a7 BREAKING CHANGE: Read description
Changes:

 - Font structure has been redesigned, CharInfo structure contained character rectangle within font texture, it has not much sense, considering that it was an information relative to the font atlas generated and not the character itself, so character rectangles have been moved out from CharInfo to Font.
 - CharInfo included a data parameters to contain character pixel data (usually grayscale), generated on TTF font generation. It was inconsistent with other fonts types, so, now CharInfo includes directly an Image of the glyph.
 - REDESIGNED: GenImageFontAtlas(), additional recs parameter added, loaded and filled inside the function to export atlas characters rectangles, instead of silently modify the input CharInfo data.
 - REVIEWED: ImageTextEx(), funtion retrieved the font atlas image from the GPU, that was slow and problematic in several platforms. Now it uses directly the CharInfo image. Support for unicode codepoints has also been added.
 - REDESIGNED: ImageDraw(), now it includes an additional parameter, the color tint, not only it could be useful for several situations but also function signature is more consistent with similar functions.
 - ADDED: ImageFromImage() to generate a new image from a piece of another image.
 - REVIEWED: GetNextCodepoint(), renamed parameters to be more clear.

Also all examples and games that were affected by those changes have been reviewed.
2019-07-24 15:05:14 +02:00
Ray
632d064b21 Review text functions return value
It needs to be freed
2019-07-22 21:29:50 +02:00
Ray
1b249ac1e1 Define some globals 2019-06-19 15:43:35 +02:00
Ray
f951f0c536 RENAMED: LoadDefaultFont() -> LoadFontDefault()
Renamed internal function for consistency with similar functions.
2019-06-16 23:42:51 +02:00
Ray
d21422687a Some formatting tweaks 2019-06-16 23:36:04 +02:00
Demizdor
509d9411a1 Fixed DrawTextRecEx() selection when wordwrap is ON 2019-05-10 13:57:24 +03:00
Ray
528e164ac5 Corrected issue with wrong text measuring 2019-05-06 10:17:34 +02:00
Demizdor
86f9ea6e7a Fixed selection in DrawTextRecEx() 2019-04-24 22:08:57 +03:00
Ray
e67ebabb02 Support custom memory management macros
Users can define their custom memory management macros.

NOTE: Most external libraries support custom macros in the same way, raylib should redefine those macros to raylib ones, to unify custom memory loading. That redefinition is only implemented as example for stb_image.h in [textures] module.
2019-04-23 14:55:35 +02:00
Demizdor
f3a5a6871d Initial unicode implementation for UTF8 encoded text 2019-04-21 12:27:46 +03:00
Ray
b8ada4b877 Review creation years 2019-04-08 12:25:13 +02:00
ChillerDragon
f21761fbbb Happy new year 2019 2019-04-07 17:49:12 +02:00
Ray
36fa0207f2 Some spacing review 2019-02-28 23:06:37 +01:00
Skabunkel
a90c9c5ade Removed unnecessary 2019-02-28 17:50:47 +01:00
Skabunkel
fc11b360af ... tabs again... _facepalm_ 2019-02-24 01:57:31 +01:00
Skabunkel
03f7483537 Missed one 2019-02-24 01:56:17 +01:00
Skabunkel
f2d5cddfc8 Fixed segmentation fult created by quick fix 2019-02-24 01:48:29 +01:00
Skabunkel
374b4d3faf Tabs to spaces 2019-02-24 00:17:54 +01:00
Skabunkel
795c5e949d #764 - Quick fix that clears alot of memory, there seems to be more hiding somewhere else. 2019-02-24 00:13:50 +01:00
Ray
374811c440 Change ternary operator formatting 2019-02-22 13:13:11 +01:00
Ray
8382ab9ada
Merge pull request #761 from Demizdor/master
Fixed height bug in DrawTextRecEx()
2019-02-22 12:15:19 +01:00
Ray
a886f5e743 Remove TABS 2019-02-22 12:12:21 +01:00
Demizdor
40a76cf021 Fixed height bug in DrawTextRecEx() 2019-02-22 12:27:20 +02:00
Ray
641895b5ba Remove end-line spaces 2019-02-21 18:45:19 +01:00
Jens Pitkanen
f9963d4ed4 Fix config.h flags 2019-02-14 13:52:18 +02:00
Ray
6dbec47488 Redesigned TextSplit() function 2019-02-11 18:02:32 +01:00
Jak Barnes
1e15616b69 Fixed as issue where strrchr in LoadBMFont would only look for forward slashes, instead of backslashes causing strlen to fail on a null string 2019-02-10 16:01:44 +00:00
Ray
7615512af1 ADDED: TextToInteger()
Custom implementation that returns -1 if it fails (no negative values supported)
2019-02-06 14:20:14 +01:00
Ray
5755c5e310 Review DrawTextRecEx() formatting 2019-02-04 09:57:02 +01:00
Ray
01ace743d0
Merge pull request #734 from Demizdor/master
Added DrawTextRecEx()
2019-02-03 20:47:13 +01:00
Rob Loach
90d5bb79e5
Fix font cannot be narrowed to type 'int'
Getting the following strict error....

```
src/text.c:117:105: error: constant expression evaluates to 2398692640 which
      cannot be narrowed to type 'int' [-Wc++11-narrowing]
...0x00000000, 0x00000000, 0x00200020, 0x0001b000, 0x00000000, 0x00000000, 0x8ef92520, 0x00020a00...
                                                                             ^~~~~~~~~~
```

Switching it to an unsigned int fixes it.
2019-01-23 22:28:10 -05:00
Demizdor
6f66425946 Added DrawTextRecEx() 2019-01-23 21:36:54 +02:00
Ray
e91c84e33a Remove comment 2019-01-21 10:25:59 +01:00