Jump to content

GpiQueryWidthTable: Difference between revisions

From EDM2
Created page with "This function returns width table information for the logical font identified by the value of the character-set attribute. ==Syntax== GpiQueryWidthTable(hps, lFirstChar, lCount, alData) ==Parameters== ; hps (HPS) - input : Presentation-space handle. ; lFirstChar (LONG) - input : Codepoint of first character. : The codepoint of the initial character, for which width-table information is required. ; lCount (LONG) - input : Count of elements in alData. : Th..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 5: Line 5:


==Parameters==
==Parameters==
; hps ([[HPS]]) - input
;hps ([[HPS]]) - input: Presentation-space handle.
: Presentation-space handle.
;lFirstChar ([[LONG]]) - input: Codepoint of first character.
 
:The codepoint of the initial character, for which width-table information is required.
; lFirstChar ([[LONG]]) - input
;lCount (LONG) - input: Count of elements in alData.
: Codepoint of first character.
:The number that should be allowed for, so as to retrieve the full width table. Data for this font can be found by [[GpiQueryFontMetrics]].
: The codepoint of the initial character, for which width-table information is required.
;alData (PLONG) - output: Array of width values.
 
:An array of lCount elements, in which width-table information is returned. No more than lCount elements are returned.
; lCount ([[LONG]]) - input
: Count of elements in alData.
: The number that should be allowed for, so as to retrieve the full width table. Data for this font can be found by [[GpiQueryFontMetrics]].
 
; alData ([[PLONG]]) - output
: Array of width values.
: An array of lCount elements, in which width-table information is returned. No more than lCount elements are returned.


==Return Value==
==Return Value==
; rc ([[BOOL]]) - returns
;rc ([[BOOL]]) - returns: Success indicator.
: Success indicator.
::TRUE - Successful completion
:; TRUE
::FALSE - Error occurred.
:: Successful completion
:; FALSE
:: Error occurred.


==Errors==
==Errors==
Possible returns from WinGetLastError:
Possible returns from WinGetLastError:
; PMERR_INV_HPS (0x207F)
; PMERR_INV_HPS (0x207F): An invalid presentation-space handle was specified.
: An invalid presentation-space handle was specified.
; PMERR_PS_BUSY (0x20F4): An attempt was made to access the presentation space from more than one thread simultaneously.
; PMERR_PS_BUSY (0x20F4)
; PMERR_INV_FIRST_CHAR (0x2071): An invalid firstchar parameter was specified with GpiQueryWidthTable.
: An attempt was made to access the presentation space from more than one thread simultaneously.
; PMERR_INV_LENGTH_OR_COUNT (0x2092): An invalid length or count parameter was specified.
; PMERR_INV_FIRST_CHAR (0x2071)
; PMERR_COORDINATE_OVERFLOW (0x2014): An internal coordinate overflow error occurred. This can occur if coordinates or matrix transformation elements (or both) are invalid or too large.
: An invalid firstchar parameter was specified with GpiQueryWidthTable.
; PMERR_INV_LENGTH_OR_COUNT (0x2092)
: An invalid length or count parameter was specified.
; PMERR_COORDINATE_OVERFLOW (0x2014)
: An internal coordinate overflow error occurred. This can occur if coordinates or matrix transformation elements (or both) are invalid or too large.


==Example Code==
==Example Code==
<PRE>
#define INCL_GPILCIDS /* Or use INCL_GPI, INCL_PM, */
#include &lt;os2.h&gt;
HPS    hps;        /* Presentation-space handle. */
LONG    lFirstChar; /* Codepoint of first character. */
LONG    lCount;    /* Count of elements in alData. */
PLONG  alData;    /* Array of width values. */
BOOL    rc;        /* Success indicator. */
rc = GpiQueryWidthTable(hps, lFirstChar, lCount, alData);
</PRE>
In this example the widths of the first 50 characters of the current font are obtained.
In this example the widths of the first 50 characters of the current font are obtained.
<pre>
<pre>
#define INCL_GPILCIDS
#define INCL_GPILCIDS
#include &lt;OS2.H&gt;
#include <OS2.H>


#define COUNT 50
#define COUNT 50


HPS hps; /* Presentation-space */
HPS hps; /* Presentation-space handle. */
        /* handle. */
LONG alData[COUNT]; /* array of width values. */
LONG alData[COUNT]; /* array of width values. */



Latest revision as of 01:24, 17 November 2025

This function returns width table information for the logical font identified by the value of the character-set attribute.

Syntax

GpiQueryWidthTable(hps, lFirstChar, lCount, alData)

Parameters

hps (HPS) - input
Presentation-space handle.
lFirstChar (LONG) - input
Codepoint of first character.
The codepoint of the initial character, for which width-table information is required.
lCount (LONG) - input
Count of elements in alData.
The number that should be allowed for, so as to retrieve the full width table. Data for this font can be found by GpiQueryFontMetrics.
alData (PLONG) - output
Array of width values.
An array of lCount elements, in which width-table information is returned. No more than lCount elements are returned.

Return Value

rc (BOOL) - returns
Success indicator.
TRUE - Successful completion
FALSE - Error occurred.

Errors

Possible returns from WinGetLastError:

PMERR_INV_HPS (0x207F)
An invalid presentation-space handle was specified.
PMERR_PS_BUSY (0x20F4)
An attempt was made to access the presentation space from more than one thread simultaneously.
PMERR_INV_FIRST_CHAR (0x2071)
An invalid firstchar parameter was specified with GpiQueryWidthTable.
PMERR_INV_LENGTH_OR_COUNT (0x2092)
An invalid length or count parameter was specified.
PMERR_COORDINATE_OVERFLOW (0x2014)
An internal coordinate overflow error occurred. This can occur if coordinates or matrix transformation elements (or both) are invalid or too large.

Example Code

In this example the widths of the first 50 characters of the current font are obtained.

#define INCL_GPILCIDS
#include <OS2.H>

#define COUNT 50

HPS hps; /* Presentation-space handle. */
LONG alData[COUNT]; /* array of width values. */

GpiQueryWidthTable(hps, 0, COUNT, alData);