Re: handler-bind / handler-case



I still can't get this to work and I'm more confused than ever.
Clearly, I have no idea what I'm doing. If I use the following code

(handler-bind ((error '(missing-font-error font-name))
(setf font (xlib:open-font *display*
font-name)))

and use a font that I know exists, the font is loaded. However, if I
put in a bogus font I get a runtime type error. It tells me
"missing-font-error" is not a function. If I remove the quote it
gives me the proper error. However, in this case it ALWAYS gives me
the error even when the font is openable. Shouldn't it be working
this way: handler-bind checks the form. If the form fails it looks at
it's error list - in this case any error will do - and calls the
function listed for that error? All I want to do is trap the
condition where a font can't be opened and tell the user which font
can't be opened - for whatever reason. The error you get from SBCL
for an open-font failure is incomprehensable to the average user.

.



Relevant Pages

  • Re: handler-bind / handler-case
    ... If you have a condition type with FONT-NAME as a slot, ... > and use a font that I know exists, ... If the form fails it looks at ... > for an open-font failure is incomprehensable to the average user. ...
    (comp.lang.lisp)
  • Re: handler-bind / handler-case
    ... calling an non-existant font, ... However, when I then call a good font, I get a font error - not the one ... I'm reporting. ... Handler-case/handler-bind was the only way to trap the error since I ...
    (comp.lang.lisp)
  • Re: How do I change Windows fonts to look like fonts on a Mac?
    ... I surmise your friend has set a trap(a man trap that is)for you, ... She says the Windows Lucida font is not nearly as "nice" as the Lucida ... mimics the look and style of Mac fonts? ...
    (microsoft.public.windowsxp.general)
  • Re: CSS font sizes - whats best to use?
    ... Dylan Parry wrote: ... What's even worse is that the average user doesn't even _know_ that they ... can do that to increase the font size on a page they can't read. ... all those micro-font designer sites, ...
    (alt.html)