Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testapp: allow to render text with SDL_TextEngine (key 'x') #394

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

1bsyl
Copy link
Contributor

@1bsyl 1bsyl commented Oct 3, 2024

@slouken
this allow to use testapp with textengine and compare none/surface/renderer

allow, it seems "TE renderer" asserts with:

Assertion failure at CreateDrawSequence (//SDL_ttf_git/src/SDL_renderer_textengine.c:540), triggered 1 time:
  'num_ops > 0'

while "TE surface" doesn't assert

examples/testapp.c Outdated Show resolved Hide resolved
@slouken
Copy link
Collaborator

slouken commented Oct 3, 2024

This seems fine, but can you give me a standalone repro for the num_ops assertion?

@1bsyl
Copy link
Contributor Author

1bsyl commented Oct 3, 2024

@slouken
it seems this happens with the first rendering of testapp :
fonts/FletcherGothicFLF.ttf
and this is string in test_strings[0]

just do ./testapp and press x x and it asserts.
you need the fonts file also in "./fonts/FletcherGothicFLF.ttf"

@slouken slouken merged commit e26295b into libsdl-org:main Oct 3, 2024
5 checks passed
@slouken
Copy link
Collaborator

slouken commented Oct 4, 2024

I'm not reproducing this with the current head. Has it been fixed?

@1bsyl
Copy link
Contributor Author

1bsyl commented Oct 4, 2024

@slouken
this is still present in current HEAD.
renderer_surface would also assert, but the is no "SDL_assert(num_ops > 0);"

after, Render_Line_TextEngine num_ops is still 0

Render_Line_TextEngine:
pos_len is 4. The 4 glyphs are found, but widths and rows are 0. o no increment `op_index++

( glyph->sz_width == glyph->sz_rows == 0
and also last glyph_width == glyph_rows == 0 )

the string is of course wrong because testapp is meant to break rendering with corner case.
I compile with SDL_ttf:

CMAKE_FLAGS+=" -DSDLTTF_VENDORED=ON "
        CMAKE_FLAGS+=" -DSDLTTF_HARFBUZZ=ON "

@slouken
Copy link
Collaborator

slouken commented Oct 4, 2024

I'm not seeing this here at all. Maybe my version of the font is different? Can you create an issue and provide a modification to showfont and attach a link to the font you're using so I can repro in a debugger?

@1bsyl
Copy link
Contributor Author

1bsyl commented Oct 4, 2024

./showfont -textengine renderer fonts/FletcherGothicFLF.ttf 20 "纸"

@1bsyl
Copy link
Contributor Author

1bsyl commented Oct 4, 2024

then font I have FletcherGothicFLF.ttf.txt

@1bsyl
Copy link
Contributor Author

1bsyl commented Oct 4, 2024

@slouken here it is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants