File: manual_33.html

package info (click to toggle)
ipe 6.0pre23-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,824 kB
  • ctags: 5,330
  • sloc: cpp: 30,712; ansic: 1,061; xml: 693; makefile: 66
file content (100 lines) | stat: -rw-r--r-- 5,230 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- XML file produced from file: manual.tex
     using Hyperlatex v 2.6 (c) Otfried Cheong
     on Emacs 21.3.1, Mon Nov 22 10:30:53 2004 -->
<head>
<title>Ipe Manual -- 12 Unicode text</title>

<style type="text/css">
.maketitle { align : center }
div.abstract { margin-left: 20%; margin-right: 10%; }
h3.abstract  { align : center }
div.verse, div.quote, div.quotation {
  margin-left : 10%; 
  margin-right : 10%;
}
</style>

<meta http-equiv="Content-Type" 
        content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffe6">
<table width="100%" cellpadding=0 cellspacing=2><tr><td bgcolor="#99ccff"><a href="manual_34.html"><img border="0" alt="13 Customizing Ipe" src="next.png"></a></td><td bgcolor="#99ccff"><a href="manual.html"><img border="0" alt="Top" src="up.png"></a></td><td bgcolor="#99ccff"><a href="manual_32.html"><img border="0" alt="11 Using Truetype fonts" src="previous.png"></a></td><td align="center" bgcolor="#99ccff" width="100%"><b>12 Unicode text</b></td></tr></table>
<h1>12 Unicode text</h1>

<p>


<p>If you make figures containing text objects in languages other than
English, you will need to enter accented characters, or characters
from other scripts such as Greek, Hangul, Kana, or Chinese characters.
Of course you can still use the LaTeX syntax <code>K\"onig</code> to
enter the German word "K&ouml;nig", but for larger runs of text it's
more convenient to exploit the fact that the Ipe user interface
(thanks to the Qt toolkit) is Unicode-aware, and let's you enter text
in any script supported by your system.
<p>However, the Unicode text also has to be processed by Pdflatex.  The
easiest solution, sufficient for German, French, and other languages
for which support is already in a standard LaTeX-setup, is to add
the line 
<pre>
\usepackage{ucs}
</pre>
in your <em>Latex preamble</em> (set in the <em>Document properties</em>
dialog, available on the <em>Edit</em> menu).  You will need to install
the <a href="http://www.unruh.de/DniQ/latex/unicode/"><em>ucs package</em> for Latex by Dominique
  Unruh</a>, if it is not yet on your
system.
<p>For more complicated needs, you'll need to read further.  When Ipe
writes the Pdflatex source file, it replaces all Unicode characters by
a Latex macro, such as <code>\unichar{44032}</code> for the Korean syllable
"&#44032;".  The <code>ucs</code> package
implements&nbsp;<code>\unichar</code> for many scripts, including Chinese,
Japanese, and Korean.  See the <code>ucs</code> documentation to set this up
and for the options you need to use.
<p>If you have Truetype (TTF) fonts that include the scripts you wish to
use in your Ipe document, there is an alternative solution.  You can
set up Pdflatex to directly map the <code>\unichar</code> macro to the right
glyph in this font.
<p>Follow the instructions on my
<a href="http://ipe.compgeom.org/pdftex.html">webpage</a> to declare
a Truetype font to be used for Unicode characters in the document. 
We first test it "manually", by running Pdflatex on this test file:
<pre>% File 'unitest.tex' 
\documentclass{article}
\usepackage{ttfucs}
\DeclareTruetypeFont{cyberb}
\begin{document}
Here is a character from Cyberbit: \unichar{44032}.
\end{document}
</pre>
<p>Assuming this works fine, we can now try to use the font from Ipe. All
you need to do is to add the following stylesheet to your document:
<pre>&lt;ipestyle name="cyberbit"&gt;
&lt;cmap font="cyberb"/&gt;
&lt;preamble&gt;
\usepackage{ttfucs}
\DeclareTruetypeFont{cyberb}
&lt;/preamble&gt;
&lt;/ipestyle&gt;
</pre>
<p>Unicode characters entered from the Ipe user interface should now be
displayed correctly.  Note the use of the <code>&lt;cmap&gt;</code> tag: it tells
Ipe to add a Unicode character map to the LaTeX fonts declared by
<code>\DeclareTruetypeFont{cyberb}</code>.  When saving as PDF, this ensures
that Unicode text in the PDF file can be interpreted by the viewer
application (that is, you can select it and paste it into, say, a text
editor). 
<p>You can use more than one TTF font, and add several
<code>\DeclareTruetypeFont</code> declarations to the Latex preamble of your
Ipe document.  The last package determines the standard font for
Unicode characters.  To select a different Unicode font, use the
<code>\TruetypeFont</code> command defined in the <code>ttfucs</code>&nbsp;package.
<p>You can also mix this strategy with using the <code>ucs</code> package--the
command <code>\ucsfamily</code> will switch to using&nbsp;<code>ucs</code>, until you
switch back to using a Truetype font by saying <code>\TruetypeFont</code>.
<hr />
<table width="100%" cellpadding=0 cellspacing=2><tr><td bgcolor="#99ccff"><a href="manual_34.html"><img border="0" alt="13 Customizing Ipe" src="next.png"></a></td><td bgcolor="#99ccff"><a href="manual.html"><img border="0" alt="Top" src="up.png"></a></td><td bgcolor="#99ccff"><a href="manual_32.html"><img border="0" alt="11 Using Truetype fonts" src="previous.png"></a></td><td align="center" bgcolor="#99ccff" width="100%"><b>12 Unicode text</b></td></tr></table></body></html>