nanogui: Thread: text align right


[<<] [<] Page 1 of 1 [>] [>>]
Subject: text align right
From: "Friedemann Leitenberger" ####@####.####
Date: 13 Dec 2007 13:57:58 +0000
Message-Id: <19adad510712130557v2b82ae79p7d0dee7ef776ae14@mail.gmail.com>

hi!

i have a question concerning the text alignment under nano-x.
is there a way to change the textalign dynamically to right?

i tried to calculate the x-offset with x-pos - GrGetGCTextSize(),
but the returned width was much longer then the text field!

...

char myString[15];

strcpy(myString, "This is a test\0");

GrText(window, gc, 100, 100, myString, -1, GR_TFASCII);

GR_SIZE retwidth, retheight, retbase;

GrGetGCTextSize(gc, myString, 14, GR_TFANTIALIAS, &retwidth, &retheight,
&retbase);

...

i'm using microwindows 0.90 and freetype 1.4.

can anybody please help me with this problem?

thanks!

friedemann
Subject: Re: [nanogui] text align right
From: "Greg Haerr" ####@####.####
Date: 14 Dec 2007 18:40:04 +0000
Message-Id: <012a01c83e80$bb34e100$0300a8c0@RDP>

: GrGetGCTextSize(gc, myString, 14, GR_TFANTIALIAS, &retwidth, &retheight,
: &retbase);

GR_TFANTIALIAS isn't a valid flag for GrGetGCTextSize, this
is probably being interpreted as a text encoding type, and
since its value is 2, nano-X thinks you're passing a UC16 string.
Pass GR_TFASCII instead.  Antialiasing doesn't change
the size of the text box returned.  (at least at this point!)

Regards,

Greg

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.