Commit Graph

162 Commits

Author SHA1 Message Date
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
raysan5
eae98e1c34 Big batch of changes, check description:
- Camera system moved to a separate module [camera.c]
- WIP: Added customization functions for camera controls
- Added custom shaders support on batch drawing
- Complete redesign of textures module to support multiple texture
formats (compressed and uncompressed)
2015-05-04 23:46:31 +02:00
raysan5
a632a04a30 Big batch of changes! Check description:
Support multiple texture formats (uncompressed and compressed)
Postprocessing shaders support
Model struct redefined and improved
Extended loading functions for Textures and Models
Simplified functions: DrawPlane(), DrawQuad()
Deleted functions: DrawPlaneEx(), DrawGizmoEx()
Now Text module only depends on Textures module
Shapes: Reviewed functions to low lines/triangles usage
Removed useless tabs and spaces around code
2015-04-06 14:02:29 +02:00
nicobwah
2b4a1f295a Added support for Latin-1 Supplement characters
Extended default raylib font system to support Latin-1 Supplement
characters
2015-03-09 17:13:42 +01:00
raysan5
b9e53cd135 Removed useless spaces 2015-02-02 00:53:49 +01:00
raysan5
874dc89fca Adding support for TTF fonts (in progress) 2015-01-18 10:58:04 +01:00
raysan5
905b6ec53d Added full support for HTML5 (emscripten)
Corrected some bugs on the way...
Automatically convert textures to POT on RPI and WEB
2014-12-31 18:03:32 +01:00
raysan5
cfa60ab7e6 Added support for emscripten and more
Added PLATFORM_WEB support (emscripten-webgl)
[audio] Added LoadSoundFromWave()
[textures] Added LoadTextureFromImage() to replace CreateTexture()
Some TraceLogs edited...
2014-12-15 01:08:30 +01:00
raysan5
7375d0460a Updated stb headers 2014-11-23 21:58:17 +01:00
raysan5
9d27bba23f Small Fixes Update (1.2.1)
View CHANGELOG for description on small fixes and add-ons
2014-10-17 21:11:58 +02:00
raysan5
fc6081fe70 raylib 1.2
This is a huge update. Check CHANGELOG for details
2014-09-16 22:51:31 +02:00
raysan5
c56ef738ed Explicit define of functions prototypes
No-parameters functions use the prototype style FunctionName(void);
2014-09-03 17:06:10 +02:00
raysan5
d2b98fbb5c Removed useless spaces 2014-09-03 16:51:28 +02:00
raysan5
0b03431c95 Update to version 1.1.1
Check CHANGELOG for a detailed list of changes
2014-07-23 00:06:24 +02:00