summaryrefslogtreecommitdiffhomepage
path: root/src/rtext.c
AgeCommit message (Collapse)Author
2023-07-18ADDED: `SUPPORT_FONT_ATLAS_WHITE_REC`Ray
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-10Reviewed `rcamera`/`rgestures` file-macros for consistency #3161Ray
2023-07-06Reverted `MeasureTextEx()` change #3105Ray
2023-07-06REVIEWED: `GenImageFontAtlas()`, make atlas size less conservativeRay
2023-07-05Update rtext.cRay
2023-07-02REVIEWED: `TextToUpper()`, `TextToLower()`, `TextToPascal()`Ray
2023-07-02WARNING: BREAKING: ADDED: `SetTextLineSpacing()`Ray
2023-07-02REVIEWED: Issue #3105Ray
2023-05-18tweakRay
2023-05-01REVIEWED: Modules description layoutRay
2023-04-17Remove trailing spacesRay
2023-04-06REVIEWED: `GetGlyphIndex()` #3000Ray
2023-04-06[rtext] Fix GetCodepointNext() to return default value on invalid input with ↵chocolate42
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-03-22Review formatRay
2023-03-22Fix packing logic error in ```GenImageFontAtlas``` (#2979)Hanaxar
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-22Calculate exact image size in GenImageFontAtlas (#2963)Hanaxar
* Calculate exact image size in GenImageFontAtlas Calculate exact image size with a method based on total glyph width and glyph row count Current method seemed a little bit overkill with square root, log and power functions and only approximates image size which can be wonky with some weird fonts like cursive fonts. Proposed method calculates image size directly with a simpler method and results exact image size needed. * Update rtext.c * Update rtext.c Changed do-while to while loop, and also added an extra step to calculate maximum glyph width and excluding it from image width for extra safety.
2023-03-13Remove trailing spacesRay
2023-03-07REVIEWED: Data types validationRay
2023-02-24Update rtext.cRay
2023-02-22ADDED: Security checksRay
2023-02-09Fixed some grammar mistakes and typos. (#2914)Julio C. Galindo
* Fixed some grammar mistakes. * Fixed some typos.
2023-02-05Clean trailing spacesRay
2023-01-27ADDED: `IsShaderReady()`, `IsImageReady()`, `IsFontReady()`, ↵Rob Loach
`IsWaveReady()`, `IsSoundReady()`, `IsMusicReady()` (#2892) These IsReady() functions provide a method in order to verify whether or not the object was loaded successfully. They're useful to make sure the assets are there prior to using them.
2023-01-22Fix to use TRACELOG() instead of TraceLog() for internal modules (#2881)Rob Loach
There were a few raylib modules that continued to use TraceLog() instead of the TRACELOG() macro. This change ensures that all the internal raylib modules use the TRACELOG() pattern consistently.
2023-01-01Update year to 2023Ray
2022-11-28REVIEWED: Some compilation warnings (for strict rules)Ray
2022-10-03Update rtext.cRay
2022-09-22WARNING: Several changes on UTF-8/Codepoints APIRay
- ADDED: `GetCodepointPrevious()` - RENAMED: `GetCodepoint()` -> `GetCodepointNext()`, actually, reimplemented - `GetCodepoint()` has been kept for the moment, for compatibility and also because implementation is different - RENAMED: `TextCodepointsToUTF8()` to `LoadUTF8()`, simpler name and more aligned with raylib conventions (functions loading memory start with Load*()), parameters should be descriptive of functionailty. - ADDED: `UnloadUTF8()`, aligned with `LoadUTF8()` to avoid allocators issues.
2022-08-18REVIEWED: Avoid crash on bad data providedRay
2022-08-13Fix Codepoint position truncation (#2636)Dan Bechard
This truncation causes text that spans the zero coord boundary to round differently left or zero vs. right of zero, in turn causing letters to appear squished together. If you actually need the position to be an integer, you should instead `floorf()` the float, rather than doing an integer truncation, but I don't see any reason to convert it to an integer in the first place. Everything else in the equation is a float.
2022-08-02Remove trailing spacesRay
2022-07-29REVIEWED: `GenImageFontAtlas()` #2556Ray
Just reviewed font atlas size estimation, now it considers `fontSize` instead of `chars[i].image.height`, increasing considerably the atlas size estimation.
2022-06-24fix: precision loss, discard unused (#2541)veclavtalica
2022-06-17Changed ExportFontAsCode to use given font's padding. (#2525)The Tophat Demon
2022-05-29Correct typoRay
2022-05-29Review log messagesRay
2022-05-07Corrected typoRay
2022-05-01Reviewed some commentsRay
2022-03-29Update rtext.cRay
2022-03-01Increase atlas size guesstimate; print warnings if atlas size is too small ↵megagrump
(#2365)
2022-02-20REVIEWED: Some functions input parametes that should be `const`raysan5
2022-02-18Removed trailing spacesraysan5
2022-02-13Update rtext.cRay
2022-01-26Add DrawTextCodepoints (#2308)Siddharth Roy
* Add DrawTextCodepoints * Fixed top comment
2022-01-03ADDED: `ExportFontAsCode()`Ray
2021-12-31Update year to 2022raysan5
2021-12-28Detected some pixel-errors due to rounding issues on positionraysan5
2021-12-09REVIEWED: GetCodepoint() #2201Ray
2021-12-04Support custom modules inclusionRay
Allow to choose which modules are compiled with raylib, if some modules are excluded from compilation, required functionality is not available but smaller builds are possible.
2021-11-09Review variables initializationRay
- All variables are initialized on declaration, some arrays were not properly initialized - Static array buffers require memset() for re-initialization on every function call