We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4374 - SDL_ttf test app + patches to apply to FreeType-2.9.1
Summary: SDL_ttf test app + patches to apply to FreeType-2.9.1
Status: WAITING
Alias: None
Product: SDL_ttf
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-09 15:38 UTC by Sylvain
Modified: 2018-12-13 16:04 UTC (History)
0 users

See Also:


Attachments
test app for SDL_ttf (24.62 KB, text/x-csrc)
2018-11-09 15:38 UTC, Sylvain
Details
fonts (9.36 MB, application/gzip)
2018-11-09 15:41 UTC, Sylvain
Details
test app for SDL_ttf (27.08 KB, text/x-csrc)
2018-11-13 10:07 UTC, Sylvain
Details
test app for SDL_ttf (27.17 KB, text/x-csrc)
2018-11-14 12:01 UTC, Sylvain
Details
test app for SDL_ttf (31.48 KB, text/x-csrc)
2018-11-26 15:09 UTC, Sylvain
Details
test app for SDL_ttf (36.81 KB, text/x-csrc)
2018-12-13 16:04 UTC, Sylvain
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvain 2018-11-09 15:38:50 UTC
Created attachment 3480 [details]
test app for SDL_ttf

Here's the console test app I've used for last bugs and also as a text rendering stress-test.

You can specify several fonts, strings, and interacts with the keyboard:
- press several times "space" and you go with all strings and render modes (solid,shaded,blended).
- use keyboard to: switch font, size, style, outline, kerning, hinting, wrap, etc. F1 for help!

I've added a few known broken strings and random strings. And also all fonts I found in SDL_ttf bug tracker (scalable/non-scalable. Extension .ttf, .fon, .pcf).

Press "r" for random (also "d" to turn off display-screen update) and it will render random configurations in an infinite loop.
All configurations are displayed in the terminal, so that if it crashes or exits, copy paste the log and it playback only that test. (If you're unlucky, you still have the possibility to re-use the random seed to replay the whole test suite).

It brokes Freetype twice. You can get errors as "Glyph not found".
Which are Freetype failing inside the Stroker without reporting it, then FT_Glyph_To_Bitmap failing.
It affects style named "outline" in SDL_ttf.

I've reported them and there are already two short fixes in head:
https://savannah.nongnu.org/bugs/?54976
https://savannah.nongnu.org/bugs/?54986

Those patch should probably be applied in SDL_ttf/external/freetype-2.9.1 for people re-build it.
(BTW, the current external/freetype-2.9.1 fails to autogen/configure on linux, is that normal ?,
 and I had to re-use the official distribution and also FT2 head).

Otherwise, I let it run for 20 hours and it renders 50.10^6 times without crashing.
(Remember all memory dst_checks get removed). Which means it looks very stable to me.
Comment 1 Sylvain 2018-11-09 15:41:33 UTC
Created attachment 3481 [details]
fonts

The fonts archive
Comment 2 Sam Lantinga 2018-11-13 01:02:47 UTC
Great! I'll leave this open for us to use for SDL_ttf regression testing.
Comment 3 Sam Lantinga 2018-11-13 01:05:12 UTC
I've applied the upstream fixes. Kudos!
https://hg.libsdl.org/SDL_ttf/rev/f08df1ebbf08
Comment 4 Sylvain 2018-11-13 10:07:23 UTC
Created attachment 3485 [details]
test app for SDL_ttf

Updated the test app with three defines so it can use:

HAVE_STREAM_TEXTURE_FUNCTION
(d to switch {render to surface, no render, render to texture})
Need patch to render to a streaming texture (bug 1399)

HAVE_SET_FONT_SIZE_FUNCTION
Need patch to set size dynamically (bug 2487)

HAVE_ALL_WRAPPED_FUNCTIONS
Need patch to have all wrapped functions (bug 4361)
Comment 5 Sylvain 2018-11-14 12:01:32 UTC
Created attachment 3493 [details]
test app for SDL_ttf

updates:
- correct missing to use of TTF_GetKerning() instead of TTF_GetFontHinting()
- better log message when changing size
Comment 6 Sylvain 2018-11-26 15:09:21 UTC
Created attachment 3505 [details]
test app for SDL_ttf

Some update:
q/e : wrap size -/+
g/h : hinting -/+ (normal, light, light_subpix, mono, none)
m   : render mode Solid/Blended/Shaded
F2   : save current rendering to .bmp


To try subpixel rendering:
- h -> hinting=light_supix
- m -> mode Blended or Shaded (but not solid)
- v -> change font to -> DejaVuSans.ttf (4th)
<space> change string to "iiiiiiiiii"

reduce/change size with up/down
Comment 7 Sylvain 2018-12-13 16:04:29 UTC
Created attachment 3546 [details]
test app for SDL_ttf

Update the test app to allow changing text colours and alpha