JapaneseText version 1.0.4 ========================== Tamito KAJIYAMA <30 September 2002> Introduction ------------ JapaneseText is a Sketch script for drawing Japanese characters. It reads outline data directly from Japanese TrueType font files, and generates Bezier curve objects that represent Japanese characters. The latest version of JapaneseText is available at the following location: http://www.asahi-net.or.jp/~rd6t-kjym/sketch/ Requirements ------------ o Sketch and Tcl/Tk with Japanese support You need Sketch built with a version of Tcl/Tk that supports Japanese input and output. I've used Tcl/Tk 8.3.4. o Japanese TrueType fonts They are used to draw kana and kanji characters. o Latin TrueType fonts They are used to draw ASCII alphabets. You can use Latin fonts contained in Japanese TrueType Collection fonts. o FreeType (http://www.freetype.org/) It is used to read outline data from font files. Related header files and libraries need to be installed before installing the JapaneseText package. I've used FreeType-1.2. Installation ------------ 1. Run the following command to compile source files. $ python setup.py build_ext -b lib If FreeType header files and libraries are not found, specify -I and -L options as illustrated below. $ python setup.py build_ext -b lib -I /opt/include/freetype -L /opt/lib 2. Run "make install" to install related files. The destination of the installation is ~/.sketch/. 3. Edit ~/.sketch/userhooks.py and specify fonts that you want to use. See the file userhooks.py.example to know how to specify fonts. You need Distutils to run setup.py. If you don't have Distuils, follow the instructions below. a. Copy lib/Setup.in to lib/Setup, and edit the latter. Specify the directories where FreeType header files and libraries are. b. Run "make" to compile source files. Font Specification ------------------ JapaneseText draws characters using the fonts specified in ~/.sketch/userhooks.py. The script does not know anything about your fonts by default. So, nothing can be drawn unless you specify at least one font. Here is an example of font specification. import JapaneseText JapaneseText.kanjifonts = [ ("DF Heisei Mincho W3", "/usr/X11R6/lib/X11/fonts/TrueType/DFHsm3.ttc", 1), ("DF Heisei Mincho W5", "/usr/X11R6/lib/X11/fonts/TrueType/DFHsm5.ttc", 1), ("DF Heisei Mincho W7", "/usr/X11R6/lib/X11/fonts/TrueType/DFHsm7.ttc", 1), ("DF Heisei Mincho W9", "/usr/X11R6/lib/X11/fonts/TrueType/DFHsm9.ttc", 1), ] JapaneseText.asciifonts = [ ("Dutch 801 Roman", "~/fonts/truetype/tt0011m_.ttf"), ("Dutch 801 Italic", "~/fonts/truetype/tt0012m_.ttf"), ("Dutch 801 Bold", "~/fonts/truetype/tt0013m_.ttf"), ("Dutch 801 Bold Italic", "~/fonts/truetype/tt0014m_.ttf"), ] JapaneseText.kanjifonts specifies a list of Japanese fonts, while JapaneseText.asciifonts does a list of Latin fonts. You describe a set of fonts, enclosed by parentheses and separated with a comma, in square brackets preceded by a equal sign. In each pair of parentheses, you describe a font name, font file, and face number in this order. A face number is used to specify the face you want to use when the font file is in the TrueType Collection format. The face number 0 is used if the face number is omitted. You don't have to specify a face number if it's not a TrueType Collection font. History ------- o Version 1.0.4 <30 September 2002> - Changed codes so as to assume Unicode (UTF-8) as Tkinter's internal character encoding (previous versions had assumed EUC-JP). o Version 1.0.3 <18 July 2002> - Added setup.py to the distribution. Now the freetype module can be built with Distutils. - Changed the URL of official home page and author's e-mail address. o Version 1.0.2 <26 February 2002> - JapaneseText.py: fixed a bug that failed to create a path for a contour if it begins with an offpoint. - JapaneseText.py: added an option for generating solid-filled polygons. (Thanks to Yamauchi-san ) o Version 1.0.1 <2 July 2001> - JapaneseText.py: fixed a bug that the start and end points of a contour may be an offpoint. (Thanks to Shimokawa-san ) - lib/Makefile.pre.in: removed. - Makefile: get a copy of Makefile.pre.in from the local Python installation. - README.en: fixed a typo. o Version 1.0 <20 April 2000> - The first public release. License ------- This is free software; you can freely redistribute it and/or modify it under the terms of the GNU General Public License (version 2 or later). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. Use it at your own risk. Author ------ Tamito KAJIYAMA Any comments, suggestions, and/or patches are very welcome. Thank you for using JapaneseText! $Id: README.en,v 1.3 2002/09/30 04:06:10 kajiyama Exp $