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
raysan5
1038e79b36
Corrected issue with text measure on Latin-1 chars
...
Considering chars inputs come in UTF8 form!
2019-01-05 15:04:18 +01:00
raysan5
0619571149
ADDED: DrawTextRec() and example
2018-12-29 14:44:28 +01:00
raysan5
01338b0a14
WARNING: BREAKING CHANGE
...
Added a bunch of useful text management functions.
Consequently, some already available functions like `FormatText()` and `SubText()` has been renamed for consistency. Created temporal fallbacks for old names.
raylib version bumped to 2.3.
2018-12-26 13:26:34 +01:00
raysan5
96207a8a02
REVIEWED: LoadFontEx()
...
Changed parameters order for consistency with LoadFontData() and other functions when an array is passed by parameter and array size is the following parameter.
2018-12-25 15:17:42 +01:00
Ray
87ad244ee0
Exposed LoadFontFromImage()
2018-12-20 12:58:27 +01:00
Ray
f822650a3b
Support externally provided compilation flags
...
Useful in case raylib compilation want to be automated and compilation config flags provided by command line.
2018-12-18 00:20:08 +01:00
Ray
7361ed24e2
Added support for .otf fonts
...
stb_truetype supports some .otf fonts, just exposed that functionality.
2018-12-10 00:29:52 +01:00
Ray
a8ac6e2ef9
Increase text management buffers size
2018-12-04 13:15:42 +01:00
Ray
fc1c9505ba
Remove end-line spaces
2018-11-06 15:10:50 +01:00
Ray
298203a41a
ADDED: Some functions...
...
text: IsEqualText() -WIP-
audio: SaveWAV()
audio: ExportWaveAsCode()
textures: ExportImageAsCode()
2018-10-29 16:18:06 +01:00
Ray
72431c6c36
Code tweaks
2018-10-24 13:45:17 +02:00
Ray
550dd40cb3
ADDED: SplitText() function
2018-10-23 15:43:19 +02:00
Ray
3b674cd281
Some security checks on font loading
2018-10-18 17:48:33 +02:00
Ray
764766bfb2
Some formatting tweaks
2018-10-18 16:00:11 +02:00
noshbar
ec6b21bd91
Fixes memory leak in text.c
...
GenImageFontAtlas() allocates an array of stbrp_rect for the packing functions, but it never frees them.
2018-10-10 22:41:20 +02:00
Ray
ec5c9686b3
Improved data export capabilities!
...
REVIEWED: ExportImage()
REVIEWED: ExportMesh()
ADDED: ExportWave()
REMOVED: Internal funcs: SavePNG(), SaveBMP()
NOTE: These changes break the API (parameters order)
2018-09-17 16:56:02 +02:00
Ray
5b09630d45
Update mini_al to v0.8.8
...
Some minor tweaks around
2018-09-14 12:47:31 +02:00
Ray
dfb8837c46
Support aliased font texture generation
...
Useful for bitmaps pixelated fonts where anti-aliasing is not desired!
Change also enables additional font generation mechanisms in a future (cleartype, hinting...).
2018-09-06 16:56:21 +02:00
Ray
d0608b031a
Corrected issue with types
2018-09-05 10:47:40 +02:00
Ray
b042fe12e6
Reviewed spacings on latest PR
2018-08-06 20:49:47 +02:00
Kim Kulling
ecf8bff4aa
Fix compiler warnings, first part
2018-08-04 10:32:16 +02:00
Ray
292499bdeb
Reviewed LoadFontData() and GenImageFontAtlas()
2018-07-15 20:03:05 +02:00
raysan5
103bc7dfc6
Corrected issue with GetFontDefault()
...
Note for me: Replace All is NOT your friend...
2018-07-05 19:17:06 +02:00
raysan5
d881c73257
Renamed GetDefaultFont() to GetFontDefault()
...
Library consistency rename... yes, I know, it breaks the API...
2018-07-05 19:08:24 +02:00
Ray
afe81d94ce
Re-added: LoadFontEx()
2018-06-30 19:58:44 +02:00
Ray
0e135118fd
Improved GenImageFontAtlas()
2018-06-21 00:18:13 +02:00
Ray
75ba5aca55
Improved font generation and SDF
...
Added: data to CharInfo struct
Added: LoadFontData()
Added: GenImageFontAtlas()
Removed: LoadFontEx()
Removed: LoadTTF() [internal]
Some code tweaks
2018-06-20 00:52:14 +02:00
raysan5
559b9b8cc3
Corrected possible memory leak
2018-05-21 18:57:54 +02:00
raysan5
25d5e907ec
Some code review (mainly comments)
2018-05-20 00:37:16 +02:00
Ray
2aae62cea2
Header tweak and comments
2018-05-17 00:04:36 +02:00
Ray San
ec33e7d705
BREAKING CHANGE: Renamed SpriteFont type to Font
...
- Preparing MP3 files support
- Jumped version to raylib 2.0-dev (too many breaking changes...)
2018-05-04 16:59:48 +02:00
Ray San
6324697ffd
Rectangle parameters changed to float
...
- Some examples tweaks
- Reviewed ImageFormat()
- Use float for text fontSize
2018-05-04 16:25:31 +02:00
Ahmad Fatoum
1841afad11
Refactor all #define SUPPORT_* into a config.h
...
That way, a user needs only to touch a single file to configure what
features raylib is built with.
Include guards are left out intentionally, because config.h should only
be included in source files, not headers.
Later on, config.h can also define the raylib version (#461 ).
2018-04-07 23:37:48 +02:00
Ahmad Fatoum
80bf636f81
Don't exceed signed int range when shifting left
...
Fixes UB in #489 , found by UBSan.
2018-02-25 03:17:57 +01:00
Ahmad Fatoum
76aca9b0d1
Fix possible buffer overflow in LoadBMFont
...
Width specifier doesn't include NUL terminator.
Fixes #487 found by AddressSanitizer.
2018-02-25 03:03:37 +01:00
raysan5
4492a70a4b
Support UTF8 basic characters on ImageTextEx()
...
Supported UTF8 range equivalent to [128..255] (80h..FFh)
Exposed and renamed text function GetGlyphIndex()
Renamed spriteFont parameter name to simply font
Small security check on transmission mission ending screen
2018-02-18 18:07:57 +01:00
Ray
8af5f9dfe0
Avoid rendering SPACE character!
2018-02-12 11:25:00 +01:00
Ray
1ce8c80de9
Corrected several issues...
2018-01-28 16:52:18 +01:00
Ray San
00c34a035c
Updated copyright year
2017-12-20 12:37:08 +01:00
user
54587d7fdb
proper if-clauses for disabling functionality in text.c
2017-12-14 11:41:31 +01:00
Ray
a6f9cc5629
Remove rres support
...
Let the user choose if using rres external library
2017-12-11 11:55:02 +01:00
Ray San
3d755d617a
Some code tweaks...
2017-11-02 20:08:52 +01:00
Ray
cbe0dcedfe
Corrected issue with ttf font y-offset
2017-10-25 00:30:58 +02:00
raysan5
12cb3afd9e
Added function DrawRectangleGradientEx()
...
Moved function DrawRectangleT() from text module to shapes
Added some comments
2017-08-27 21:02:24 +02:00
raysan5
88839b093c
Added function DrawRectangleT()
...
Usefult to draw rectangles using default font texture
2017-08-06 10:44:50 +02:00
raysan5
9f09f6f550
Rename enum LogType names...
...
...to avoid possible conflicting symbols
2017-07-02 12:35:13 +02:00
Ray
4c27412eff
Corrected issue #281
2017-05-09 09:33:32 +02:00
raysan5
b0f8ea27e3
Renamed function for lib consistency
...
LoadSpriteFontTTF() --> LoadSpriteFontEx()
2017-04-22 19:04:54 +02:00
Ray
ecfe31bf1d
Make TraceLog() public to the API
...
enum LogType could require some revision...
2017-04-21 00:08:00 +02:00
Ray
1f56e8e5d0
Minor code tweaks
2017-04-04 12:16:13 +02:00
Ray
080a79f0b0
Added IsFileExtension()
...
Replaced old GetExtension() function
Make IsFileExtension() public to the API
2017-03-29 00:35:42 +02:00
Ray
2f65975c5e
Remove RBMF fileformat support
2017-03-29 00:02:40 +02:00
Ray
b7a8a40e71
Work on configuration flags
2017-03-26 22:49:01 +02:00
Ray
2ac7b684b5
text: configuration flags
2017-03-21 13:22:47 +01:00
Ray
59652c75b4
Review some comments
2017-03-20 20:34:44 +01:00
raysan5
d1c9afd1d8
Work on timming functions...
...
It seems Sleep() behaves weird on my computer, disabled by default
returning to the busy wait loop... also re-implemented DrawFPS() to
avoid frame blitting...
2017-03-05 19:17:00 +01:00
Ray
05cff44d0a
Improved modules description -IN PROGRESS-
...
Working in modules configuration flags...
2017-02-16 00:50:02 +01:00
raysan5
afcd748fdf
Reviewed fread() usage around the code
2017-02-11 23:17:56 +01:00
Ray
734776b923
Commented code for review
2017-02-06 00:44:21 +01:00
raysan5
1a879ba08e
Refactor SpriteFont struct
...
Now it uses CharInfo data, this way, it's better aligned with the future
RRES file format data layout for sprite font characters.
2017-02-05 02:59:39 +01:00
Ray
c85dfd4bc6
Remove unecessary spaces...
2017-01-28 23:02:30 +01:00
Ray
b681e8c277
Implemented Wait()
...
Now program is halted (OS signal call) for required amount of time every
frame, so CPU usage drops to zero, instead of using a busy wait loop.
2017-01-28 00:56:45 +01:00
raysan5
61f6b0f707
Removed GetNextPOT(), review TraceLog()
2017-01-15 01:10:23 +01:00
raysan5
e7464d5fc3
Review some formatting and naming
...
- Renamed WritePNG() to SavePNG() for consistency with other file
loading functions
- Renamed WriteBitmap() to SaveBMP() for consistency with other file
loading functions
- Redesigned SaveBMP() to use stb_image_write
2016-12-27 17:37:35 +01:00
raysan5
852f3d4fd0
Review comments and formatting
2016-12-25 02:01:13 +01:00
Ray
377dcb025f
Corrected some warnings
2016-12-05 01:14:18 +01:00
raysan5
481ce3d39d
Corrected bug with alpha mask on font
...
Mask was wrongly applied to 8-bit font image, it generated dark borders
on the font. Grayscale image has to be considered as the alpha mask for
a completely white image to use it correctly.
2016-11-21 19:47:58 +01:00
raysan5
6d1b712a96
Reviewed modules comments
2016-11-16 18:46:13 +01:00
Ray
38df2cad25
Improved text measurement
...
Still not working correctly, font offsets are not considered
correctly...
2016-11-13 23:53:28 +01:00
raysan5
aa945055fa
Corrected issue on chars drawing
...
Support by default unordered charsets
2016-11-03 18:57:46 +01:00
raysan5
6d3b11ef91
Support unordered charset, neither fixed first char
...
Still requires some testing...
2016-11-01 00:58:21 +01:00
raysan5
3393fda384
Improve TTF loading
2016-10-31 20:39:30 +01:00
raysan5
cc917fbac6
Improve SpriteFont support
...
LoadSpriteFontTTF() - TTF font loading with custom parameters
2016-10-31 15:38:15 +01:00
raysan5
137057f499
Function added: GenSpriteFont()
2016-10-27 13:39:47 +02:00
raysan5
6d34adbd60
Improving sprite fonts support...
...
Support grayscale (8 bit) textures for fonts
Load unordered chars data above char 126
2016-10-24 19:11:29 +02:00
Ray
efa286a550
Allow no default font loading
...
Useful if text module is not required...
2016-10-09 13:09:08 +02:00
raysan5
7f0880a735
Review spacing formatting
...
raylib uses spaces between '+' and '-' signs but not between '*' and '/'
signs, it's a chosen convention
2016-09-12 19:36:41 +02:00
raysan5
a9ab516dae
Formatting tweaks
2016-08-31 10:27:29 +02:00
raysan5
f1c3f2870b
Added TraceLog info on image spritefont loading
2016-08-25 15:11:52 +02:00
raysan5
959a228815
Removed useless spacing
2016-08-16 11:09:55 +02:00
raysan5
ed387d00aa
Corrected issue with VS
2016-08-08 17:21:46 +02:00
raysan5
f69f930b51
Some functions review
2016-08-07 13:38:48 +02:00
raysan5
8fd4507847
Corrected bug on Raspberry Pi with strcat()
2016-07-06 20:02:15 +02:00
Ray
29d505c98e
Reorganize external libraries - BREAKING CHANGE -
...
Moved all external libraries used by raylib to external folder inside
raylib src. Makefile has already been update and also the different
includes in raylib modules.
2016-06-06 14:34:43 +02:00
Ray
17878550b1
Review heades usage
...
This is a first step toward a bigger project. Some modules could be
ported to header-only to be used as standalone.
2016-06-02 01:26:44 +02:00
raysan5
e94acf86f8
Reorganized internal funcs
2016-05-03 17:54:50 +02:00
raysan5
a167067cbd
Security check for unsupported BMFonts
...
- Check if first character is the expected Space char (32)
- Check if characters are ordered in definition file (.fnt)
2016-03-02 18:35:30 +01:00
raysan5
823abf666e
Reviewed code TODOs
2016-02-12 12:22:56 +01:00
raysan5
f98c4dc82b
Corrected bug on fonts loading
2016-01-18 12:04:54 +01:00
raysan5
fa057f512f
Improved fonts support
...
Added LoadBMFont() to load AngelCode fonts (.fnt)
Implemented LoadTTF() to load .ttf fonts (crappy packaging)
2016-01-02 10:45:51 +01:00
raysan5
da28cff0f6
Added function: SubText()
...
Useful to get a piece of text, could be used for text typing animations
2015-12-30 13:33:26 +01:00
raysan5
f144b6bae4
MeasureTextEx() - Added support for multi-line size measure
2015-12-09 20:57:50 +01:00
raysan5
b62f7c3057
Corrected bug
2015-12-09 20:21:58 +01:00
raysan5
85908befea
Corrected bug on spritefont loading
2015-12-03 13:44:45 +01:00
Ray
2fa7e00f16
Variables initialization
2015-11-05 12:28:45 +01:00
Ray
afdf357fbe
Added some image manipulation functions
...
Added (or completed functions):
Image ImageText(const char *text, int fontSize, Color color);
Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int
spacing, Color tint);
void ImageFlipVertical(Image *image);
void ImageFlipHorizontal(Image *image);
void ImageColorTint(Image *image, Color color);
void ImageColorInvert(Image *image);
void ImageColorGrayscale(Image *image);
void ImageColorContrast(Image *image, float contrast);
void ImageColorBrightness(Image *image, int brightness);
2015-10-25 01:50:15 +02:00
Ray San
f13b30d606
Feature: Line-break support for text
2015-10-21 18:24:44 +02:00
raysan5
e9792ef771
Convert to UTF-8
2015-10-06 17:32:00 +02:00
raysan5
9af10686b2
Added comments and more...
...
Corrected bug on defaultFont.size
Renamed funcs:
ImageConvertFormat() -> ImageFormat()
ImageConvertToPOT() -> ImageToPOT()
2015-10-06 17:17:53 +02:00
raysan5
4879106096
Reviewed to work on Raspberry Pi
...
[rlgl] Extensions strings loading was redone to avoid a Segmentation
Fault on Raspberry Pi
2015-09-02 01:08:41 +02:00
raysan5
92bcf09c53
Redesigned SpriteFont struct
2015-08-30 17:45:05 +02:00
raysan5
c52ba520ce
Small tweaks
2015-08-28 14:14:29 +02:00
Ray
a42bfa7794
Added trace log for data unloading
2015-08-05 19:17:56 +02:00
raysan5
7834a4e2fc
Replaced old mail by twitter user
2015-07-29 21:43:30 +02:00
raysan5
66556b8b47
Added some functions and renamed some others
...
Added:
- LoadImageRaw()
- ImageCopy()
Renamed:
- GetPixelData() -> GetImageData()
2015-07-13 18:19:29 +02:00
raysan5
c944d62374
Improved mipmaps support and image loading
2015-07-05 18:21:01 +02:00
Marc Palau
4c6c182023
Corrected gesture tap issue and text scaling issue
2015-06-03 17:04:17 +02:00
raysan5
a7714c842f
raymath module review and other changes
...
Complete review of matrix rotation math
Check compressed textures support
WIP: LoadImageFromData()
2015-05-11 00:15:46 +02:00