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