On Wednesday, 14 August 2013 at 02:23:07 UTC, Adam D. Ruppe wrote:
On Tuesday, 13 August 2013 at 20:33:48 UTC, Joakim wrote:
You mentioned X11 to me before, when we talked about this idea
over email.
Ah yes. I think X's biggest problem though is that it doesn't
do *enough*. The protocol is fairly efficient for what it does,
but it just doesn't do enough so the commands aren't
particularly compact when you start to get fancier.
For instance, in my crappygui.d, I used XDrawString to draw
text. This was the result: http://arsdnet.net/gui.png
That's a true type font (Bitstream Vera Sans, a fairly good
looking font), but X doesn't support antialiasing.
There's a library called Xft that draws fonts prettier. But how
does it work? Instead of sending DrawText(x, y, "hello world!")
to the display server, it uses a drawing library to render the
text as an image in the application, then sends that image to
the display server.
And BTW if the display doesn't support the alpha blending
extension (the XRender extension), it first takes a partial
screenshot, does the blending in library, and sends that image
back!
Note that the X protocol does not compress the image data. So
if you send a 100x30 pixel image of text, you're shooting some
10 KB - or double that without XRender - down the network wire
instead of the .... idk exactly for sure, but I think it is
about 32 bytes to just send the draw instruction.
Font rendering is often application specific and very
complex. This is why it is done client-side in X11 nowadays.
State of Text Rendering on Linux: http://behdad.org/text/