What are letest and gendata?

letest is a test program that you can use to verify the basic functionality of the ICU LayoutEngine. It tests the LayoutEngine's API and reads an XML file that contains test cases to test some of the features of the LayoutEngine. These test cases are not comprehensive, but they do test the most important features of  the LayoutEngine. When you have successfully run letest, you can use the ICU LayoutEngine in you application knowing that the basic functionality is working correctly.

gendata is a program that is used by the ICU team to build the file letest.xml which contains the test cases. Unless you have changed your copy of the LayoutEngine and want to validate the changes on other platforms, there's no reason for you to run this program.

(The ICU team first runs a Windows application which uses the ICU LayoutEngine to display the text that letest uses. Once it has been verified that the text is displayed correctly, gendata is run to produce letest.xml, and then letest is run on Windows to verify that letest still works with the new data.)

How do I build letest?

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

On Windows, letest is part of the allinone project, so a normal build of ICU will also build letest. On UNIX systems, connect to <top-build-dir>/test/letest and do "make all" .

How do I run letest?

Before you can run letest, you'll need to get the fonts it uses. For legal reasons, we can't include most of them with ICU, but you can download them from the web. To do this, you'll need access to a computer running Windows. All of the fonts should be stored in <icu>/source/test/testdata. Here's how to get the fonts:

Download a recent version of the Java 2 Platform, Standard Edition (J2SE) from java.sun.com. Click on the "Download" button for the version of Java that you want to download. The page offers both JDKs and JREs. (The JRE is sufficient for letest.) The download page will have a link to the license agreement. Be sure to read and understand the license agreement, and then click on the Accept button. Download the package and install it. You'll need one font. On Windows, it will be in, for example, "C:\Program Files\Java\jdk1.6.0\jre\lib\fonts". The file you want is "LucidaSansRegular.ttf". Copy this file into the directory from which you'll run letest.

Next is the Hindi font. Go to the NCST site and download raghu.ttf. When you hit the DOWNLOAD button on the page, it will open another window which contains a disclaimer and a license agreement. Be sure that you understand and agree to all of this before you download the font. You can download raghu.ttf into the directory from which you'll run letest.

Then download the Thai font. Go to into-asia.com and click on the link for the Angsana font. This will download a .ZIP file. Extract the font file, angsd___.ttf, into the directory from which you will run letest.

There's still one more font to get, the Code2000 Unicode font. Go to James Kass' Unicode Support In Your Browser page and click on the link that says "Click Here to download Code2000 shareware demo Unicode font." This will download a .ZIP file which contains CODE2000.TTF and CODE2000.HTM. Expand this .ZIP file and put the CODE2000.TTF file in the directory from which you'll run letest.

Note: The Code2000 font is shareware. If you want to use it for longer than a trial period, you should send a shareware fee to James. Directions for how to do this are in CODE2000.HTM.

letest.xml references three other fonts:

To run letest type CTRL+F5 in Visual Studio, or "make check" in UNIX.  If everything's OK you should see something like this:
 /
 /api/
   ---[OK]  ---/api/ParameterTest
   ---[OK]  ---/api/FactoryTest
 /layout/
   ---[OK]  ---/layout/AccessTest
   ---[OK]  ---/layout/DataDrivenTest
 /c_api/
   ---[OK]  ---/c_api/ParameterTest
   ---[OK]  ---/c_api/FactoryTest
 /c_layout/
   ---[OK]  ---/c_layout/AccessTest
   ---[OK]  ---/c_layout/DataDrivenTest

[All tests passed successfully...]
Elapsed Time: 00:00:00.351
If letest cannot open a font, it will print a warning message and skip the test. letest will also check the version of the font you have to make sure it's the same one that was used to generate the test case. If the version doesn't match, letest will print a warning message and proceed with the test.