raysan5 / raylib

A simple and easy-to-use library to enjoy videogames programming
http://www.raylib.com
zlib License
21.67k stars 2.19k forks source link

[rcore] Incorrect line height when drawing text with line breaks #4315

Closed greenya closed 1 week ago

greenya commented 1 week ago

Issue description

Incorrect spacing between text lines when rendering text with line breaks using different font sizes.

Issue Screenshot

image

Code Example

I will refer to this source https://github.com/raysan5/raylib/blob/master/examples/core/core_custom_frame_control.c . So it has drawing text with "\n" inside using default font. We repeat the line 3 times:

Environment

INFO: Initializing raylib 5.0
INFO: Platform backend: DESKTOP (GLFW)
....
INFO: GL: OpenGL device information:
INFO:     > Vendor:   Apple
INFO:     > Renderer: Apple M1
INFO:     > Version:  4.1 Metal - 88.1
INFO:     > GLSL:     4.10
....
INFO: PLATFORM: DESKTOP (GLFW): Initialized successfully
raysan5 commented 1 week ago

@greenya This is the expected behaviour, line height is up to the user, use SetTextLineSpacing() to set it.