C API for paragraph layout.More...
Go to the source code of this file.
Typedefs | |
| typedef void | pl_paragraph |
| The opaque type for a paragraph layout.More... | |
| typedef void | pl_line |
| The opaque type for a line in a paragraph layout.More... | |
| typedef void | pl_visualRun |
| The opaque type for a visual run in a line.More... | |
Functions | |
| U_CAPIpl_paragraph * | pl_create (const LEUnicode chars[], le_int32 count, constpl_fontRuns *fontRuns, constpl_valueRuns *levelRuns, constpl_valueRuns *scriptRuns, constpl_localeRuns *localeRuns,UBiDiLevel paragraphLevel, le_bool vertical, LEErrorCode *status) |
Construct aParagraphLayout object for a styled paragraph.More... | |
| U_CAPI void | pl_close (pl_paragraph *paragraph) |
| Close the given paragraph layout object.More... | |
| U_CAPI le_bool | pl_isComplex (const LEUnicode chars[], le_int32 count) |
| Examine the given text and determine if it contains characters in any script which requires complex processing to be rendered correctly.More... | |
| U_CAPIUBiDiLevel | pl_getParagraphLevel (pl_paragraph *paragraph) |
| Return the resolved paragraph level.More... | |
| U_CAPIUBiDiDirection | pl_getTextDirection (pl_paragraph *paragraph) |
| Return the directionality of the text in the paragraph.More... | |
| U_CAPI le_int32 | pl_getAscent (constpl_paragraph *paragraph) |
| Return the max ascent value for all the fonts in the paragraph.More... | |
| U_CAPI le_int32 | pl_getDescent (constpl_paragraph *paragraph) |
| Return the max descent value for all the fonts in the paragraph.More... | |
| U_CAPI le_int32 | pl_getLeading (constpl_paragraph *paragraph) |
| Return the max leading value for all the fonts in the paragraph.More... | |
| U_CAPI void | pl_reflow (pl_paragraph *paragraph) |
| Reset line breaking to start from the beginning of the paragraph.More... | |
| U_CAPIpl_line * | pl_nextLine (pl_paragraph *paragraph, float width) |
Return apl_line object which represents next line in the paragraph.More... | |
| U_CAPI void | pl_closeLine (pl_line *line) |
| Close the given line object.More... | |
| U_CAPI le_int32 | pl_countLineRuns (constpl_line *line) |
| Count the number of visual runs in the line.More... | |
| U_CAPI le_int32 | pl_getLineAscent (constpl_line *line) |
| Get the ascent of the line.More... | |
| U_CAPI le_int32 | pl_getLineDescent (constpl_line *line) |
| Get the descent of the line.More... | |
| U_CAPI le_int32 | pl_getLineLeading (constpl_line *line) |
| Get the leading of the line.More... | |
| U_CAPI le_int32 | pl_getLineWidth (constpl_line *line) |
| Get the width of the line.More... | |
| U_CAPI constpl_visualRun * | pl_getLineVisualRun (constpl_line *line, le_int32 runIndex) |
Get aParagraphLayout::VisualRun object for a given visual run in the line.More... | |
| U_CAPI const le_font * | pl_getVisualRunFont (constpl_visualRun *run) |
Get thele_font object which represents the font of the visual run.More... | |
| U_CAPIUBiDiDirection | pl_getVisualRunDirection (constpl_visualRun *run) |
| Get the direction of the visual run.More... | |
| U_CAPI le_int32 | pl_getVisualRunGlyphCount (constpl_visualRun *run) |
| Get the number of glyphs in the visual run.More... | |
| U_CAPI const LEGlyphID * | pl_getVisualRunGlyphs (constpl_visualRun *run) |
| Get the glyphs in the visual run.More... | |
| U_CAPI const float * | pl_getVisualRunPositions (constpl_visualRun *run) |
| Get the (x, y) positions of the glyphs in the visual run.More... | |
| U_CAPI const le_int32 * | pl_getVisualRunGlyphToCharMap (constpl_visualRun *run) |
| Get the glyph-to-character map for this visual run.More... | |
| U_CAPI le_int32 | pl_getVisualRunAscent (constpl_visualRun *run) |
| A convenience method which returns the ascent value for the font associated with this run.More... | |
| U_CAPI le_int32 | pl_getVisualRunDescent (constpl_visualRun *run) |
| A convenience method which returns the descent value for the font associated with this run.More... | |
| U_CAPI le_int32 | pl_getVisualRunLeading (constpl_visualRun *run) |
| A convenience method which returns the leading value for the font associated with this run.More... | |
C API for paragraph layout.
This is a technology preview. The API may change significantly.
Definition in fileplayout.h.
| typedef voidpl_line |
| typedef voidpl_paragraph |
| typedef voidpl_visualRun |
| U_CAPI void pl_close | ( | pl_paragraph * | paragraph | ) |
Close the given paragraph layout object.
| paragraph | thepl_paragraph object to be closed. Once this routine returns the object can no longer be referenced |
Close the given line object.
Line objects are created bypl_nextLine but it is the client's responsibility to close them by calling this routine.
| line | thepl_line object to close. |
Count the number of visual runs in the line.
| line | thepl_line object. |
| U_CAPIpl_paragraph* pl_create | ( | const LEUnicode | chars[], |
| le_int32 | count, | ||
| constpl_fontRuns * | fontRuns, | ||
| constpl_valueRuns * | levelRuns, | ||
| constpl_valueRuns * | scriptRuns, | ||
| constpl_localeRuns * | localeRuns, | ||
| UBiDiLevel | paragraphLevel, | ||
| le_bool | vertical, | ||
| LEErrorCode * | status | ||
| ) |
Construct aParagraphLayout object for a styled paragraph.
The paragraph is specified as runs of text all in the same font. AnLEFontInstance object and a limit offset are specified for each font run. The limit offset is the offset of the character immediately after the font run.
Clients can optionally specify directional runs and / or script runs. If these aren't specified they will be computed.
If any errors are encountered during construction,status will be set, and the object will be set to be empty.
| chars | is an array of the characters in the paragraph |
| count | is the number of characters in the paragraph. |
| fontRuns | a pointer to apl_fontRuns object representing the font runs. |
| levelRuns | is a pointer to apl_valueRuns object representing the directional levels. If this pointer inNULL the levels will be determined by running the Unicode Bidi algorithm. |
| scriptRuns | is a pointer to apl_valueRuns object representing script runs. If this pointer inNULL the script runs will be determined using the Unicode code points. |
| localeRuns | is a pointer to apl_localeRuns object representing locale runs. TheLocale objects are used to determine the language of the text. If this pointer isNULL the default locale will be used for all of the text. |
| paragraphLevel | is the directionality of the paragraph, as in the UBiDi object. |
| vertical | istrue if the paragraph should be set vertically. |
| status | will be set to any error code encountered during construction. |
pl_paragraph object. The object will remain valid untilpl_close is called.| U_CAPI le_int32 pl_getAscent | ( | constpl_paragraph * | paragraph | ) |
Return the max ascent value for all the fonts in the paragraph.
| paragraph | thepl_paragraph |
| U_CAPI le_int32 pl_getDescent | ( | constpl_paragraph * | paragraph | ) |
Return the max descent value for all the fonts in the paragraph.
| paragraph | thepl_paragraph |
| U_CAPI le_int32 pl_getLeading | ( | constpl_paragraph * | paragraph | ) |
Return the max leading value for all the fonts in the paragraph.
| paragraph | thepl_paragraph |
Get the ascent of the line.
This is the maximum ascent of all the fonts on the line.
| line | thepl_line object. |
Get the descent of the line.
This is the maximum descent of all the fonts on the line.
| line | thepl_line object. |
Get the leading of the line.
This is the maximum leading of all the fonts on the line.
| line | thepl_line object. |
| U_CAPI constpl_visualRun* pl_getLineVisualRun | ( | constpl_line * | line, |
| le_int32 | runIndex | ||
| ) |
Get aParagraphLayout::VisualRun object for a given visual run in the line.
| line | thepl_line object. |
| runIndex | is the index of the run, in visual order. |
pl_visualRun object representing the visual run. This object is owned by thepl_line object which created it, and will remain valid for as long as thepl_line object is valid.Get the width of the line.
This is a convenience method which returns the last X position of the last visual run in the line.
| line | thepl_line object. |
| U_CAPIUBiDiLevel pl_getParagraphLevel | ( | pl_paragraph * | paragraph | ) |
Return the resolved paragraph level.
This is useful for those cases where the bidi analysis has determined the level based on the first strong character in the paragraph.
| paragraph | thepl_paragraph |
| U_CAPIUBiDiDirection pl_getTextDirection | ( | pl_paragraph * | paragraph | ) |
Return the directionality of the text in the paragraph.
| paragraph | thepl_paragraph |
UBIDI_LTR if the text is all left to right,UBIDI_RTL if the text is all right to left, orUBIDI_MIXED if the text has mixed direction.| U_CAPI le_int32 pl_getVisualRunAscent | ( | constpl_visualRun * | run | ) |
A convenience method which returns the ascent value for the font associated with this run.
| run | thepl_visualRun object. |
| U_CAPI le_int32 pl_getVisualRunDescent | ( | constpl_visualRun * | run | ) |
A convenience method which returns the descent value for the font associated with this run.
| run | thepl_visualRun object. |
| U_CAPIUBiDiDirection pl_getVisualRunDirection | ( | constpl_visualRun * | run | ) |
Get the direction of the visual run.
| run | thepl_visualRun object. |
UBIDI_LTR if the run is left-to-right andUBIDI_RTL if the line is right-to-left.| U_CAPI const le_font* pl_getVisualRunFont | ( | constpl_visualRun * | run | ) |
Get thele_font object which represents the font of the visual run.
This will always be a non-composite font.
| run | thepl_visualRun object. |
le_font object which represents the font of the visual run.| U_CAPI le_int32 pl_getVisualRunGlyphCount | ( | constpl_visualRun * | run | ) |
Get the number of glyphs in the visual run.
| run | thepl_visualRun object. |
| U_CAPI const LEGlyphID* pl_getVisualRunGlyphs | ( | constpl_visualRun * | run | ) |
Get the glyphs in the visual run.
Glyphs with the values0xFFFE and0xFFFF should be ignored.
| run | thepl_visualRun object. |
pl_visualRun object and must not be deleted. It will remain valid as long as thepl_visualRun object is valid.| U_CAPI const le_int32* pl_getVisualRunGlyphToCharMap | ( | constpl_visualRun * | run | ) |
Get the glyph-to-character map for this visual run.
This maps the indices into the glyph array to indices into the character array used to create the paragraph.
| run | thepl_visualRun object. |
pl_visualRun object and must not be deleted. It will remain valid as long as thepl_visualRun object is valid.| U_CAPI le_int32 pl_getVisualRunLeading | ( | constpl_visualRun * | run | ) |
A convenience method which returns the leading value for the font associated with this run.
| run | thepl_visualRun object. |
| U_CAPI const float* pl_getVisualRunPositions | ( | constpl_visualRun * | run | ) |
Get the (x, y) positions of the glyphs in the visual run.
To simplify storage management, the x and y positions are stored in a single array with the x positions at even offsets in the array and the corresponding y position in the following odd offset. There is an extra (x, y) pair at the end of the array which represents the advance of the final glyph in the run.
| run | thepl_visualRun object. |
pl_visualRun object and must not be deleted. It will remain valid as long as thepl_visualRun object is valid.| U_CAPI le_bool pl_isComplex | ( | const LEUnicode | chars[], |
| le_int32 | count | ||
| ) |
Examine the given text and determine if it contains characters in any script which requires complex processing to be rendered correctly.
| chars | is an array of the characters in the paragraph |
| count | is the number of characters in the paragraph. |
true if any of the text requires complex processing.| U_CAPIpl_line* pl_nextLine | ( | pl_paragraph * | paragraph, |
| float | width | ||
| ) |
Return apl_line object which represents next line in the paragraph.
The width of the line is specified each time so that it can be varied to support arbitrary paragraph shapes.
| paragraph | thepl_paragraph |
| width | is the width of the line. Ifwidth is less than or equal to zero, aParagraphLayout::Line object representing the rest of the paragraph will be returned. |
ParagraphLayout::Line object which represents the line. The caller is responsible for deleting the object. ReturnsNULL if there are no more lines in the paragraph.| U_CAPI void pl_reflow | ( | pl_paragraph * | paragraph | ) |
Reset line breaking to start from the beginning of the paragraph.
| paragraph | thepl_paragraph |