1--- 2layout: default 3title: Paragraph Layout 4nav_order: 1 5parent: Layout Engine 6--- 7<!-- 8© 2020 and later: Unicode, Inc. and others. 9License & terms of use: http://www.unicode.org/copyright.html 10--> 11 12# Paragraph Layout 13{: .no_toc } 14 15## Contents 16{: .no_toc .text-delta } 17 181. TOC 19{:toc} 20 21--- 22 23# Overview 24 25This page is about the Paragraph Layout library that is available in ICU4C/C++. 26 27For information about the deprecated Line Layout Engine, including its deprecation notice, 28see: [Layout Engine](index.md). 29 30### About the Paragraph Layout library 31 32* The ICU Line LayoutEngine works on small chunks - unidirectional runs. It does 33 not layout text at the paragraph level. 34* The **ParagraphLayout** object will analyze the text into runs of text in 35 the same font, script and direction, and will create a LayoutEngine object 36 for each run. The LayoutEngine will transform the characters into glyph 37 codes in visual order. Clients can use this to break a paragraph into lines, 38 and to display the glyphs in each line. 39* Also see the 40 [ParagraphLayout](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1ParagraphLayout.html) 41 API Docs 42 43### Building the Paragraph Layout library with HarfBuzz 44 45While the ICU LayoutEngine is deprecated as of ICU 54, the ICU *Paragraph* Layout library is not. 46The Paragraph Layout library must now be built using the HarfBuzz engine instead of the ICU LayoutEngine. 47 48#### UNIX Makefile instructions / Cygwin / Msys / etc. (ICU 54+) 49 50The following steps must be completed in order: 51 521. Build and install a complete ICU with the **`--disable-layout` `--disable-layoutex`** 53 switches passed to configure 543. Build and install HarfBuzz - http://harfbuzz.org (HarfBuzz's use of ICU may 55 be enabled or disabled at your choice) 564. Build and install the [icu-le-hb](http://harfbuzz.org) library. 575. Now, rerun "configure" on the exact **same** ICU workspace used above: 58 * with "icu-le-hb" AND the above-mentioned installed ICU available via 59 pkg-config ( `pkg-config --modversion icu-le-hb` should return a version, 60 such as "0.0.0" ) 61 * with the --disable-layout **`--enable-layoutex`** switches passed to configure 626. next, run `make install` JUST in the **`source/layoutex`** directory, to install 63 libiculx and `icu-lx.pc` 64 65The above steps will produce a libiculx library that depends on HarfBuzz. 66 67If pkg-config visible installation is not suitable for step 4, you may also 68manually set the following variables when building ICU in step 5: 69 70* set `ICULEHB_CFLAGS` to the appropriate include path for icu-le-hb ( such 71 as **`-I/usr/local/include/icu-le-hb`** ) 72* set `ICULEHB_LIBS` to link against icu-le-hb and dependents as needed 73 (such as **`-L/usr/local/lib -licu-le-hb`** ) 74