[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

strwidth Subroutine

Purpose

Returns the width of the specified text string.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

Int32 strwidth(Char8 * string)

FORTRAN Syntax

INTEGER*4 FUNCTION STRWID(string, length) 
CHARACTER*(*) string
INTEGER*4 length

Description

The strwidth subroutine returns the width of a text string in pixels, using the character-spacing parameters of the current raster font. This subroutine is useful when you do a simple mapping from screen space to modeling space.

Undefined characters have zero width.

Note: This subroutine cannot be used to add to a display list.

Parameters

string Specifies the name of the string.
length Specifies the number of characters in the string.

Example

The example C language program prompt.c uses the strwidth subroutine to get the number of pixels needed to draw a prompt string.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

Mapping a point on the screen into a line in 3-D modeling coordinates with the mapw subroutine.

Mapping a point on the screen into a line in 2-D modeling coordinates with the mapw2 subroutine.

AIX Graphics Library Overview, Creating Text Characters, Picking and Selecting Overview, Working with Coordinate Systems, and Querying the System.


[ Previous | Next | Contents | Glossary | Home | Search ]