UFONTHEIGHT: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
m (Add _UCHARPOS to "See Also")
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:_UFONTHEIGHT}}
{{DISPLAYTITLE:_UFONTHEIGHT}}
The '''_UFONTHEIGHT''' function returns the global glyph height (incl. ascender/descender) of a font loaded by [[_LOADFONT]].
The '''_UFONTHEIGHT''' function returns the global glyph height (incl. ascender/descender) of a font loaded by [[_LOADFONT]].


{{PageSyntax}}
{{PageSyntax}}
: {{Parameter|pixelHeight&}} = [[_UFONTHEIGHT]][({{Parameter|fontHandle&}})]
: {{Parameter|pixelHeight&}} = [[_UFONTHEIGHT]][({{Parameter|fontHandle&}})]


{{PageParameters}}
{{PageParameters}}
Line 12: Line 14:
* If no font is set, it returns the current screen mode's text block height.
* If no font is set, it returns the current screen mode's text block height.
* This is different from [[_FONTHEIGHT]] as it may return larger values when using scalable fonts.
* This is different from [[_FONTHEIGHT]] as it may return larger values when using scalable fonts.


{{PageAvailability}}
{{PageAvailability}}
Line 24: Line 27:
</gallery>
</gallery>
<!-- additional availability notes go below here -->
<!-- additional availability notes go below here -->


{{PageExamples}}
{{PageExamples}}
Line 37: Line 41:
{{Ot|<nowiki>_UFONTHEIGHT = 32</nowiki>|#a9a9a9}}
{{Ot|<nowiki>_UFONTHEIGHT = 32</nowiki>|#a9a9a9}}
{{OutputEnd}}
{{OutputEnd}}


{{PageSeeAlso}}
{{PageSeeAlso}}
Line 44: Line 49:
* [[SCREEN]], [[_LOADFONT]]
* [[SCREEN]], [[_LOADFONT]]
* [[Text Using Graphics]]
* [[Text Using Graphics]]


{{PageNavigation}}
{{PageNavigation}}

Revision as of 12:31, 22 May 2023

The _UFONTHEIGHT function returns the global glyph height (incl. ascender/descender) of a font loaded by _LOADFONT.


Syntax

pixelHeight& = _UFONTHEIGHT[(fontHandle&)]


Parameters

  • fontHandle& is an optional font handle.

Description

  • Returns the height of the last font used if a handle is not designated.
  • If no font is set, it returns the current screen mode's text block height.
  • This is different from _FONTHEIGHT as it may return larger values when using scalable fonts.


Availability


Examples

Example
Show the difference of _UFONTHEIGHT vs. _FONTHEIGHT.
DIM fh AS LONG: fh = _LOADFONT("LHANDW.TTF", 23)

PRINT "_FONTHEIGHT ="; _FONTHEIGHT(fh)
PRINT "_UFONTHEIGHT ="; _UFONTHEIGHT(fh)
_FONTHEIGHT = 23
_UFONTHEIGHT = 32


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link