CLIM mail archive

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

Computing the Label Size



   Date:     Thu, 7 Jul 94 10:24:45 EDT
   From: Nichael Cramer <ncramer@BBN.COM>

   [ALLEGRO/CLIM2/SPARC]

   The function SILICA:COMPUTE-GADGET-LABEL-SIZE[*] should (I assume) return
   the width and height that would be used if the label of a gadget is drawn.

   However, the values I get are noticably larger than the space actually used
   by the label-string (in particular, the height is about 5 pixles larger
   than the size of the actual string when it is drawn).  My guess would be
   that some sort of surrounding buffering/bordering is being factored into
   the size the function returns.

Sorry to take so long.

COMPUTE-GADGET-LABEL-SIZE, when you pass it a text label (as opposed
to a pattern or a pixmap) adds one "canonical" character width to the
width, and half the line-height to the height.

   Is this the case?  If so, is there some way the amount of buffering can be
   functionally determined (otherwise it makes it somewhat difficult to lay
   the label with much precision).

   Thanks
   Nichael


   [* As an aside, it is important SILICA:COMPUTE-GADGET-LABEL-SIZE in certain
      cases, for example inside COMPOSE-SPACE which can be called before the  
      pane/medium is set up and where a call to, say, TEXT-SIZE would cause a 
      nasty error.]



Main Index | Thread Index