Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
3/28/2014
This function generates glyphs and visual attributes for a Unicode run with OpenType information, using the output of the ScriptShapeOpenType function.
Syntax
HRESULT ScriptPlaceOpenType(
HDC hdc,
SCRIPT_CACHE* psc,
SCRIPT_ANALYSIS* psa,
OPENTYPE_TAG tagScript,
OPENTYPE_TAG tagLangSys,
int* rcRangeChars,
TEXTRANGE_PROPERTIES** rpRangeProperties,
int cRanges,
const WCHAR* pwcChars,
const WORD* pwLogClust,
const SCRIPT_CHARPROP* pCharProps,
int cChars,
const WORD* pwGlyphs,
const SCRIPT_GLYPHPROP* pGlyphProps,
int cGlyphs,
int* piAdvance,
GOFFSET* pGoffset,
ABC* pABC,
);
Parameters
- hdc
[in] Optional. Handle to the device context.
- psc
[in/out] Pointer to a SCRIPT_CACHE structure identifying the script cache.
psa
[in] Pointer to a SCRIPT_ANALYSIS structure obtained from a previous call to ScriptItemizeOpenType. This structure identifies the shaping engine that governs the generated list of glyphs and their associated widths, and x and y placement offsets.Alternatively, an application can supply a null pointer to receive unfiltered results.
- tagScript
[in] An OPENTYPE_TAG structure containing the OpenType script tag for the writing system to use.
- tagLangSys
[in] An OPENTYPE_TAG structure containing the OpenType language tag for the writing system.
- rcRangeChars
[in] Array of the number of characters in each range. The number of members is in the cRanges parameter. The total of values in rcRangeChars should equal cChars.
- rpRangeProperties
[in] Array of range properties for each range. The number of rpRangeProperties elements is defined by the cRanges parameter.
- cRanges
[in] The number of OpenType feature ranges.
- pwcChars
[in] Pointer to an array of Unicode characters containing the run. The number of pwcChars elements is defined by the cRanges parameter.
- pwLogClust
[in] Pointer to an array of logical-cluster information. Each element in the array corresponds to a character in the array defined by pwcChars. The value of each element is the offset from the first glyph in the run to the first glyph in the cluster containing the corresponding character. Note that when the fRTL member of the SCRIPT_ANALYSIS structure is set to TRUE, the elements in pwLogClust decrease as the array is read.
- pCharProps
[in] Pointer to an array of character-property values in the Unicode run.
- cChars
[in] Number of characters in the Unicode run.
- pwGlyphs
[in] Pointer to a glyph buffer obtained from an earlier call to the ScriptShapeOpenType function.
- pGlyphProps
[in] Pointer to an array of attributes for each of the glyphs to retrieve. The number of values equals cGlyphs. Since there is one glyph property per glyph, this parameter has the number of elements indicated by cGlyphs.
- cGlyphs
[in] Count of glyphs in a glyph array buffer.
- piAdvance
[out] Pointer to an array, of length cGlyphs, in which this function retrieves advance width information.
- pGoffset
[out] Pointer to an array of GOFFSET structures in which this structure retrieves the x and y offsets of combining glyphs. This array must be of length cGlyphs.
- pABC
[out] Pointer to an ABC structure in which this function retrieves the ABC width for the entire run.
Return Values
If the function is successful, it returns 0. If it does not succeed, it returns a nonzero HRESULT value. In all error cases, the output values are undefined. The application can test the return value with the SUCCEEDED and FAILED macros.
The function returns E_OUTOFMEMORY if the output-buffer length indicated by cGlyphs is too small. The application can call the function again with larger buffers.
The function returns E_PENDING if the script cache specified by the psc parameter does not contain enough information to place the glyphs, and the hdc parameter is passed as null so that the function is unable to complete the placement process. The application should set up a correct device context for the run, and call this function again with the appropriate value in hdc and with all other parameters the same.
Remarks
This function is preferred over the older ScriptPlace function. Some advantages of ScriptPlaceOpenType include the following:
- Parameters directly correspond to OpenType tags in font-layout tables.
- Parameters define features applied to each character. Input is divided into ranges, and each range has OpenType properties associated with it.
The composite ABC width for the whole item identifies how much the glyphs overhang to the left of the start position and to the right of the length implied by the sum of the advance widths. The total advance width of the line is exactly abcA+abcB+abcC. The abcA and abcC values are maintained as proportions of the cell height represented in 8 bits and are thus roughly +/-1 percent. The total width retrieved, which is the sum of the abcA+abcB+abcC values indicated by piAdvance, is accurate to the resolution of the TrueType shaping engine.
All arrays are in visual order unless the fLogicalOrder member is set in the SCRIPT_ANALYSIS structure indicated by the psa parameter.
Requirements
Header |
usp10.h |
Library |
Uspce.lib |
See Also
Reference
Uniscribe Functions
ScriptItemizeOpenType
ScriptPlace
ScriptShapeOpenType
GOFFSET
OPENTYPE_TAG
SCRIPT_ANALYSIS
SCRIPT_CACHE