<p>hi lan,<br>I have checked out the latest git sources. Referring to the implementation of <br>XRenderCompositeString8 in libXrender, I try to implement xcb_render_composite_string_8<br>simply, but it does not work well.</p>
<p><code><br>typedef struct {<br> uint8_t len;<br> uint8_t pad1;<br> uint16_t pad2;<br> int16_t deltax;<br> int16_t deltay;<br>} xGlyphElt;</p>
<div>void<br>xcb_render_composite_string_8 (xcb_connection_t *dpy,<br> int op,<br> xcb_render_picture_t src,<br> xcb_render_picture_t dst,<br> const xcb_render_pictformat_t mask_format,<br> xcb_render_glyphset_t glyphset,
<br> int src_x,<br> int src_y,<br> int xDst,<br> int yDst,<br> const char *string, /* a list of xcb_render_glyph_t */<br> int nchar) /* number of xcb_render_glyph_t */<br>{<br>
int nbytes;<br> xGlyphElt *elt;<br> if (nchar)<br> {<br> nbytes = (nchar + sizeof(xGlyphElt) + 3) & ~3;<br> elt = (xGlyphElt *)malloc(nbytes);<br> elt->len = nchar;<br> elt->deltax = xDst;<br> elt->deltay = yDst;
<br> memcpy ((char *) (elt + 1), string, nchar);<br> }<br> xcb_render_composite_glyphs_8 (dpy,op,src,dst,mask_format,glyphset,</div>
<div> src_x,src_y,nbytes,(uint8_t *)elt);<br>}<br></code></div>
<p>I think the problem is how to convert a list of xcb_render_glyph_t to an array of bytes(glyphcmds).</p>
<div>Any suggestion to this will be of great help.</div>
<div> </div>
<div>jianjun<br> </div>
<div><span class="gmail_quote">On 10/11/06, <b class="gmail_sendername">Ian Osgood</b> <<a href="mailto:iano@quirkster.com">iano@quirkster.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>On Oct 11, 2006, at 2:29 AM, Yang JianJun wrote:<br><br>> Hi All,<br>><br>> Has anyone ever used "XCBRenderCompositeGlyphs"? and how to convert
<br>> XCBRenderGLYPH list to XCBRenderGLYPHITEM8 when rendering the<br>> glyphs. I am porting XRenderCompositeString to XCB. Thanks in advance.<br><br>First, we recently changed the naming convention for XCB 1.0 RC1, so
<br>the requests are now called xcb_render_composite_glyphs_8/16/32.<br><br>Second, we discovered that our XML code generation could not<br>correctly support all the types of glyphs, so the parameters to these<br>functions have changed from a list of GLYPH unions to simply an array
<br>of bytes. However, this leaves it up to the caller to convert the<br>list of glyphs correctly.<br><br>Third, the function you are porting belongs in the xcb/util/<br>renderutil library, named xcb_renderutil_composite_string_8. A
<br>useful starting point would be the implementation in the libXrender<br>library found here:<br><br> <a href="http://gitweb.freedesktop.org/?p=xorg/lib/libXrender.git;f=src/">http://gitweb.freedesktop.org/?p=xorg/lib/libXrender.git;f=src/
</a><br>Glyph.c;a=blob<br><br>I encourage you to work from the latest git sources. You can find<br>information on working with our anonymous repositories here:<br><br> <a href="http://xcb.freedesktop.org/wiki/DevelopersGuide">
http://xcb.freedesktop.org/wiki/DevelopersGuide</a><br><br>Sorry if this means more work for you.<br><br>Ian<br><br></blockquote></div><br>