[prev in list] [next in list] [prev in thread] [next in thread]
List: xfree-render
Subject: [Render] Displaying strings after a character removal.
From: Zack Rusin <zackrat () att ! net>
Date: 2001-12-14 8:39:40
[Download RAW message or body]
Hi,
I hope you can help me with this ( yes, I realize that it's a somewhat
trivial problem, and I'm sorry for bothering you) :
I have a problem with rendering of a string from which a character has been
removed. I do the following: call XftTextExtents<8,16,32> with the default
string before the removal of the last character to get the initial width,
then I call XftTextExtents again this time only with the last character ( the
one that's being removed) to get its size. Now, as Keith's tutorial suggest I
do
top = y - glyph_info.y;
left = (x + initial_width - glyph.width) - glyph_info.x;
bottom = top + glyph_info.height + 1;/* without +1 it was missing the bottom
line*/
right = left + glyph_info.width;
Now I call XftDrawRect(draw,&c, left, top, right-left, bottom-top);
The y axis coordinates seem to be computed correctly for every glyph, but the
x axis coordinates are getting messed up after a couple of glyphs. Could
someone please help me with this? And if it's not too much trouble, could
someone also explain to me how would I correctly compute the y alignment so I
can move to the next line after a newline character has been detected?
Zack Rusin
--
Everyone is entitled to my opinion.
_______________________________________________
Render mailing list
Render@XFree86.Org
http://XFree86.Org/mailman/listinfo/render
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic