[mcclim-devel] text with negative x-offsets

Christophe Rhodes csr21 at cam.ac.uk
Sat Aug 13 14:28:29 UTC 2005


Christophe Rhodes <csr21 at cam.ac.uk> writes:

> Christophe Rhodes <csr21 at cam.ac.uk> writes:
>
>> Find attached a preliminary patch to deal with the fact that, in
>> general, glyphs from fonts are not constrained to draw only to the
>> right of the cursor position.
>
> A revised patch is attached, which is still not commit-worthy but
> fixes the opposite-problem as well: glyphs which draw beyond their
> advance width.  (Thanks to Dave Murray aka JQS for testing).
>
> The current plan is for us here at Goldsmiths to perform a little more
> testing and extend it to the PostScript backend.  I suppose that the
> logical thing to do is to call TEXT-BOUNDING-RECTANGLE* a backend
> function and require backends to implement it for their backend-medium.

Well, for what it's worth, we did this, I performed some light testing
(using clim-demo::postscript-test), and I've committed our work so
far.

> This imposes a maintenance burden on those interested in the OpenGL
> and beagle backends, but I hope not a terrible one.  I note, from the
> screenshot at
> http://www.bloodandcoffee.net/campbell/climacs-beagle-porn.png for
> example, that there seem to be similar redraw artifacts in the beagle
> backend in any case, so it could well be that an implementation of
> text-bounding-rectangle* there clears those up.  (Is anyone out there
> using the OpenGL backend?)

This remains true: the beagle, OpenGL (and CLX with #+unicode, if
that's not dead code) backends are currently broken.  Sorry.  To fix
them, the function climi::text-bounding-rectangle* needs to be
implemented, which should return the bounding-rectangle of a draw-text
command at 0,0 with :x-align :left and :y-align :baseline.  (If all
else fails, this can be faked with a call to TEXT-SIZE, with the
caveat that then redraw artifacts as in the above screenshot will
remain.)

Cheers,

Christophe



More information about the mcclim-devel mailing list