[Xcb] Text rendering on XCB: how to draw more than 255 characters efficiently?

Sam Varshavchik mrsam at courier-mta.com
Sat Mar 30 01:00:18 UTC 2019

Vincent P. Ellis writes:

> « HTML content follows »
> I've been experimenting with xcb and xcb_image_text_8 lately, but found the  
> 255 character limit disturbing. Is there any other way, through an extension  
> maybe, of sending bigger string datatypes to XCB? I'm working on a textbox  
> component for a text editor, but I'm having to wrap strings manually, a then  
> manipulating x/y as necessary with multiple calls to xcb_image_text_8.
> Depending on the screensize, and the amount of text, I think it would be more  
> efficient to just render all the text myself and send a pixmap representing  
> all text that has to be rendered inside the textbox.

Checking how I implemented text rendering in libcxxw: I use the Render  
extension, and xcb_render_util_composite_text.

I only have to render the individual glyphs into an 8-bit deep alpha channel  
pixmap once; and then compose the glyphs, each time, to render the text  
using a solid color picture.

You still have to specify the position of each glyph, but it's basically  
buffered up into one request that goes to the server, specifying each glyph  
to render, and its coordinates.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/xcb/attachments/20190329/8e1477d3/attachment.sig>

More information about the Xcb mailing list