12e5b6d6dSopenharmony_ci---
22e5b6d6dSopenharmony_cilayout: default
32e5b6d6dSopenharmony_cititle: Paragraph Layout
42e5b6d6dSopenharmony_cinav_order: 1
52e5b6d6dSopenharmony_ciparent: Layout Engine
62e5b6d6dSopenharmony_ci---
72e5b6d6dSopenharmony_ci<!--
82e5b6d6dSopenharmony_ci© 2020 and later: Unicode, Inc. and others.
92e5b6d6dSopenharmony_ciLicense & terms of use: http://www.unicode.org/copyright.html
102e5b6d6dSopenharmony_ci-->
112e5b6d6dSopenharmony_ci
122e5b6d6dSopenharmony_ci# Paragraph Layout
132e5b6d6dSopenharmony_ci{: .no_toc }
142e5b6d6dSopenharmony_ci
152e5b6d6dSopenharmony_ci## Contents
162e5b6d6dSopenharmony_ci{: .no_toc .text-delta }
172e5b6d6dSopenharmony_ci
182e5b6d6dSopenharmony_ci1. TOC
192e5b6d6dSopenharmony_ci{:toc}
202e5b6d6dSopenharmony_ci
212e5b6d6dSopenharmony_ci---
222e5b6d6dSopenharmony_ci
232e5b6d6dSopenharmony_ci# Overview
242e5b6d6dSopenharmony_ci
252e5b6d6dSopenharmony_ciThis page is about the Paragraph Layout library that is available in ICU4C/C++.
262e5b6d6dSopenharmony_ci
272e5b6d6dSopenharmony_ciFor information about the deprecated Line Layout Engine, including its deprecation notice,
282e5b6d6dSopenharmony_cisee: [Layout Engine](index.md).
292e5b6d6dSopenharmony_ci
302e5b6d6dSopenharmony_ci### About the Paragraph Layout library
312e5b6d6dSopenharmony_ci
322e5b6d6dSopenharmony_ci*   The ICU Line LayoutEngine works on small chunks - unidirectional runs. It does
332e5b6d6dSopenharmony_ci    not layout text at the paragraph level.
342e5b6d6dSopenharmony_ci*   The **ParagraphLayout** object will analyze the text into runs of text in
352e5b6d6dSopenharmony_ci    the same font, script and direction, and will create a LayoutEngine object
362e5b6d6dSopenharmony_ci    for each run. The LayoutEngine will transform the characters into glyph
372e5b6d6dSopenharmony_ci    codes in visual order. Clients can use this to break a paragraph into lines,
382e5b6d6dSopenharmony_ci    and to display the glyphs in each line.
392e5b6d6dSopenharmony_ci*   Also see the
402e5b6d6dSopenharmony_ci    [ParagraphLayout](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1ParagraphLayout.html)
412e5b6d6dSopenharmony_ci    API Docs
422e5b6d6dSopenharmony_ci
432e5b6d6dSopenharmony_ci### Building the Paragraph Layout library with HarfBuzz
442e5b6d6dSopenharmony_ci
452e5b6d6dSopenharmony_ciWhile the ICU LayoutEngine is deprecated as of ICU 54, the ICU *Paragraph* Layout library is not.
462e5b6d6dSopenharmony_ciThe Paragraph Layout library must now be built using the HarfBuzz engine instead of the ICU LayoutEngine.
472e5b6d6dSopenharmony_ci
482e5b6d6dSopenharmony_ci#### UNIX Makefile instructions / Cygwin / Msys / etc. (ICU 54+)
492e5b6d6dSopenharmony_ci
502e5b6d6dSopenharmony_ciThe following steps must be completed in order:
512e5b6d6dSopenharmony_ci
522e5b6d6dSopenharmony_ci1.  Build and install a complete ICU with the **`--disable-layout` `--disable-layoutex`**
532e5b6d6dSopenharmony_ci    switches passed to configure
542e5b6d6dSopenharmony_ci3.  Build and install HarfBuzz - http://harfbuzz.org (HarfBuzz's use of ICU may
552e5b6d6dSopenharmony_ci    be enabled or disabled at your choice)
562e5b6d6dSopenharmony_ci4.  Build and install the [icu-le-hb](https://github.com/harfbuzz/icu-le-hb) library.
572e5b6d6dSopenharmony_ci5.  Now, rerun "configure" on the exact **same** ICU workspace used above:
582e5b6d6dSopenharmony_ci    *   with "icu-le-hb" AND the above-mentioned installed ICU available via
592e5b6d6dSopenharmony_ci        pkg-config ( `pkg-config --modversion icu-le-hb` should return a version,
602e5b6d6dSopenharmony_ci        such as "0.0.0" )
612e5b6d6dSopenharmony_ci    *   with the --disable-layout **`--enable-layoutex`** switches passed to configure
622e5b6d6dSopenharmony_ci6.  next, run `make install` JUST in the **`source/layoutex`** directory, to install
632e5b6d6dSopenharmony_ci    libiculx and `icu-lx.pc`
642e5b6d6dSopenharmony_ci
652e5b6d6dSopenharmony_ciThe above steps will produce a libiculx library that depends on HarfBuzz.
662e5b6d6dSopenharmony_ci
672e5b6d6dSopenharmony_ciIf pkg-config visible installation is not suitable for step 4, you may also
682e5b6d6dSopenharmony_cimanually set the following variables when building ICU in step 5:
692e5b6d6dSopenharmony_ci
702e5b6d6dSopenharmony_ci*   set `ICULEHB_CFLAGS` to the appropriate include path for icu-le-hb ( such
712e5b6d6dSopenharmony_ci    as **`-I/usr/local/include/icu-le-hb`** )
722e5b6d6dSopenharmony_ci*   set `ICULEHB_LIBS` to link against icu-le-hb and dependents as needed
732e5b6d6dSopenharmony_ci    (such as **`-L/usr/local/lib -licu-le-hb`** )
74