skip to main content

Library Routines : W$TEXTSIZE

W$TEXTSIZE
The W$TEXTSIZE library routine measures the height and the width of a text.
Syntax:
 CALL "W$TEXTSIZE" USING textString
Parameters:
01 textsize-data.
03 textsize-font handle of font value null.
03 textsize-window handle of window value null.
03 textsize-size-x pic 9(7)v99 comp-4.
03 textsize-cells-x pic 9(7)v99 comp-4.
03 textsize-base-x pic 9(9) comp-4.
03 textsize-size-y pic 99v99 comp-4.
03 textsize-cells-y pic 99v99 comp-4.
03 textsize-base-y pic 9(4) comp-4.
03 textsize-flags pic x comp-x value zero.
88 textsize-strip-spaces value 1 false zero.
Note: if the font has been loaded with wfont-angle different than zero, results are unpredictable. Rotated fonts should not be used for cell measurement.
Examples:
Example - retrieve cell dimensions on the current window with default font
working-storage section.
77  hWin          handle of window.
77  text-string   pic x(20).
77  h-font        handle of font.  
procedure division.
   display independent graphical window                   
           with   system menu
           title  "W$TEXTSIZE Routine"
   accept h-font from standard object "default-font"
   move hWin   to textsize-window
   move h-font to textsize-font
   set textsize-strip-spaces to true
   inquire event-control-handle value in text-string
   call "W$TEXTSIZE" using text-string, textsize-data
   display message textsize-size-x  "  "

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left