## What is the layout demo?

The layout demo displays a paragraph of text that is laid out using the LayoutEngine. There are two versions of this demo, "layout.exe" which runs on Windows 2000, and "gnomelayout" which runs on Linux. Both programs read a file containing the Unicode text to display, and a file that says which font to use to display each script.

## How do I build the layout demo?

First, you need to build ICU, including the LayoutEngine.

On Windows, the layout project should be listed as a dependency of all, so layout will build when you build all. If it doesn't for some reason, just select the layout project in the project toolbar and build it.

On Linux systems, you need to add the "--enable-layout=yes" option when you invoke the runConfigureICU script. When you've done that, layout should build when you do "make all install"

To build the demo on Windows, just open the layout project in <icu>\source\samples\layout and build it.

On Linux systems, connect to <top-build-dir>/samples/layout and do "make all" The layout demo uses FreeType 1. The make files assume that the FreeType header files are in /usr/include/freetype1, and that the freetype library is /usr/lib/libttf.so. This is how RedHat Linux 7.2 installs FreeType 1. If your system is different, you may need to add sym links to where the files are stored on your system, or modify <top-src-dir>/samples/layout/Makefile.in to reference the files correctly for your system.

## How do I run the demo?

Before you can run the demo, you'll need to get the fonts it uses. For legal reasons, we can't include these fonts with ICU, but you can get them for free from the web. To do this, you'll need access to a computer running Windows. Here's how to get the fonts:

Download the 1.3 version of the JDK from the IBM WebSphere preview technologies page. From this page, follow the "Download" link on the right had side. You'll need to register with them if you haven't downloaded before. Download and install the "Runtime Environment Package." You'll need three fonts from this package. If you've let the installer use it's defaults, the fonts will be in C:\Program Files\IBM\Java13\jre\lib\fonts. The files you want are "LucidaSansRegular.ttf" and "Thonburi.ttf" On Windows, copy these font files to your Fonts folder, on LInux, copy these font files to the directory from which you'll run the layout demo.

Next is the Hindi font. Go to the NCST site and download raghu.ttf. Be sure to look at the README file before you download the font. You can download raghu.ttf into the directory from which you'll run the layout demo.

There's still one more font to get. Go to the Microsoft TrueType core fonts for the Web page and download the "Times New Roman" font. This will download an installer program, called "Times32.exe" which will install the Times New Roman fonts in your fonts folder. (If you've already got these fonts in you fonts folder, you may want to move them to another folder before you install these fonts.)

NOTE: this installer will display an End User License Agreement (EULA) which you must accept before proceeding. Be sure that you read and understand this agreement before you install the font.

After you run the installer program, it will add the Times Roman fonts to your fonts folder. If you're going to run the demo on Linux, open the Fonts folder and copy the "Times New Roman" font (the file name will be "Times.TTF") to the directory from which you'll run the demo.

That's it! Now all you have to do is run letest (CTRL+F5 in Visual C++, or "./gnomelayout" in Linux)

## How can I customize the layout demo?

The text that the layout demo displays is read from the file "Sample.txt." You can change the text by editing this file using a Unicode-aware text editor. (it is in UTF8 format with a BOM as the first character; the demo can also read UTF16 and UTF32 format files) Remember that the text will be displayed in a single paragraph; you can include CR and LF characters in the text, but they will be ignored.

If you add scripts to the text other than Arabic, Devanagari, Latin or Thai, you'll need to find a font which contains the characters in that script, and add an entry to the FontMap file ("FontMap.GDI" on Windows, "FontMap.Gnome" on Linux) This file contains a single entry per line. Each entry contains a script name followed by a colon, and then a font name.

Here is the list of legal script names:

> `ARABIC`
> `ARMENIAN`
> `BENGALI`
> `BOPOMOFO`
> `CANADIAN-ABORIGINAL`
> `CHEROKEE`
> `CYRILLIC`
> `DESERET`
> `DEVANAGARI`
> `ETHIOPIC`
> `GEORGIAN`
> `GOTHIC`
> `GREEK`
> `GUJARATI`
> `GURMUKHI`
> `HAN`
> `HANGUL`
> `HEBREW`
> `HIRAGANA`
> `KANNADA`
> `KATAKANA`
> `KHMER`
> `LATIN`
> `MALAYALAM`
> `MONGOLIAN`
> `MYANMAR`
> `OGHAM`
> `OLD-ITALIC`
> `ORIYA`
> `RUNIC`
> `SINHALA`
> `SYRIAC`
> `TAMIL`
> `TELUGU`
> `THAANA`
> `THAI`
> `TIBETAN`
> `UCAS`
> `YI`

On Windows use the full name of the font as it appears in the Windows Fonts folder (eg. "Times New Roman") On Linux, use the file name of the font file (e.g. "Times.TTF") If you're running on Windows, you'll need to install the new fonts in your Fonts folder. If you're running on Linux, put them in the directory from which you'll run the demo.