<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>&lt;code&gt;<br>typedef struct {<br>&nbsp;uint8_t&nbsp;&nbsp;len;<br>&nbsp;uint8_t&nbsp;&nbsp;pad1;<br>&nbsp;uint16_t&nbsp;pad2;<br>&nbsp;int16_t&nbsp;&nbsp; deltax;<br>&nbsp;int16_t&nbsp;&nbsp; deltay;<br>} xGlyphElt;</p>
<div>void<br>xcb_render_composite_string_8 (xcb_connection_t&nbsp;&nbsp;&nbsp;&nbsp; *dpy,<br>&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; op,<br>&nbsp;&nbsp;&nbsp; xcb_render_picture_t&nbsp;&nbsp;&nbsp;&nbsp; src,<br>&nbsp;&nbsp;&nbsp; xcb_render_picture_t&nbsp;&nbsp;&nbsp;&nbsp; dst,<br>&nbsp;&nbsp;&nbsp; const xcb_render_pictformat_t&nbsp; mask_format,<br>&nbsp;&nbsp;&nbsp; xcb_render_glyphset_t&nbsp;&nbsp;&nbsp;&nbsp; glyphset,
<br>&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; src_x,<br>&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; src_y,<br>&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xDst,<br>&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yDst,<br>&nbsp;&nbsp;&nbsp; const char&nbsp;&nbsp;&nbsp;&nbsp; *string, /* a list of xcb_render_glyph_t */<br>&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nchar) /* number of xcb_render_glyph_t */<br>{<br>
&nbsp;int&nbsp;&nbsp;&nbsp;&nbsp;nbytes;<br>&nbsp;xGlyphElt *elt;<br>&nbsp; if (nchar)<br>&nbsp; {<br>&nbsp;&nbsp;nbytes = (nchar + sizeof(xGlyphElt) + 3) &amp; ~3;<br>&nbsp;&nbsp;elt = (xGlyphElt *)malloc(nbytes);<br>&nbsp;&nbsp;elt-&gt;len = nchar;<br>&nbsp;&nbsp;elt-&gt;deltax = xDst;<br>&nbsp;&nbsp;elt-&gt;deltay = yDst;
<br>&nbsp;&nbsp;memcpy ((char *) (elt + 1), string, nchar);<br>&nbsp; }<br>&nbsp;xcb_render_composite_glyphs_8&nbsp;&nbsp;(dpy,op,src,dst,mask_format,glyphset,</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; src_x,src_y,nbytes,(uint8_t *)elt);<br>}<br>&lt;/code&gt;</div>
<p>I think the problem is how to convert a list of xcb_render_glyph_t to an array&nbsp; of bytes(glyphcmds).</p>
<div>Any suggestion to this will be of great help.</div>
<div>&nbsp;</div>
<div>jianjun<br>&nbsp;</div>
<div><span class="gmail_quote">On 10/11/06, <b class="gmail_sendername">Ian Osgood</b> &lt;<a href="mailto:iano@quirkster.com">iano@quirkster.com</a>&gt; 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>&gt; Hi All,<br>&gt;<br>&gt; Has anyone ever used &quot;XCBRenderCompositeGlyphs&quot;? and how to convert
<br>&gt; XCBRenderGLYPH list to XCBRenderGLYPHITEM8 when rendering the<br>&gt; 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.&nbsp;&nbsp;A
<br>useful starting point would be the implementation in the libXrender<br>library found here:<br><br>&nbsp;&nbsp;<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.&nbsp;&nbsp;You can find<br>information on working with our anonymous repositories here:<br><br>&nbsp;&nbsp;<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>