readme.html
1<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2<html>
3<head>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5 <meta name="Copyright" content="Copyright (c) 2002, International Business Machines Corporation and others. All Rights Reserved.">
6 <meta name="Author" content="Eric Mader">
7 <meta name="GENERATOR" content="Mozilla/4.72 [en] (Windows NT 5.0; U) [Netscape]">
8 <title>ScriptRun readme</title>
9</head>
10<body>
11
12<h2>
13What is scrptrun and srtest?</h2>
14The ICU LayoutEngine must be called with text in a single script. scrptrun.h
15and scrptrun.cpp implement the ScriptRun class, which can be used to find
16runs of text that is in a single script. It uses a basic iteration interface.
17<p>srtest is a little program that tests ScriptRun. You can use it as an
18example of how to use ScriptRun. Here's what the output should look like:
19<blockquote><font face="Courier New,Courier"><font size=-1>Script 'DEVANAGARI'
20from 0 to 9.</font></font>
21<br><font face="Courier New,Courier"><font size=-1>Script 'ARABIC' from
229 to 17.</font></font>
23<br><font face="Courier New,Courier"><font size=-1>Script 'CYRILLIC' from
2417 to 25.</font></font>
25<br><font face="Courier New,Courier"><font size=-1>Script 'LATIN' from
2625 to 33.</font></font>
27<br><font face="Courier New,Courier"><font size=-1>Script 'HAN' from 33
28to 35.</font></font>
29<br><font face="Courier New,Courier"><font size=-1>Script 'HIRAGANA' from
3035 to 41.</font></font>
31<br><font face="Courier New,Courier"><font size=-1>Script 'KATAKANA' from
3241 to 45.</font></font>
33<br><font face="Courier New,Courier"><font size=-1>Script 'DESERET' from
3445 to 53.</font></font></blockquote>
35
36<h2>
37How do I build scrptrun and srtest?</h2>
38To use the ScriptRun class in a Windows application, just include scrptrun.h
39and scrptrun.cpp right out of the <icu>\source\extra\scrptrun directory
40into your project. You'll also need to add the <icu>\source]extra\scrptrun
41directory to the "Additional include directories" section of the "Preprocessor"
42category on the "C/C++" tab in the project settings.
43<p>On UNIX systems the simplest thing to do is to just copy scrptrun.h
44and scrptrun.cpp into your source directory. If you want to use them from
45<icu>/source/extra/scrpturn, it's a bit trickier: the default dependency
46rules don't work on source files in a different directory. You need to
47add separate dependency rules for scrptrun.o and scrptrun.d. See <icu>/source/samples/layout/Makefile.in
48for an example of how to do this. You'll also have to add -I$(top_srcdir)/extra/scrptrun
49to your compiler flags so that the compiler can find scrptrun.h. If your
50application has to build on multiple UNIX platforms, it might be difficult
51to wirte dependency rules that will work correctly on all platforms. In
52that case, you're probably better off copying the scrpturn files to your
53source directory.
54<p>Building srtest is easy, on Windows build the srtest workspace in <icu>\source\extra\scrptrun.
55On UNIX, connect to <top-build-dir>/extra/scrptrun and do "make all"
56<h2>
57Notes</h2>
58
59<ul>
60<li>
61ScriptRun is based on <a href="http://www.unicode.org/unicode/reports/tr24/">Unicode
62Technical Report #24</a> but the implementation is not complete. In particular
63the support for paired punctuation is only a prototype. A complete implementation
64will be added to ICU in the future.</li>
65</ul>
66
67</body>
68</html>
69