Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#4 WriteTextWrapped-string end CRLF garbage

Joe Rykowski

Have run into a minor glitch however when displaying
with the WriteTextWrapped function... the issue is
specifically with a string that ends with a CRLF
(#13#10). Apparently the logic ends up parsing into
"unknownterritory" and displaying odd characters at end
of text area (random
garbage with whatever might be after the actual string

My simple work around has been to append a space
character to end of string before calling the
WriteTextWrapped function, and that circumvents the
issue. The problem itself has to do with how the
ReadWord function only handles checking for CR (#13) or
a space (' '), but doesn't handle an End Of Line (EOL
#13#10). I checked the code, and that definately is
the issue... Also, keep in mind that on Linux an EOL is
just #10 and not #13#10.

The fix may be to check for #10 in addition to just a
#13 and ' ' in the ReadWord function when checking for
end of word? (I have not had a chance to get back to
this issue - my work around solved the problem for me,
but a more permanent solution in the SDLMonoFonts code
would be best...)


    • assigned_to: nobody --> savage
  • Logged In: YES

    I was not able to reproduce this bug with CRLF line endings.
    It seems that as long as the line endings are Windows-style
    (CRLF, #13#10), everything should always be OK. What are the
    exact parameters to WriteTextWrapped to reproduce this bug ?

    I guess that you can set this request to pending now and
    have it closed if noone will be able to reproduce this bug

    As for UNIX line endings (#10) or Mac line endings (#13),
    this is indeed a bug, SDLMonoFonts indeed is not able to
    handle them. I just send a patch to JEDI-SDL mailing list to
    fix this, see thread "SDLMonoFonts fixes" on JEDI-SDL
    mailing list around 2006-01-08.

  • Logged In: YES
    Originator: NO

    Kambi's patch has been applied to this and it is checked into CVS.

    • status: open --> closed-fixed