ULINESPACING: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
(Initial version) |
No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:_ULINESPACING}} | {{DISPLAYTITLE:_ULINESPACING}} | ||
The | The '''_ULINESPACING''' function returns the vertical line spacing (distance between two consecutive baselines) in pixels. | ||
{{PageSyntax}} | {{PageSyntax}} | ||
:{{Parameter|pixels&}} = [[_ULINESPACING]][({{Parameter|fontHandle&}})] | : {{Parameter|pixels&}} = [[_ULINESPACING]][({{Parameter|fontHandle&}})] | ||
{{PageParameters}} | {{PageParameters}} | ||
* {{Parameter|fontHandle&}} is an optional font handle. | * {{Parameter|fontHandle&}} is an optional font handle. | ||
{{PageDescription}} | {{PageDescription}} | ||
Line 12: | Line 15: | ||
* 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 can be used to leave the correct amount of line gap between lines. | * This can be used to leave the correct amount of line gap between lines. | ||
{{PageAvailability}} | {{PageAvailability}} | ||
<!-- QB64 = a version or none, QBPE = a version or all, Platforms = yes or no --> | <!-- QB64 = a version or none, QBPE = a version or all, Platforms = yes or no --> | ||
<gallery widths="48px" heights="48px" mode="nolines"> | <gallery widths="48px" heights="48px" mode="nolines"> | ||
File:Qb64.png|''' | File:Qb64.png|'''none''' | ||
File:Qbpe.png|'''v3.7.0''' | File:Qbpe.png|'''v3.7.0''' | ||
File:Apix.png | File:Apix.png | ||
Line 24: | Line 28: | ||
</gallery> | </gallery> | ||
<!-- additional availability notes go below here --> | <!-- additional availability notes go below here --> | ||
{{PageExamples}} | {{PageExamples}} | ||
;Example:How to use [[_ULINESPACING]]. | |||
{{CodeStart}} | {{CodeStart}} | ||
{{Cl|OPTION}} {{Cl|_EXPLICIT}} | {{Cl|OPTION}} {{Cl|_EXPLICIT}} | ||
Line 58: | Line 63: | ||
{{Cl|DATA}} {{Text|<nowiki>"To strive,to seek,to find,and not to yield."</nowiki>|#FFB100}} | {{Cl|DATA}} {{Text|<nowiki>"To strive,to seek,to find,and not to yield."</nowiki>|#FFB100}} | ||
{{CodeEnd}} | {{CodeEnd}} | ||
{{PageSeeAlso}} | {{PageSeeAlso}} | ||
* [[_UPRINTWIDTH]], [[_UFONTHEIGHT]], [[_UPRINTSTRING]] | * [https://qb64phoenix.com/forum/showthread.php?tid=2819 Featured in our "Keyword of the Day" series] | ||
* [[_UPRINTWIDTH]], [[_UFONTHEIGHT]], [[_UPRINTSTRING]], [[_UCHARPOS]] | |||
* [[_FONTWIDTH]], [[_FONTHEIGHT]], [[_FONT]] | * [[_FONTWIDTH]], [[_FONTHEIGHT]], [[_FONT]] | ||
* [[_PRINTWIDTH]], [[_PRINTSTRING]] | * [[_PRINTWIDTH]], [[_PRINTSTRING]] | ||
* [[SCREEN]], [[_LOADFONT]] | * [[SCREEN]], [[_LOADFONT]] | ||
* [[Text Using Graphics]] | * [[Text Using Graphics]] | ||
{{PageNavigation}} | {{PageNavigation}} |
Latest revision as of 09:55, 24 June 2024
The _ULINESPACING function returns the vertical line spacing (distance between two consecutive baselines) in pixels.
Syntax
- pixels& = _ULINESPACING[(fontHandle&)]
Parameters
- fontHandle& is an optional font handle.
Description
- Returns the vertical line spacing 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 can be used to leave the correct amount of line gap between lines.
Availability
Examples
- Example
- How to use _ULINESPACING.
OPTION _EXPLICIT SCREEN _NEWIMAGE(800, 600, 32) DIM fh AS LONG: fh = _LOADFONT("LHANDW.TTF", 23) IF fh <= 0 THEN PRINT "Failed to load font file!" END END IF _FONT fh CLS , _RGB32(200, 200, 200) COLOR _RGB32(0, 0, 0) _PRINTMODE _KEEPBACKGROUND DIM l AS STRING, i AS LONG FOR i = 0 TO 4 READ l _UPRINTSTRING (0, _ULINESPACING * i), l NEXT END DATA "We are not now that strength which in old days" DATA "Moved earth and heaven; that which we are,we are;" DATA "One equal temper of heroic hearts," DATA "Made weak by time and fate,but strong in will" DATA "To strive,to seek,to find,and not to yield." |
See also
- Featured in our "Keyword of the Day" series
- _UPRINTWIDTH, _UFONTHEIGHT, _UPRINTSTRING, _UCHARPOS
- _FONTWIDTH, _FONTHEIGHT, _FONT
- _PRINTWIDTH, _PRINTSTRING
- SCREEN, _LOADFONT
- Text Using Graphics