Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ glcgetstringcharmetric() — IRIX 6.5.3f

Media Vault

Software Library

Restoration Projects

Artifacts Sought



glcGetStringCharMetric(3G)                           OpenGL Character Renderer



NAME
     glcGetStringCharMetric - retrieve character metric from measurement
     buffer


C SPECIFICATION
     GLfloat* glcGetStringCharMetric( GLint inIndex,
                                      GLCenum inMetric,
                                      GLfloat *outVec )


PARAMETERS
     inIndex   Specifies which element in the string to measure.

     inMetric  Specifies the metric to measure, either GLCBASELINE or
               GLCBOUNDS.

     outVec    Specifies a vector in which to store value of inMetric for the
               specified character.


DESCRIPTION
     glcGetStringCharMetric retrieves a character metric from the GLC
     measurement buffer and stores it in outVec. To store a string in the
     measurement buffer, call glcMeasureCountedString or glcMeasureString.

     The position of the character to measure is specified by inIndex.  The
     metric, either GLCBASELINE or GLCBOUNDS, is specified by inMetric.

     If the command does not raise an error, its return value is outVec. If
     inMetric is  GLCBOUNDS, the vector returned in outVec starts in the
     lower left corner and continues in a counterclockwise direction.

EXAMPLES
     The following example first calls glcMeasureString to store the string
     "hello" in the measurement buffer. It then retrieves both the baseline
     and the bounding box for the whole string, then for each individual
     character.

     GLfloat overallBaseline[4];
     GLfloat overallBoundingBox[8];

     GLfloat charBaselines[4][5];
     GLfloat charBoundingBoxes[8][5];

     GLint i;

     glcMeasureString(GLTRUE, "hello");

     glcGetStringMetric(GLCBASELINE, overallBaseline);
     glcGetStringMetric(GLCBOUNDS, overallBoundingBox);




                                                                        Page 1





glcGetStringCharMetric(3G)                           OpenGL Character Renderer



     for (i = 0 ; i < 5 ; ++i) {
         glcGetStringCharMetric(i, GLCBASELINE, charBaselines[i]);
         glcGetStringCharMetric(i, GLCBOUNDS, charBoundingBoxes[i]);
     }

NOTES
     glcGetStringCharMetric is useful if you're interested in the metric of a
     character as it appears in a string, that is, influenced by kerning,
     ligatures, and so on. To measure a character as if it started at the
     origin, call glcGetCharMetric.

ERRORS
     GLCPARAMETERERROR is generated if inIndex is less than zero or is
     greater than or equal to the value of the variable
     GLCMEASUREDCHARCOUNT.

SEE ALSO
     glcGetCharMetric, glcGetMaxCharMetric, glcMeasureCountedString,
     glcMeasureString




































                                                                        Page 2



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