ICU 78.1 78.1 |
#include <ParagraphLayout.h>

Data Structures | |
| class | Line |
This class represents a single line of text in aParagraphLayout.More... | |
| class | VisualRun |
| This object represents a single visual run in a line of text in a paragraph.More... | |
Public Member Functions | |
| ParagraphLayout (const LEUnicode chars[], le_int32 count, constFontRuns *fontRuns, constValueRuns *levelRuns, constValueRuns *scriptRuns, constLocaleRuns *localeRuns,UBiDiLevel paragraphLevel, le_bool vertical, LEErrorCode &status) | |
Construct aParagraphLayout object for a styled paragraph.More... | |
| ~ParagraphLayout () | |
| The destructor.More... | |
| UBiDiLevel | getParagraphLevel () |
| Return the resolved paragraph level.More... | |
| UBiDiDirection | getTextDirection () |
| Return the directionality of the text in the paragraph.More... | |
| virtual le_int32 | getAscent () const |
| Return the max ascent value for all the fonts in the paragraph.More... | |
| virtual le_int32 | getDescent () const |
| Return the max descent value for all the fonts in the paragraph.More... | |
| virtual le_int32 | getLeading () const |
| Return the max leading value for all the fonts in the paragraph.More... | |
| void | reflow () |
| Reset line breaking to start from the beginning of the paragraph.More... | |
| le_bool | isDone () const |
| Convenience method for determining if paragraph layout processing is complete ( i.e.More... | |
| Line * | nextLine (float width) |
Return aParagraphLayout::Line object which represents next line in the paragraph.More... | |
| UClassID | getDynamicClassID () const override |
| ICU "poor man's RTTI", returns a UClassID for the actual class.More... | |
Public Member Functions inherited fromicu::UObject | |
| virtual | ~UObject () |
| Destructor.More... | |
Static Public Member Functions | |
| static le_bool | 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... | |
| staticUClassID | getStaticClassID () |
| ICU "poor man's RTTI", returns a UClassID for this class.More... | |
TheParagraphLayout object will analyze the text into runs of text in the same font, script and direction, and will create aLayoutEngine object for each run. TheLayoutEngine will transform the characters into glyph codes in visual order.
Clients can use this to break a paragraph into lines, and to display the glyphs in each line.
Note that the ICU layout engine has been deprecated and removed. You may use this class with the HarfBuzz icu-le-hb wrapper, seehttp://www.freedesktop.org/wiki/Software/HarfBuzz/
Seehttps://unicode-org.github.io/icu/userguide/layoutengine for special build instructions.
Definition at line51 of fileParagraphLayout.h.
| icu::ParagraphLayout::ParagraphLayout | ( | const LEUnicode | chars[], |
| le_int32 | count, | ||
| constFontRuns * | fontRuns, | ||
| constValueRuns * | levelRuns, | ||
| constValueRuns * | scriptRuns, | ||
| constLocaleRuns * | 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 aFontRuns object representing the font runs. |
| levelRuns | is a pointer to aValueRuns object representing the directional levels. If this pointer innullptr the levels will be determined by running the Unicode Bidi algorithm. |
| scriptRuns | is a pointer to aValueRuns object representing script runs. If this pointer innullptr the script runs will be determined using the Unicode code points. |
| localeRuns | is a pointer to aLocaleRuns object representing locale runs. TheLocale objects are used to determine the language of the text. If this pointer isnullptr 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. |
| icu::ParagraphLayout::~ParagraphLayout | ( | ) |
| virtual |
Return the max ascent value for all the fonts in the paragraph.
| virtual |
Return the max descent value for all the fonts in the paragraph.
| inlineoverridevirtual |
ICU "poor man's RTTI", returns a UClassID for the actual class.
Reimplemented fromicu::UObject.
Definition at line553 of fileParagraphLayout.h.
| virtual |
Return the max leading value for all the fonts in the paragraph.
| inline |
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.
Definition at line648 of fileParagraphLayout.h.
Referencesubidi_getParaLevel().
| inlinestatic |
ICU "poor man's RTTI", returns a UClassID for this class.
Definition at line546 of fileParagraphLayout.h.
| inline |
Return the directionality of the text in the 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.Definition at line653 of fileParagraphLayout.h.
Referencesubidi_getDirection().
| static |
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.
| inline |
Convenience method for determining if paragraph layout processing is complete ( i.e.
there are no more lines left to process. )
| Line* icu::ParagraphLayout::nextLine | ( | float | width | ) |
Return aParagraphLayout::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.
| 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. Returnsnullptr if there are no more lines in the paragraph.
| inline |
Reset line breaking to start from the beginning of the paragraph.
Definition at line658 of fileParagraphLayout.h.