Difference between revisions of "FONTWIDTH"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>SMcNeill
(style guidelines)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The '''_FONTWIDTH''' function returns the font width of a font handle created by {{KW|_LOADFONT}}.
{{DISPLAYTITLE:_FONTWIDTH}}
 
The [[_FONTWIDTH]] function returns the font width of a MONOSPACE font handle created by [[_LOADFONT]].




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


* Will return width of last font used if a handle is not designated.
* The font width is generally 3/4 of the [[_FONTHEIGHT]].


* Returns the character width of the last font used if a handle is not specified.
* '''Variable width fonts always return {{Parameter|pixelWidth%}} = 0.''' Even fixed width fonts return 0 unless the [[LOADFONT|"MONOSPACE"]] style option is used.
* QB64 '''version 1.000 and up''' can load a variable width font as monospaced with the [[LOADFONT|"MONOSPACE"]] style parameter.
* 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.




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




{{PageNavigation}}
{{PageNavigation}}

Latest revision as of 00:20, 6 September 2017

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


Syntax

pixelWidth% = _FONTWIDTH[(fontHandle&)]


  • Returns the character width of the last font used if a handle is not specified.
  • Variable width fonts always return pixelWidth% = 0. Even fixed width fonts return 0 unless the "MONOSPACE" style option is used.
  • QB64 version 1.000 and up can load a variable width font as monospaced with the "MONOSPACE" style parameter.
  • 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