< Futurebasic < Language < Reference

USR FONTHEIGHT

Description - This function returns the current "font height" in pixels. This is based on the current font ID and font size for the current output window or printer. The font height is the full height of a line of text, measured from the top of one line to the top of the line below it. It is not the same thing as the "font size," although there is often a relationship between the font size and the font height. The font height is the sum of the font's "ascent," its "descent" and its "leading." See the "Font Manager" chapter in Inside Macintosh: Text for more information.

Example: USR FONTHEIGHT is useful for determining how many lines of text will fit within a rectangle of a given height. This LOCAL FN returns the number of text lines that can fit in the current window: LOCAL FN MaxLines

  wh = WINDOW(_height)
  fh = USR FONTHEIGHT
  max = wh \\ fh
  END FN = max

See Also TEXT

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.