Lisp HUG Maillist Archive

Dodgy make-font-description

Hi there.

Consider code:

(defun draw-word (pane)
   (gp:draw-string pane "Word" 10 10 :font (gp:make-font-description  
:family "times" :size 24)))

(setf a (capi:contain (make-instance 'capi:output-pane)))

(draw-word a)

Which for whatever reason does not work on Windows anyway:

Error: No applicable methods for #<STANDARD-GENERIC-FUNCTION  
GRAPHICS-PORTS::%LOOKUP-FONT 20D698C2> with args (#<Representation  
WIN32:R-SCREEN #<COLOR-SCREEN 0 R-SCREEN> DISPLAY 64.00 [Raster display]  
[1280x1024] [96dpi]> #S(FONT-DESCRIPTION :ATTRIBUTES #))


Re: Dodgy make-font-description

On Fri, Jan 04, 2008 at 06:58:31PM -0000, Yury Davidouski wrote:
> Consider code:
> 
> (defun draw-word (pane)
>   (gp:draw-string pane "Word" 10 10 :font (gp:make-font-description  
> :family "times" :size 24)))
> 
> (setf a (capi:contain (make-instance 'capi:output-pane)))
> 
> (draw-word a)
> 
> Which for whatever reason does not work on Windows anyway:
> 
> Error: No applicable methods for #<STANDARD-GENERIC-FUNCTION  
> GRAPHICS-PORTS::%LOOKUP-FONT 20D698C2> with args (#<Representation  
> WIN32:R-SCREEN #<COLOR-SCREEN 0 R-SCREEN> DISPLAY 64.00 [Raster display]  
> [1280x1024] [96dpi]> #S(FONT-DESCRIPTION :ATTRIBUTES #))

It doesn't work under Linux either.  The generic function browser
shows that GP::%LOOKUP-FONT wants an X display (for Linux, anyway),
followed by one of X-LIBRARY:FONT, a GP::GENERIC-FONT, or a STRING.
Obviously a FONT-DESCRIPTION is none of these.

  (gp:draw-string pane "Word" 20 20 :font "times")

didn't work either, but only because "times" is not a valid font on my
system.  (Actually it *did* draw "Word" but popped up two X-protocol
error boxes about "times" being an invalid font and so forth.)

  (gp:draw-string a "Word" 30 30 :font "fixed")

worked fine.

Dunno if that helps, though.

-- L


Re: Dodgy make-font-description

On Fri, 04 Jan 2008 18:58:31 -0000, "Yury Davidouski" <dcu-stuff@list.ru> wrote:

> Consider code:
>
> (defun draw-word (pane)
>    (gp:draw-string pane "Word" 10 10 :font (gp:make-font-description
>    :family "times" :size 24)))

See GP:FIND-BEST-FONT.

Edi.


Updated at: 2020-12-10 08:44 UTC