+ le_int32 startRun = findRun(fontRuns, start);
+ le_int32 endRun = findRun(fontRuns, limit - 1);
+
+ sub->reset();
+
+ for (le_int32 run = startRun; run <= endRun; run += 1) {
+ const LEFontInstance *runFont = fontRuns->getFont(run);
+ le_int32 runLimit = fontRuns->getLimit(run) - start;
+
+ if (run == endRun) {
+ runLimit = limit - start;
+ }
+
+ sub->add(runFont, runLimit);
+ }
+}
+
+Paragraph::Paragraph(const LEUnicode chars[], int32_t charCount, const FontRuns *fontRuns, LEErrorCode &status)
+ : fParagraphLayout(NULL), fParagraphCount(0), fParagraphMax(PARA_GROW), fParagraphGrow(PARA_GROW),
+ fLineCount(0), fLinesMax(LINE_GROW), fLinesGrow(LINE_GROW), fLines(NULL), fChars(NULL),
+ fLineHeight(-1), fAscent(-1), fWidth(-1), fHeight(-1), fParagraphLevel(UBIDI_DEFAULT_LTR)
+{
+ static const LEUnicode separators[] = {CH_LF, CH_CR, CH_LSEP, CH_PSEP, 0x0000};
+
+ if (LE_FAILURE(status)) {
+ return;
+ }
+
+ le_int32 ascent = 0;
+ le_int32 descent = 0;
+ le_int32 leading = 0;
+
+ LocaleRuns *locales = NULL;
+ FontRuns fr(0);
+
+ fLines = LE_NEW_ARRAY(const ParagraphLayout::Line *, fLinesMax);
+ fParagraphLayout = LE_NEW_ARRAY(ParagraphLayout *, fParagraphMax);
+
+ fChars = LE_NEW_ARRAY(LEUnicode, charCount + 1);