Graphics Context Default Font
"Thomas M. Hermann" <[email protected]> Sat, 19 May 2007 08:19:52 -0500
| Newsgroups | gmane.lisp.clx.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------000208050105080507050804
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
I'm using a darcs pull of clx with sbcl 1.0.3 and Xorg 6.9 on FreeBSD
6.1. I've been working through the examples described as Simple CLX:
http://www.cawtech.demon.co.uk/clx/simple/examples.html
I've successfully run every example up to 'hello-world'. Evaluation of
hello-world hangs because it relies on a default value for the font in
the graphics context. If I specify the font to use, it evaluates
correctly. Looking through the clx source, the error occurs because
translate-default is passed a pseudo-font when the font is not specified
in the graphics context. For some reason, with my setup,
translate-default doesn't get the correct information when passed a
pseudo-font.
So, the problem could be that my X server isn't providing any default
font information, that the graphics context isn't generating a valid
pseudo-font or that translate-default isn't processing the pseudo-font
correctly. There are probably many more opportunities for error that
I've not identified.
I would appreciate any suggestions or pointers on how to fix this or at
least identify the source of the error.
Thanks,
Tom H.
P.S. I made a minor modification to 'open-display' in display.lisp to
get it to handle a hostname of "localhost" correctly.
--
=== Thomas M. Hermann ===
(defun hello-world (width height &optional (host ""))
(let* ((display (xlib:open-display host))
(screen (first (xlib:display-roots display)))
(black (xlib:screen-black-pixel screen))
(white (xlib:screen-white-pixel screen))
(root-window (xlib:screen-root screen))
(grackon (xlib:create-gcontext
:drawable root-window
:foreground white
:background black))
(my-window (xlib:create-window
:parent root-window
:x 0
:y 0
:width width
:height height
:background black
:event-mask (xlib:make-event-mask :exposure
:button-press))))
(describe (xlib:gcontext-font grackon))
(xlib:map-window my-window)
(xlib:event-case (display :force-output-p t
:discard-p t)
(:exposure (count)
(when (zerop count)
(xlib:draw-glyphs
my-window
grackon
20 50
"Hello World!"))
nil)
(:button-press () t))
(xlib:destroy-window my-window)
(xlib:close-display display)))
--------------000208050105080507050804
Content-Type: text/x-vcard; charset=utf-8;
name="tmh.public.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="tmh.public.vcf"
YmVnaW46dmNhcmQNCmZuOlRob21hcyBNLiBIZXJtYW5uDQpuOkhlcm1hbm47VGhvbWFzDQpl
bWFpbDtpbnRlcm5ldDp0bWgucHVibGljQGdtYWlsLmNvbQ0KdGVsO2NlbGw6MzE2LjYxNy40
NDUzDQp4LW1vemlsbGEtaHRtbDpGQUxTRQ0KdmVyc2lvbjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------000208050105080507050804--
_______________________________________________
Portable-clx mailing list
[email protected]
http://lists.metacircles.com/cgi-bin/mailman/listinfo/portable-clx
See http://www.cliki.net/clx for darcs URL(s)