次の方法で共有


ScriptLayout (Windows Embedded CE 6.0)

1/6/2010

This function converts an array of run-embedding levels to a map of visual-to-logical position and/or logical-to-visual position.

Syntax

HRESULT WINAPI ScriptLayout(
  int cRuns, 
  const BYTE* pbLevel, 
  int* piVisualToLogical, 
  int* piLogicalToVisual 
);

Parameters

  • cRuns
    [in] Number of runs to process.
  • pbLevel
    [in] Pointer to an array of run-embedding levels.
  • piVisualToLogical
    [out] Pointer to an array that receives the run levels reordered to visual order.
  • piLogicalToVisual
    [out] Pointer to an array that receives the visual run positions.

Return Value

If the function succeeds, the return value is zero.

If the function fails, it returns a nonzero value. If any other unrecoverable error is encountered, it is returned as an HRESULT.

Remarks

The run-embedding levels, defined in the Unicode bidirectional algorithm, describe the direction of a run, the direction of any runs it is embedded in, and the direction of the paragraph.

Level Description

0

A left-to-right run in a left-to-right paragraph.

1

A right-to-left run embedded in a left-to-right run in a left-to-right paragraph, or

a right-to-left run (not embedded in another run) in a right-to-left paragraph.

2

A left-to-right run embedded in a right-to-left run of type 1.

3

A right-to-left run embedded in a left-to-right run of type 2.

etc.

The embedding levels can continue as far as necessary.

The logical position refers to the placement of a run relative to other runs. It is the position in backing store, and corresponds to the order in which you would read the text aloud. The visual position of a run is the way the run is visually displayed on the line, taking into account the possible directions of each run.

The pbLevel parameter must contain the embedding levels for all runs on the line, ordered logically.

On output, piVisualToLogical[0] is the logical index of the run to display at the far left. Subsequent entries should be displayed progressing from left-to-right.

The piLogicalToVisual[0] parameter is the relative visual position where the first logical run should be displayed, the leftmost display position being zero.

The caller may request either piLogicalToVisual or piVisualToLogicalI, or both.

Note that no other input is required because the embedding levels give all necessary information for layout.

Requirements

Header usp10.h
Library Uspce.lib
Windows Embedded CE Windows CE 5.0 and later

See Also

Other Resources

Uniscribe Functions