-
Notifications
You must be signed in to change notification settings - Fork 24
/
README.CharEncoding
126 lines (103 loc) · 5.7 KB
/
README.CharEncoding
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
-------------------------------------------------------------------
Charater font encoding in xcircuit
-------------------------------------------------------------------
Xcircuit supports ISO-Latin2 encoding (Eastern Europe) since
version 2.0a9. This support was extended to ISO-Latin5
(Turkish) in version 2.0a10 (6/14/1999), and Cyrillic (ISO-8859-5)
in version 3.9.64 (3/29/2017). Between 1999 and 2017, projects
like fontforge made it much easier to obtain and use Type1
PostScript fonts. While the fonts are not generally available
on printers, generally files are converted to PDF for printing,
and ps2pdf takes care of inserting the proper font glyphs, and
most Linux systems have URW fonts installed, or at least they
are easy to obtain.
In the latest version the above encodings can be reached simply
by selecting Text->Encoding->(name of encoding). As of this
writing, Cyrillic fonts are not available in xcircuit drawn
vector form, but are available from the font rendering engine
if xcircuit is compiled with Cairo graphics. Font encodings
using standard glyph names (e.g., from URW fonts and others)
are kept in text files in the runtime directories and are
inserted into the output so that no further manipulation is
needed to view the proper text characters.
The instructions below are generally deprecated; use of
"ogonkify" works only on ISO-Latin-X encodings (not, for
example, Cyrillic). It is needed to generate the correct
glyphs for sending PostScript output directly to a printer.
However, as noted above, modern usage is generally to first
convert to PDF format, for which ogonkify is not needed.
Version 3.6.36 corrects a long-existing mistake in which only X11
keysyms 0-255 are accepted as keyboard-entry. By converting the
X11 keysyms to keycodes, non-ASCII-encoded characters can be typed
directly into XCircuit from the keyboard. It would be nice,
though, if XCircuit would auto-detect the expected encoding from
the keysym and insert the proper font encoding switch, loading
fonts if necessary.
When creating text in an encoding other than PostScript "standard",
be sure to select "Text->Encoding->(encoding name)" from the menu.
This can be enabled by default simply by having a .xcircuitrc file
in your home directory containing a line such as:
label encoding ISOLatin2
-------------------------------------------------------------------
1) The best practice is to convert all xcircuit output to PDF
using, typically, ps2pdf, and then ignore all the instruction
below, since the PDF file contains all font information needed
for printing.
2) To get proper PostScript output on a printer (when sending
PostScript directly---this does not apply to PDF files!), you
will need to have the (separate) program "ogonkify", found at:
http://www.dcs.ed.ac.uk/home/jec/ogonkify/
ftp://ftp.dcs.ed.ac.uk/pub/jec/programs
"ogonkify" is necessary because PostScript does not contain
ISO-Latin2 encoding by default. The accents such as the caron
and ogonek exist in the font definition, but the correct
alignments for putting them together need to be provided.
Ogonkify does this best.
3) Every file containing ISO-Latin2 text must be postprocessed
through "ogonkify" using the following command, before it will
print correctly on a PostScript printer:
ogonkify -e L2 -ATH file.ps | perl -ne \
's/StandardEncoding/ISOLatin2Encoding/g;\
s/ exch defi/ISO2 exch defi/g;print' > file.out.ps
Switches: -A does Courier, -T does Times-Roman, and -H does
Helvetica; use only what's necessary to keep the output file
smaller. "-e L2" signifies Latin2 encoding; this is not
strictly necessary as ogonkify defaults to L2. All other
Latin encodings require the -e switch.
Note that the output is piped through a couple of perl
commands. This may seem overly complicated; the first
substitution corrects a bug in ogonkify output (which may
disappear from releases of ogonkify in the future). The
second substitution allows xcircuit to specify the ISO-Latin2
encodings separately from ISO-Latin1 and Adobe Standard
encodings, so that any and all encodings can be "mixed and
matched" in the same file and even the same label.
4) In a nutshell: xcircuit defines each ISO-Latin2 font name as
the original name followed by the string "ISO2". Xcircuit
can then load the file and interpret the font encodings
unambiguously. However, the new ISO-Latin2 font names are not
defined by PostScript. Running "ogonkify" in the manner shown
above will add a true PostScript definition for each of the
ISO-Latin2 fonts. Without "ogonkify", a PostScript printer
or interpreter will either produce an error or else substitute
a default font for the unrecognized one.
5) The "ogonkification" of the file will not affect xcircuit's
ability to read it back into the program. xcircuit will
continue to display the ISO-Latin2 text correctly regardless of
whether or not the file has been run through "ogonkify".
However, the header material inserted by "ogonkify" will be
lost every time xcircuit writes the file back out.
6) Other ISO-LatinX encodings: Currently ISO-Latin5 is supported,
and additional encodings will be created as I get requests for
them. Follow the instructions above for ISO-Latin2, but replace
all occurences of "2" with "5".
e.g.,
ogonkify -e L5 -ATH file.ps | perl -ne \
's/StandardEncoding/ISOLatin5Encoding/g;\
s/ exch defi/ISO5 exch defi/g;print' > file.out.ps
and add lines
% times_romaniso5.xfe loadfontencoding
% courieriso5.xfe loadfontencoding
% helveticaiso5.xfe loadfontencoding
to psfiles/builtins.lps (or /usr/local/lib/xcircuit-2.0/builtins.lps, if
already installed).