Difference between revisions of "FONTWIDTH"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 1: Line 1:
{{DISPLAYTITLE:_FONTWIDTH}}
The '''_FONTWIDTH''' function returns the font width of a MONOSPACE font handle created by {{KW|_LOADFONT}}.
The '''_FONTWIDTH''' function returns the font width of a MONOSPACE font handle created by {{KW|_LOADFONT}}.




{{PageSyntax}}
{{PageSyntax}}
:{{Parameter|pixel_width%}} = {{KW|_FONTWIDTH}}[({{Parameter|font_handle}})]
:{{Parameter|pixel_width%}} = {{KW|_FONTWIDTH}}[({{Parameter|font_handle}})]




Line 13: Line 12:
* The font width is generally 3/4 of the [[_FONTHEIGHT]] specified when loading the font.
* The font width is generally 3/4 of the [[_FONTHEIGHT]] specified when loading the font.
* In '''graphics''' [[SCREEN (statement)|screen]] modes, [[_PRINTWIDTH]] can return the total '''pixel width''' of a literal or variable [[STRING|string]] of text.
* In '''graphics''' [[SCREEN (statement)|screen]] modes, [[_PRINTWIDTH]] can return the total '''pixel width''' of a literal or variable [[STRING|string]] of text.




{{PageSeeAlso}}
{{PageSeeAlso}}
 
*[[_FONTHEIGHT]]
*{{KW|_FONTHEIGHT}}
*[[_FONT]]
 
* [[_LOADFONT]]
*{{KW|_FONT}}
* [[_PRINTWIDTH]]
 
*{{KW|_LOADFONT}}
 
*{{KW|_PRINTWIDTH}}






{{PageNavigation}}
{{PageNavigation}}

Revision as of 13:36, 21 July 2013

The _FONTWIDTH function returns the font width of a MONOSPACE font handle created by _LOADFONT.


Syntax

pixel_width% = _FONTWIDTH[(font_handle)]


  • Will return width of last font used if a handle is not designated.
  • Variable width fonts always return width 0. Even fixed width fonts will return 0 unless the "MONOSPACE" style option is used.
  • "MONOSPACE" cannot be used on a variable width font.
  • The font width is generally 3/4 of the _FONTHEIGHT specified when loading the font.
  • In graphics screen modes, _PRINTWIDTH can return the total pixel width of a literal or variable string of text.


See also




Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page