10 #ifndef __PARAGRAPHLAYOUT_H 12 #define __PARAGRAPHLAYOUT_H 24 #if ! UCONFIG_NO_BREAK_ITERATION 26 #include "layout/LETypes.h" 27 #include "layout/LEFontInstance.h" 28 #include "layout/LayoutEngine.h" 89 inline le_int32 countRuns()
const;
99 le_int32 getAscent()
const;
109 le_int32 getDescent()
const;
119 le_int32 getLeading()
const;
130 le_int32 getWidth()
const;
147 const VisualRun *getVisualRun(le_int32 runIndex)
const;
169 static const char fgClassID;
178 le_int32 fRunCapacity;
184 inline Line &operator=(
const Line & ) {
return *
this; };
186 void computeMetrics();
188 void append(
const LEFontInstance *font,
UBiDiDirection direction, le_int32 glyphCount,
189 const LEGlyphID glyphs[],
const float positions[],
const le_int32 glyphToCharMap[]);
222 inline const LEFontInstance *getFont()
const;
241 inline le_int32 getGlyphCount()
const;
253 inline const LEGlyphID *getGlyphs()
const;
268 inline const float *getPositions()
const;
280 inline const le_int32 *getGlyphToCharMap()
const;
290 inline le_int32 getAscent()
const;
300 inline le_int32 getDescent()
const;
310 inline le_int32 getLeading()
const;
332 static const char fgClassID;
334 const LEFontInstance *fFont;
337 const le_int32 fGlyphCount;
339 const LEGlyphID *fGlyphs;
340 const float *fPositions;
341 const le_int32 *fGlyphToCharMap;
350 const LEGlyphID glyphs[],
const float positions[],
const le_int32 glyphToCharMap[]);
404 LEErrorCode &status);
433 static le_bool isComplex(
const LEUnicode chars[], le_int32 count,
const FontRuns *fontRuns);
447 static le_bool isComplex(
const LEUnicode chars[], le_int32 count);
481 virtual le_int32 getAscent()
const;
491 virtual le_int32 getDescent()
const;
501 virtual le_int32 getLeading()
const;
509 inline void reflow();
511 #ifndef U_HIDE_INTERNAL_API 521 inline le_bool isDone()
const;
541 Line *nextLine(
float width);
564 static const char fgClassID;
568 LayoutEngine *engine;
569 const LEFontInstance *font;
585 void computeLevels(
UBiDiLevel paragraphLevel);
587 Line *computeVisualRuns();
588 void appendRun(
Line *line, le_int32 run, le_int32 firstChar, le_int32 lastChar);
590 void computeScripts();
592 void computeLocales();
594 void computeSubFonts(
const FontRuns *fontRuns, LEErrorCode &status);
596 void computeMetrics();
598 le_int32 getLanguageCode(
const Locale *locale);
600 le_int32 getCharRun(le_int32 charIndex);
604 le_int32 previousBreak(le_int32 charIndex);
607 const LEUnicode *fChars;
616 le_bool fClientLevels;
617 le_bool fClientScripts;
618 le_bool fClientLocales;
626 le_int32 *fGlyphToCharMap;
627 le_int32 *fCharToMinGlyphMap;
628 le_int32 *fCharToMaxGlyphMap;
630 le_int32 fGlyphCount;
635 le_int32 *fStyleRunLimits;
636 le_int32 *fStyleIndices;
637 StyleRunInfo *fStyleRunInfo;
638 le_int32 fStyleRunCount;
644 le_int32 fFirstVisualRun;
645 le_int32 fLastVisualRun;
646 float fVisualRunLastX;
647 float fVisualRunLastY;
660 inline void ParagraphLayout::reflow()
665 inline ParagraphLayout::Line::Line()
666 :
UObject(), fAscent(0), fDescent(0), fLeading(0), fRunCount(0), fRunCapacity(0), fRuns(
NULL)
671 inline ParagraphLayout::Line::Line(
const Line & )
672 :
UObject(), fAscent(0), fDescent(0), fLeading(0), fRunCount(0), fRunCapacity(0), fRuns(
NULL)
677 inline le_int32 ParagraphLayout::Line::countRuns()
const 682 inline const LEFontInstance *ParagraphLayout::VisualRun::getFont()
const 692 inline le_int32 ParagraphLayout::VisualRun::getGlyphCount()
const 697 inline const LEGlyphID *ParagraphLayout::VisualRun::getGlyphs()
const 702 inline const float *ParagraphLayout::VisualRun::getPositions()
const 707 inline const le_int32 *ParagraphLayout::VisualRun::getGlyphToCharMap()
const 709 return fGlyphToCharMap;
712 inline le_int32 ParagraphLayout::VisualRun::getAscent()
const 714 return fFont->getAscent();
717 inline le_int32 ParagraphLayout::VisualRun::getDescent()
const 719 return fFont->getDescent();
722 inline le_int32 ParagraphLayout::VisualRun::getLeading()
const 724 return fFont->getLeading();
727 inline ParagraphLayout::VisualRun::VisualRun()
733 inline ParagraphLayout::VisualRun::VisualRun(
const VisualRun &)
739 inline ParagraphLayout::VisualRun::VisualRun(
const LEFontInstance *font,
UBiDiDirection direction, le_int32 glyphCount,
740 const LEGlyphID glyphs[],
const float positions[],
const le_int32 glyphToCharMap[])
741 : fFont(font), fDirection(direction), fGlyphCount(glyphCount),
742 fGlyphs(glyphs), fPositions(positions), fGlyphToCharMap(glyphToCharMap)
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
UScriptCode
Constants for ISO 15924 script codes.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
uint8_t UBiDiLevel
UBiDiLevel is the type of the level values in this Bidi implementation.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
The FontRuns class associates pointers to LEFontInstance objects with runs of text.
The LocaleRuns class associates pointers to Locale objects with runs of text.
This object represents a single visual run in a line of text in a paragraph.
C API: Unicode Script Information.
UBiDiDirection
UBiDiDirection values indicate the text direction.
This class represents a single line of text in a ParagraphLayout.
UBiDiDirection ubidi_getDirection(const UBiDi *pBiDi)
Get the directionality of the text.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
The BreakIterator class implements methods for finding the location of boundaries in text...
#define NULL
Define NULL if necessary, to nullptr for C++ and to ((void *)0) for C.
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_LAYOUTEX_API
Set to export library symbols from inside the layout extensions library, and to import them from outs...
C++ API: base class for building classes which represent data that is associated with runs of text...
The ValueRuns class associates integer values with runs of text.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
UObject is the common ICU "boilerplate" class.
A Locale object represents a specific geographical, political, or cultural region.