Commit Graph

92 Commits

Author SHA1 Message Date
Ray
fea3395fc1 Review formatting 2024-02-29 18:50:44 +01:00
Ray
e42e3188f5 Remove some unneeded line breaks 2024-02-18 11:59:40 +01:00
Ray
401c5a8638 Minor tweaks to avoid some CodeQL warnings 2024-02-13 15:58:02 +01:00
Ray
bb741f53a8 Update rtext.c 2024-02-13 10:43:24 +01:00
6280771dad [rtext] Change strcpy to strncpy to fix buffer overflow (#3795) 2024-02-13 10:38:13 +01:00
Ray
e9291fa4c7 Update rtext.c 2024-02-04 22:50:54 +01:00
Ray
868d515fbc Update rtext.c 2024-02-04 11:18:46 +01:00
Ray
eed56a45d6 REVIEWED: LoadFontDataBDF() name and formating 2024-02-04 11:10:46 +01:00
0932cd3059 [rtext] Add BDF font support (#3735)
* Add BDF font support

* Include font ascent in glyph y-offset when loading BDF font
2024-02-03 19:28:12 +01:00
c0b081fac0 Fix MeasureTextEx() height calculation (#3770) 2024-02-01 21:14:22 +01:00
cb97a8063d [rtext.c] fixing some comments to align comments style (#3756) 2024-01-22 23:15:25 +01:00
2c124c96df [rtext] Adjust font atlas area calculation so padding area is not underestimated at small font sizes. (#3719) 2024-01-10 21:34:04 +01:00
Ray
3f1e59a7cf Update copyright to 2024 2024-01-02 20:58:12 +01:00
5b5a2d035d Fix TextReplace warning for const (#3687) 2023-12-28 23:13:47 +01:00
7cfdf33ff0 TextReplace const correctness (#3678)
* TextReplace const correctness

* cleanup
2023-12-28 20:09:49 +01:00
9de79861ea BM Font Extender (#3536)
* loadbmfont

* bmfontextender

* bm font

* Modify LoadBM Font

* Delete loadbmfontex.diff

* REVIEWED: `LoadBMFont()` PR

* Update rtext.c

* Update rtext.c

---------

Co-authored-by: Dongkun Lee <hope81dklee@outlook.com>
Co-authored-by: Ray <raysan5@gmail.com>
2023-12-15 18:32:01 +01:00
6083d2b9f3 fixed coding style in function TextToFloat (#3627)
* function to convert string to float

* fix code to match coding conventions
2023-12-13 21:20:13 +01:00
Ray
731b210f51 REVIEWED: WARNING: LoadFontData() avoid fallback glyphs
This is a redesign on font loading, missing glyphs are skipped instead of falling back to font `.notdef` special character (usually "tofu" character).
It is changed because not all fonts support a fallback glyph.
One improvement could be allowing users to define a custom fallback character, for example `?` glyph.
2023-12-04 17:32:55 +01:00
Ray
a016b4ded2 REVIEWED: LoadFontData(), load image only if glyph has been found in font 2023-12-03 20:17:16 +01:00
Ray
64d64cc181 REVIEWED: Potential code issues reported by CodeQL #3476 2023-11-01 15:28:18 +01:00
Ray
e4547eb422 Remove trail spaces 2023-10-26 23:56:03 +02:00
Ray
99ede0f747 Added some notes for alternative implementations #3362 2023-10-17 11:09:56 +02:00
Ray
876e6b3a0d REVIEWED: TextFormat(), added "..." for truncation #3366
It seems more standard than [TRUN]
2023-10-11 20:25:09 +02:00
Ray
61af8e7631 REVIEWED: #3399, Fix #3366 2023-10-11 12:20:03 +02:00
28fb58f0ea [rtext] TextFormat() warn user if buffer overflow occured. (#3399)
* [rtext] TextFormat now alerts user to truncation.

* Update rtext.c

* Update rcore.c

* Update rtext.c
2023-10-11 12:15:40 +02:00
Ray
e75f85ce58 REVIEWED: TextToPascal() issue when first char is uppercase 2023-09-11 19:01:24 +02:00
Ray
10e4aa32f8 Update rtext.c 2023-09-08 20:01:19 +02:00
Ray
9cce5a93ff Fix #3293 2023-09-05 20:04:21 +02:00
Ray
75e5cd86d7 Use internal default allocators, instead of user-exposed ones 2023-09-02 12:58:47 +02:00
Ray
0f447f1fb6 REVIEWED: Data size type consistency between functions #3168 2023-09-02 12:05:34 +02:00
Ray
ec6d3bb688 RENAMED: LoadFont*() parameter names for consistency and coherence 2023-09-01 23:23:01 +02:00
a86c93ebc0 Ignore unused return value of GetCodepointNext in GetCodepointCount (#3241)
* Ignore unused return value of GetCodepointNext in GetCodepointCount

Removes the last warning from non-external libraries when compiling with
the default build configuration on x64 Linux.

* Remove unnecessary void cast in GetCodepointCount
2023-08-15 00:09:27 +02:00
Ray
93f59a6f59 Review tabs and trail-spaces 2023-08-10 22:47:17 +02:00
0959f6ebf6 fix typos in rmodels, rshapes, rtext modules (#3236) 2023-08-10 00:21:14 +02:00
90f1749965 Ignore unused function warnings from external headers when compiling with GCC and Clang (#3235) 2023-08-09 19:17:12 +02:00
Ray
52541b4a1f ADDED: SUPPORT_FONT_ATLAS_WHITE_REC
Support creating a 3x3 pixels white rectangle at the bottom-right corner of the generated font atlas image, useful for shapes+text drawing in a single draw call!
2023-07-18 17:57:10 +02:00
Ray
0b9fae3c53 Reviewed rcamera/rgestures file-macros for consistency #3161 2023-07-10 19:13:44 +02:00
Ray
685d47938b Reverted MeasureTextEx() change #3105 2023-07-06 12:31:01 +02:00
Ray
668b37e111 REVIEWED: GenImageFontAtlas(), make atlas size less conservative 2023-07-06 12:29:28 +02:00
Ray
58bd10edb2 Update rtext.c 2023-07-05 18:36:54 +02:00
Ray
4fc5e82e30 REVIEWED: TextToUpper(), TextToLower(), TextToPascal() 2023-07-02 11:10:42 +02:00
Ray
3e4e4b32fd WARNING: BREAKING: ADDED: SetTextLineSpacing() 2023-07-02 10:52:20 +02:00
Ray
48e2663d03 REVIEWED: Issue #3105 2023-07-02 10:51:39 +02:00
Ray
51387dfbfb tweak 2023-05-18 16:14:18 +02:00
Ray
7d68aa6869 REVIEWED: Modules description layout 2023-05-01 14:04:22 +02:00
Ray
9d38363e09 Remove trailing spaces 2023-04-17 12:18:06 +02:00
Ray
d8c7b01a3c REVIEWED: GetGlyphIndex() #3000 2023-04-06 12:49:59 +02:00
8367abad1a [rtext] Fix GetCodepointNext() to return default value on invalid input with size=0 (#2997)
* Fix GetCodepointNext to return default value with size=0 on invalid input. Modify LoadCodepoints to work when GetCodepointNext returns a size of 0. All internal use of GetCodepointNext and GetCodepointPrev checked. This fix may break external code dealing with invalid input as the old code erroneously never returned a size of 0, external code that doesn't properly check for size=0 may endlessly loop or overflow a buffer on invalid input.

* Change default behaviour of GetCodepointNext to return a size of 1 instead of 0. This matches existing prod behaviour and guarantees size 1..4 is returned. Simplify internal code that uses GetCodepointNext that previously had to account for size=0.

* Simplified progressing through a UTF-8 string in ImageTextEx and MeasureTextEx. This change matches existing precedent in DrawTextEx

* GetCodepointNext: Add 10xxxxxx checks to multibyte encodings.

---------

Co-authored-by: anon <anon>
2023-04-06 12:34:37 +02:00
Ray
ecb6a6af32 Review format 2023-03-22 11:08:46 +01:00
e55bdd5d8a Fix packing logic error in ``GenImageFontAtlas`` (#2979)
Basic packing algorithm currently follows this order: Copy pixel data -> Move offsetX for current glyph -> Check remaining space for current glyph...
Since X offset already moved according current glyph, remaining space should be checked for next glyph. Because of this, occasionally, current logic causes glyphs wrapping around texture.
Proposed fix accomplishes that by moving offsetX check to the beginning of the loop.
2023-03-22 11:00:13 +01:00