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