Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fm_str_len(3w) — HP-UX 9.03

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fm_write(3w)

fm_str_len(3w)

NAME

fm_str_len − determine the pixel length of a character string

SYNOPSIS

int fm_str_len(gfd,str,strlen);
int gfd;
char *str;
int strlen;

DESCRIPTION

gfd is an integer file descriptor for a gopened device interface. 

str is the string for which the length is to be determined. 

strlen is the length of str in bytes. 

DISCUSSION

The return value of this function is the length, in pixels, of a character string along the current character direction of the active font for this process.  For example, this could be used to center text in a proportionately spaced font. 

Note that str is not null-terminated; instead, strlen is used to determine its length.  Each 2-byte character is treated as two bytes. 

The following processing is done only when the active font is a HP-15 (2-byte) character font:

 ∗ If the string contains an undefined 2-byte character, the cell size of the 2-byte galley character is used. 

 ∗ If the string contains an illegal 2-byte character, the illegal character is treated as the two 1-byte characters that correspond to the two codes that compose the illegal 2-byte character code. 

 ∗ If the last code of the string is the first code of a 2-byte character, the character is treated as the 1-byte character that corresponds to the code value. 

SEE ALSO

fm_write(3w). 

DIAGNOSTICS

A −1 is returned if gfd is not valid; otherwise, 0 is returned.  See errno(2) for more information.

Hewlett-Packard Company  —  HP-UX Release 9.03: April 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026