Re: Text rendering on XCB: how to draw more than 2 55 characters efficiently?

Sam Varshavchik <[email protected]> Fri, 29 Mar 2019 21:00:18 -0400
Newsgroups gmane.comp.freedesktop.xcb
Message-ID <[email protected]>
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.

_______________________________________________
Xcb mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/xcb
signature.asc (application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE-----

iQIcBAABAgAGBQJcnr+iAAoJEGs6Yr4nnb8lGVQQAKa86mpLLCucYoyGzM/IAqTr
c2Gc3oMmtN3vYwPhr1vhG9Tzz9ETffWRl7fUxNzgSUNRhYioe0shTKM6EhkcmxTm
qSOZvYv0ujRIq7LbCdx7lodfr6u7d3Y0uvc/tsNIW7xIGtuVNzojw+nXexqYfi06
8x35FvHaT5scZQaHaLlNoaQ19m+1sdb7edvPA+2vGZYhnacJVt9A4ai9dgdUfYW7
Nsv4BiI3BOBxUBsN8gaaESSkfs6RXEffMwR7avjMBKOmCkif53ZMDNndlXycfisC
1OSSaHb1Jtfy970EWcZmXUFZezeIlb1wlNukoDKmIMZc++tEwk8uMwha9KEiS+UK
GvXDgI7sIFBV7UeU0wR6xW1q5lRVL8gUrUZy5Mg4riWejLVr+xPAYgNRIa3r3Z+T
62WNkYtbwEISMOn7fn/nYuOatd6gZprRDzQUO8sgkhYnoZLSlakhE7a4Y6kkxByn
HUZiZjj09MPJ9sjsUzVvphar4bNWhw7/2EZ30w9vVX21ulYGpXGOmjqMP9l7RiLW
eAbzFhHd9XcERFDg8pKAsrbmDfVl/3cdQlSLxn7ptj98dQa8i37eJshdm/qiUBIm
KBJBc218XbRtkUlGRkRaikFfpijrI21+MQiFQnQw2tWR07EsMUyfqIWZ1QuvDYGg
tt6G2ckpIgtpLk7Txnbi
=jprg
-----END PGP SIGNATURE-----