PEXOCCSetCharExpansion - Set Character Expansion Factor (5.0)


Synopsis

 
     void PEXOCCSetCharExpansion(
          PEXOCC context,
          double expansion
     )
 

 
     void PEXSetCharExpansion(
          Display *display,
          XID resource_id,
          PEXOCRequestType req_type,
          double expansion
     )
 

Arguments

context
An OC context returned by a successful PEXCreateOCC call.

display (OCC)
A pointer to a display structure returned by a successful XOpenDisplay call.

resource_id (OCC)
The resource identifier of the renderer or structure.

req_type (OCC)
The request type for the output command (PEXOCRender, PEXOCStore, PEXOCRenderSingle or PEXOCStoreSingle).

expansion
The character expansion factor.

Returns

None.

Description

Invoke PEXOCCSetCharExpansion to create an attribute output command which sets the character expansion factor attribute in the renderer's pipeline state according to the value specified by expansion.

By setting the character expansion attribute's ASF to PEXIndividual (see PEXOCCSetIndividualASF), you use the pipeline state's character expansion entry to scale the character width: character width is multiplied by the magnitude of the character expansion. The character height (see PEXOCCSetCharHeight) and the text font index (see PEXOCCSetTextFontIndex) determine the character width because each font includes a width:height ratio. When you set the character expansion attribute's ASF to PEXBundled, the implementation uses the character expansion factor from the text bundle table.

PEXlib compares the character expansion factor that you specify to the minimum and maximum character expansion factors. You select a font table entry that defines a font group. The minimum and maximum character expansion factor values depend on the font files that you place in the font group. If the font is a stroked font, then a continuous range of character widths are supported. Otherwise PEXlib uses the closest width supported by the font. For example, if your application opens all of the stroke fonts that are possible to scale and rotate, then the implementation supports a continuous number of expansions. If you specify an expansion that is smaller than the minimum character expansion factor, then the expansion factor defaults to the minimum value. If the expansion is larger than the maximum character expansion factor, then the expansion factor defaults to the maximum value.

This function is a member of the annotation and text attribute set and affects all annotation text and text primitives.

Errors

BadPEXRenderer
The specified renderer resource identifier is invalid.

BadPEXStructure
The specified structure resource identifier is invalid.

See Also

For an overview and for a list of all output attribute functions, see Output Attribute Functions.