wwrap flag separates words and punctuation

Posted By: Zelek

wwrap flag separates words and punctuation - 12/09/08 01:54

When wwrap is enabled for a text, if the last character that doesn't fit is a punctuation mark (period, comma, etc), it will be moved to the next line apart from the word that precedes it. This doesn't seem to be correct wwrap behavior. You get texts like this:
Quote:
This is a test string
.


Full source code:
Code:
#include <acknex.h>
#include <default.c>

FONT* arial_font_24_b = "Arial#24b";

TEXT* test_txt = {
   string ("this is a test string;");
   font = arial_font_24_b;
   size_x = 180;
   flags = WWRAP | VISIBLE;
}

function main() {
   level_load("TestProject.wmb");
}

Posted By: jcl

Re: wwrap flag separates words and punctuation - 12/09/08 10:53

Yes, that's true. However the Truetype font functions, including word wrap, are provided by Windows - so I believe there's nothing we could do about it. For getting a different result, you could split and wrap the text yourself.
Posted By: Zelek

Re: wwrap flag separates words and punctuation - 12/09/08 14:24

That's really unfortunate. I was hoping to rely on this new flag for a large number of dynamically constructed strings in my text objects. I'd rather not spend time writing my own word-wrap functionality, if possible.

I haven't seen word-wrap behave this way anywhere else in Windows. Keeping the punctuation with the preceding word seemed like standard behavior. frown
© 2024 lite-C Forums