[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (font-height)



>
>   Date: Wed, 23 Jan 91 10:49:18 CST
>   From: lynch@aristotle.ils.nwu.edu (Richard Lynch)
>
>   Anyone have any idea why in something like this:
>
>   (defobfun (exist *my-dialog) (init-list)
>     (usual-exist init-list)
>     (add-dialog-items
>       (oneof *my-static-text-dialog-item*
>	 :dialog-item-nick-name 'text
>	 :dialog-item-position #@(4 40)
>       )
>     )
>     (ask-named-item 'text (font-height))
>   )
>
>   The (font-height) function returns 341?
>
>there is no built-in font-height.  What definition
>are you using?
>
>   -andrew
>
>
Sorry.  Guess I should have included that.  Actually, I'd forgotten that I
wrote that.  I keep thinking it's built-in.

(defun ascent (&optional font-spec)
  (first (multiple-value-list (font-info font-spec)))
)

(defun descent (&optional font-spec)
  (second (multiple-value-list (font-info font-spec)))
)

(defun widmax (&optional font-spec)
  (third (multiple-value-list (font-info font-spec)))
)

(defun leading (&optional font-spec)
  (fourth (multiple-value-list (font-info font-spec)))
)

(defun font-height (&optional font-spec)
  (+ (ascent font-spec) (descent font-spec) (leading font-spec))
)

Now that I look at it, I see that it wasn't very intelligent to make those
calls to ascent, descent and leading instead of doing another
multiple-value-bind.  (MUST have been a pretty off day for me.)  Anyway, it
should be correct and it IS correct once the window gets all built.  But it
seems to be wrong until AFTER *my* exist function returns.
Does exist for a *dialog* (or *window* or any other ancestor) eval-enqueue
anything regarding font-information?  That would explain it.

"TANSTAAFL" Rich lynch@aristotle.ils.nwu.edu