You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: unspecified Reported for operating system, platform: All, All
Comments on the original bug report:
On 2019-02-20 16:56:39 +0000, Dmitry Gapkalov wrote:
Created attachment 3641
patch
/* Get the measurement string of text without rendering
in:
width - in pixels to measure this text
out:
result - latest position in text inside width
extent - latest calculated width(more or equal to width)
*/
extern DECLSPEC int SDLCALL TTF_MeasureText(TTF_Font *font, const char *text, int width, int *extent);
extern DECLSPEC int SDLCALL TTF_MeasureUTF8(TTF_Font *font, const char *text, int width, int *extent);
extern DECLSPEC int SDLCALL TTF_MeasureUNICODE(TTF_Font *font, const Uint16 *text, int width, int *extent);
On 2019-02-22 14:17:21 +0000, Sylvain wrote:
Hey, thanks for the patch !
So this function gives the maximum of char that can fit in 'width' pixel.
Just wondering, why is this function needed ?
It seems like re-doing the SDL_ttf Wrap function ?
On 2019-02-22 16:12:15 +0000, Dmitry Gapkalov wrote:
For algorithm like:
auto add "..." in the end of the line
auto-text height for specific bounds
SDL_ttf Wrap spend time for rendering text, but need calculation
first.
On 2019-02-22 18:55:16 +0000, Dmitry Gapkalov wrote:
Created attachment 3650
updated patch
updated version of patch
On 2019-02-22 20:06:16 +0000, Sylvain wrote:
Not sure I got it, so I've more questions:
If you want to add "...", why don't you string cat it as a suffix ? Then render ?
"- auto-text height for specific bounds", you mean a Wrap function with user defined height ?
-> that would be a TTF_SetLineSkip() ?
On 2019-02-25 16:14:40 +0000, Dmitry Gapkalov wrote:
If you want to add "...", why don't you string cat it as a suffix ? Then render ?
I have maximum width(in pixels) and font size, I need put text, and if some text not included, I need to put '...' in the end of the line. I need to calculate how many symbols I can put before "...".
"- auto-text height for specific bounds", you mean a Wrap function with user defined height ?
-> that would be a TTF_SetLineSkip() ?
Wrapped function in SDL is just for simple text rendering. It not cover real cases like html-css view.
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: unspecified
Reported for operating system, platform: All, All
Comments on the original bug report:
On 2019-02-20 16:56:39 +0000, Dmitry Gapkalov wrote:
On 2019-02-22 14:17:21 +0000, Sylvain wrote:
On 2019-02-22 16:12:15 +0000, Dmitry Gapkalov wrote:
On 2019-02-22 18:55:16 +0000, Dmitry Gapkalov wrote:
On 2019-02-22 20:06:16 +0000, Sylvain wrote:
On 2019-02-25 16:14:40 +0000, Dmitry Gapkalov wrote:
On 2019-03-25 13:59:56 +0000, Sylvain wrote:
On 2019-04-12 14:53:04 +0000, Dmitry Gapkalov wrote:
On 2019-04-12 19:34:22 +0000, Sylvain wrote:
On 2019-04-12 19:53:48 +0000, Dmitry Gapkalov wrote:
On 2019-04-22 17:42:40 +0000, Dmitry Gapkalov wrote:
On 2019-04-23 12:21:25 +0000, Sylvain wrote:
The text was updated successfully, but these errors were encountered: