Go to the documentation of this file.
8 #ifndef __PARAGRAPHLAYOUT_H
10 #define __PARAGRAPHLAYOUT_H
22 #if ! UCONFIG_NO_BREAK_ITERATION
167 static const char fgClassID;
182 inline Line &operator=(
const Line & ) {
return *
this; };
184 void computeMetrics();
187 const LEGlyphID glyphs[],
const float positions[],
const le_int32 glyphToCharMap[]);
239 inline le_int32 getGlyphCount()
const;
251 inline const LEGlyphID *getGlyphs()
const;
266 inline const float *getPositions()
const;
278 inline const le_int32 *getGlyphToCharMap()
const;
330 static const char fgClassID;
338 const float *fPositions;
348 const LEGlyphID glyphs[],
const float positions[],
const le_int32 glyphToCharMap[]);
507 inline void reflow();
509 #ifndef U_HIDE_INTERNAL_API
562 static const char fgClassID;
579 ParagraphLayout() {};
580 ParagraphLayout(
const ParagraphLayout & ) : UObject( ){};
581 inline ParagraphLayout &operator=(
const ParagraphLayout & ) {
return *
this; };
583 void computeLevels(
UBiDiLevel paragraphLevel);
585 Line *computeVisualRuns();
588 void computeScripts();
590 void computeLocales();
592 void computeSubFonts(
const FontRuns *fontRuns,
LEErrorCode &status);
594 void computeMetrics();
596 le_int32 getLanguageCode(
const Locale *locale);
608 const FontRuns *fFontRuns;
609 const ValueRuns *fLevelRuns;
610 const ValueRuns *fScriptRuns;
611 const LocaleRuns *fLocaleRuns;
635 StyleRunInfo *fStyleRunInfo;
638 BreakIterator *fBreakIterator;
644 float fVisualRunLastX;
645 float fVisualRunLastY;
658 inline void ParagraphLayout::reflow()
663 inline ParagraphLayout::Line::Line()
664 :
UObject(), fAscent(0), fDescent(0), fLeading(0), fRunCount(0), fRunCapacity(0), fRuns(
NULL)
669 inline ParagraphLayout::Line::Line(
const Line & )
670 : UObject(), fAscent(0), fDescent(0), fLeading(0), fRunCount(0), fRunCapacity(0), fRuns(
NULL)
707 return fGlyphToCharMap;
712 return fFont->getAscent();
717 return fFont->getDescent();
722 return fFont->getLeading();
725 inline ParagraphLayout::VisualRun::VisualRun()
731 inline ParagraphLayout::VisualRun::VisualRun(
const VisualRun &)
737 inline ParagraphLayout::VisualRun::VisualRun(
const LEFontInstance *font,
UBiDiDirection direction,
le_int32 glyphCount,
738 const LEGlyphID glyphs[],
const float positions[],
const le_int32 glyphToCharMap[])
739 : fFont(font), fDirection(direction), fGlyphCount(glyphCount),
740 fGlyphs(glyphs), fPositions(positions), fGlyphToCharMap(glyphToCharMap)
virtual le_int32 getDescent() const
Return the max descent value for all the fonts in the paragraph.
le_int32 getAscent() const
Get the ascent of the line.
le_int32 countRuns() const
Count the number of visual runs in the line.
#define U_LAYOUTEX_API
Set to export library symbols from inside the layout extensions library, and to import them from outs...
uint8_t UBiDiLevel
UBiDiLevel is the type of the level values in this Bidi implementation.
const le_int32 * getGlyphToCharMap() const
Get the glyph-to-character map for this visual run.
C API: Unicode Script Information.
UScriptCode
Constants for ISO 15924 script codes.
le_int32 getDescent() const
Get the descent of the line.
Line * nextLine(float width)
Return a ParagraphLayout::Line object which represents next line in the paragraph.
UBiDiDirection getDirection() const
Get the direction of the visual run.
~ParagraphLayout()
The destructor.
virtual le_int32 getLeading() const
Return the max leading value for all the fonts in the paragraph.
This object represents a single visual run in a line of text in a paragraph.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
le_int32 getAscent() const
A convenience method which returns the ascent value for the font associated with this run.
const LEFontInstance * getFont() const
Get the LEFontInstance object which represents the font of the visual run.
This class represents a single line of text in a ParagraphLayout.
#define NULL
Define NULL if necessary, to 0 for C++ and to ((void *)0) for C.
ParagraphLayout(const LEUnicode chars[], le_int32 count, const FontRuns *fontRuns, const ValueRuns *levelRuns, const ValueRuns *scriptRuns, const LocaleRuns *localeRuns, UBiDiLevel paragraphLevel, le_bool vertical, LEErrorCode &status)
Construct a ParagraphLayout object for a styled paragraph.
int32_t le_int32
A type used for signed, 32-bit integers.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
le_int32 getLeading() const
Get the leading of the line.
NOTE: This class is deprecated, please instead use HarfBuzz.
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 p...
le_int32 getDescent() const
A convenience method which returns the descent value for the font associated with this run.
The ValueRuns class associates integer values with runs of text.
UBool le_bool
A type used for boolean values.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
UObject is the common ICU "boilerplate" class.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
The LocaleRuns class associates pointers to Locale objects with runs of text.
The FontRuns class associates pointers to LEFontInstance objects with runs of text.
LEErrorCode
Error codes returned by the LayoutEngine.
C++ API: DEPRECATED: Virtual base class for complex text layout.
le_int32 getWidth() const
Get the width of the line.
le_bool isDone() const
Convenience method for determining if paragraph layout processing is complete ( i....
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
@ UBIDI_LTR
Left-to-right text.
UBiDiDirection
UBiDiDirection values indicate the text direction.
UChar LEUnicode
Used to represent 16-bit Unicode code points.
This is a virtual base class that serves as the interface between a LayoutEngine and the platform fon...
C++ API: Layout Engine Font Instance object.
const VisualRun * getVisualRun(le_int32 runIndex) const
Get a ParagraphLayout::VisualRun object for a given visual run in the line.
le_int32 getGlyphCount() const
Get the number of glyphs in the visual run.
~Line()
The constructor is private since these objects can only be created by ParagraphLayout.
const LEGlyphID * getGlyphs() const
Get the glyphs in the visual run.
C++ API: base class for building classes which represent data that is associated with runs of text.
const float * getPositions() const
Get the (x, y) positions of the glyphs in the visual run.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
UBiDiDirection ubidi_getDirection(const UBiDi *pBiDi)
Get the directionality of the text.
UBiDiLevel ubidi_getParaLevel(const UBiDi *pBiDi)
Get the paragraph level of the text.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
virtual le_int32 getAscent() const
Return the max ascent value for all the fonts in the paragraph.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
A Locale object represents a specific geographical, political, or cultural region.
le_int32 getLeading() const
A convenience method which returns the leading value for the font associated with this run.
C API: Basic definitions for the ICU LayoutEngine.
le_uint32 LEGlyphID
Used for glyph indices.