3 * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
8 * paragraphLayout doesn't make much sense without
11 #include "layout/LETypes.h"
12 #include "layout/loengine.h"
13 #include "layout/plruns.h"
14 #include "layout/playout.h"
16 #include "unicode/locid.h"
18 #include "layout/LayoutEngine.h"
19 #include "layout/ParagraphLayout.h"
21 #if ! UCONFIG_NO_BREAK_ITERATION
25 U_CAPI pl_paragraph
* U_EXPORT2
26 pl_create(const LEUnicode chars
[],
28 const pl_fontRuns
*fontRuns
,
29 const pl_valueRuns
*levelRuns
,
30 const pl_valueRuns
*scriptRuns
,
31 const pl_localeRuns
*localeRuns
,
32 UBiDiLevel paragraphLevel
,
36 ParagraphLayout
*pl
= new ParagraphLayout(chars
, count
, (const FontRuns
*) fontRuns
,
37 (const ValueRuns
*) levelRuns
, (const ValueRuns
*) scriptRuns
, (const LocaleRuns
*) localeRuns
,
38 paragraphLevel
, vertical
, *status
);
40 return (pl_paragraph
*) pl
;
44 pl_close(pl_paragraph
*paragraph
)
46 ParagraphLayout
*pl
= (ParagraphLayout
*) paragraph
;
51 U_CAPI le_bool U_EXPORT2
52 pl_isComplex(const LEUnicode chars
[],
55 return ParagraphLayout::isComplex(chars
, count
);
58 U_CAPI UBiDiLevel U_EXPORT2
59 pl_getParagraphLevel(pl_paragraph
*paragraph
)
61 ParagraphLayout
*pl
= (ParagraphLayout
*) paragraph
;
67 return pl
->getParagraphLevel();
70 U_CAPI UBiDiDirection U_EXPORT2
71 pl_getTextDirection(pl_paragraph
*paragraph
)
73 ParagraphLayout
*pl
= (ParagraphLayout
*) paragraph
;
79 return pl
->getTextDirection();
82 U_CAPI le_int32 U_EXPORT2
83 pl_getAscent(const pl_paragraph
*paragraph
)
85 ParagraphLayout
*pl
= (ParagraphLayout
*) paragraph
;
91 return pl
->getAscent();
94 U_CAPI le_int32 U_EXPORT2
95 pl_getDescent(const pl_paragraph
*paragraph
)
97 ParagraphLayout
*pl
= (ParagraphLayout
*) paragraph
;
103 return pl
->getDescent();
106 U_CAPI le_int32 U_EXPORT2
107 pl_getLeading(const pl_paragraph
*paragraph
)
109 ParagraphLayout
*pl
= (ParagraphLayout
*) paragraph
;
115 return pl
->getLeading();
118 U_CAPI
void U_EXPORT2
119 pl_reflow(pl_paragraph
*paragraph
)
121 ParagraphLayout
*pl
= (ParagraphLayout
*) paragraph
;
130 U_CAPI pl_line
* U_EXPORT2
131 pl_nextLine(pl_paragraph
*paragraph
, float width
)
133 ParagraphLayout
*pl
= (ParagraphLayout
*) paragraph
;
139 return (pl_line
*) pl
->nextLine(width
);
142 U_CAPI
void U_EXPORT2
143 pl_closeLine(pl_line
*line
)
145 ParagraphLayout::Line
*ll
= (ParagraphLayout::Line
*) line
;
150 U_CAPI le_int32 U_EXPORT2
151 pl_countLineRuns(const pl_line
*line
)
153 ParagraphLayout::Line
*ll
= (ParagraphLayout::Line
*) line
;
159 return ll
->countRuns();
162 U_CAPI le_int32 U_EXPORT2
163 pl_getLineAscent(const pl_line
*line
)
165 ParagraphLayout::Line
*ll
= (ParagraphLayout::Line
*) line
;
171 return ll
->getAscent();
174 U_CAPI le_int32 U_EXPORT2
175 pl_getLineDescent(const pl_line
*line
)
177 ParagraphLayout::Line
*ll
= (ParagraphLayout::Line
*) line
;
183 return ll
->getDescent();
186 U_CAPI le_int32 U_EXPORT2
187 pl_getLineLeading(const pl_line
*line
)
189 ParagraphLayout::Line
*ll
= (ParagraphLayout::Line
*) line
;
195 return ll
->getLeading();
198 U_CAPI le_int32 U_EXPORT2
199 pl_getLineWidth(const pl_line
*line
)
201 ParagraphLayout::Line
*ll
= (ParagraphLayout::Line
*) line
;
207 return ll
->getWidth();
210 U_CAPI
const pl_visualRun
* U_EXPORT2
211 pl_getLineVisualRun(const pl_line
*line
, le_int32 runIndex
)
213 ParagraphLayout::Line
*ll
= (ParagraphLayout::Line
*) line
;
219 return (pl_visualRun
*) ll
->getVisualRun(runIndex
);
222 U_CAPI
const le_font
* U_EXPORT2
223 pl_getVisualRunFont(const pl_visualRun
*run
)
225 ParagraphLayout::VisualRun
*vr
= (ParagraphLayout::VisualRun
*) run
;
231 return (const le_font
*) vr
->getFont();
234 U_CAPI UBiDiDirection U_EXPORT2
235 pl_getVisualRunDirection(const pl_visualRun
*run
)
237 ParagraphLayout::VisualRun
*vr
= (ParagraphLayout::VisualRun
*) run
;
243 return vr
->getDirection();
246 U_CAPI le_int32 U_EXPORT2
247 pl_getVisualRunGlyphCount(const pl_visualRun
*run
)
249 ParagraphLayout::VisualRun
*vr
= (ParagraphLayout::VisualRun
*) run
;
255 return vr
->getGlyphCount();
258 U_CAPI
const LEGlyphID
* U_EXPORT2
259 pl_getVisualRunGlyphs(const pl_visualRun
*run
)
261 ParagraphLayout::VisualRun
*vr
= (ParagraphLayout::VisualRun
*) run
;
267 return vr
->getGlyphs();
270 U_CAPI
const float * U_EXPORT2
271 pl_getVisualRunPositions(const pl_visualRun
*run
)
273 ParagraphLayout::VisualRun
*vr
= (ParagraphLayout::VisualRun
*) run
;
279 return vr
->getPositions();
282 U_CAPI
const le_int32
* U_EXPORT2
283 pl_getVisualRunGlyphToCharMap(const pl_visualRun
*run
)
285 ParagraphLayout::VisualRun
*vr
= (ParagraphLayout::VisualRun
*) run
;
291 return vr
->getGlyphToCharMap();
294 U_CAPI le_int32 U_EXPORT2
295 pl_getVisualRunAscent(const pl_visualRun
*run
)
297 ParagraphLayout::VisualRun
*vr
= (ParagraphLayout::VisualRun
*) run
;
303 return vr
->getAscent();
306 U_CAPI le_int32 U_EXPORT2
307 pl_getVisualRunDescent(const pl_visualRun
*run
)
309 ParagraphLayout::VisualRun
*vr
= (ParagraphLayout::VisualRun
*) run
;
315 return vr
->getDescent();
318 U_CAPI le_int32 U_EXPORT2
319 pl_getVisualRunLeading(const pl_visualRun
*run
)
321 ParagraphLayout::VisualRun
*vr
= (ParagraphLayout::VisualRun
*) run
;
327 return vr
->getLeading();