dlGetRasterTextWidth
dlGetRasterTextWidth(
t_fontName
t_text
)
=> x_width / -1
Description
Retrieves width of the text in pixels for the specified raster font.
Arguments
|
t_fontName
|
Name of a font, which can be:
-
An X logical font descriptor (XLFD) such as
"-*-courier-medium-r-*-*-12-*" and "-*-helvetica-medium-r-*-*-14-*”. -
A standard alias name such as
"6x13" or "fixed". -
A font type such as
"text", "ciw", "label", "error", or "help". When a font type is specified, the default font name used in IC6.1.6 or previous releases is used as shown below:
font type font name
------ ---------
text -*-courier-medium-r-*-*-12-*
ciw -*-courier-medium-r-*-*-12-*
label -*-helvetica-medium-r-*-*-12-*
error -*-helvetica-medium-r-*-*-12-*
help -*-helvetica-medium-r-*-*-14-*
|
|
t_text
|
Text string for which the width is required.
|
Value Returned
|
x_width
|
The width of the text in pixels for the specified raster font.
|
|
-1
|
The font could not be found.
|
Examples
The following examples retrieve the widths of the specified raster texts:
dlGetRasterTextWidth("-*-courier-medium-r-*-*-12-*" "hello")
35
dlGetRasterTextWidth("text" "hello")
35
dlGetRasterTextWidth("-*-helvetica-medium-r-*-*-24-*" "hello")
51
Related Topics
View Display List Functions
Return to top