| 1 |
Encoding Menu |
| 2 |
============= |
| 3 |
|
| 4 |
The Encoding menu is only found in the font view. |
| 5 |
|
| 6 |
.. _encodingmenu.Reencode: |
| 7 |
|
| 8 |
.. object:: Reencode |
| 9 |
|
| 10 |
Has an attached sub-menu of standard and user defined encodings. The font's |
| 11 |
current encoding will be indicated with a check mark. You may change the |
| 12 |
encoding by selecting a different entry. |
| 13 |
|
| 14 |
There are two slightly different formats an encoding can take. It can be |
| 15 |
defined by unicode code points, or it can be defined by glyph names. When |
| 16 |
reencoding to an encoding defined by code points, the glyph with the matching |
| 17 |
unicode value is placed in the encoding slot. When reencoding to an encoding |
| 18 |
defined by glyph name, we first search for a glyph with the matching name and |
| 19 |
use it, if not found we search for the glyph name's corresponding unicode |
| 20 |
code point (if any) and if found we change its name to that specified by the |
| 21 |
encoding. |
| 22 |
|
| 23 |
Example: Suppose we have a font containing a glyph named "uni0041", and an |
| 24 |
encoding which maps U+0041->slot 65, then the glyph will be moved into slot |
| 25 |
65. If we have another encoding which maps "A" -> slot 65, then (since "A" |
| 26 |
has unicode value U+0041) our glyph will still be mapped to slot 65, but in |
| 27 |
addition its name will be changed to "A". |
| 28 |
|
| 29 |
.. _encodingmenu.Compact: |
| 30 |
|
| 31 |
.. object:: Compact |
| 32 |
|
| 33 |
Remove any holes from the encoding so all the glyphs get smushed together. If |
| 34 |
the font is already compact, then selecting this again will restore the |
| 35 |
original. |
| 36 |
|
| 37 |
.. _encodingmenu.Force: |
| 38 |
|
| 39 |
.. object:: Force Encoding |
| 40 |
|
| 41 |
Has the same sub-menu as above. Here we assume that the glyphs of the font |
| 42 |
are currently encoded in the right order, but they have the wrong names (This |
| 43 |
may seem odd, but it happens a lot). This command will change the names of |
| 44 |
all the glyphs to match what they should be if the indicated encoding were in |
| 45 |
force. |
| 46 |
|
| 47 |
.. _encodingmenu.AddSlots: |
| 48 |
|
| 49 |
.. object:: Add Encoding Slots... |
| 50 |
|
| 51 |
Add some extra slots at the end of the font into which you can put unencoded |
| 52 |
glyphs (variant glyphs, etc.) |
| 53 |
|
| 54 |
.. _encodingmenu.RemoveSlots: |
| 55 |
|
| 56 |
.. object:: Remove Unused Slots |
| 57 |
|
| 58 |
Removes any unused slots from the end of the font. It does not remove unused |
| 59 |
slots inside the font, that would screw up the encoding. |
| 60 |
|
| 61 |
.. _encodingmenu.Detach: |
| 62 |
|
| 63 |
.. object:: Detach Glyphs |
| 64 |
|
| 65 |
Detaches any selected encoding slots from their currently associated glyphs. |
| 66 |
These slots will now be marked as unused. The glyphs will remain in the font, |
| 67 |
just not encoded (If you reencode the font those glyphs will become visible |
| 68 |
again). |
| 69 |
|
| 70 |
.. _encodingmenu.RemoveGlyphs: |
| 71 |
|
| 72 |
.. object:: Detach & Remove Glyphs... |
| 73 |
|
| 74 |
Similar to the above except that any glyphs detached (which are not used |
| 75 |
elsewhere in the encoding) will be removed from the font. |
| 76 |
|
| 77 |
.. _encodingmenu.AddEnc: |
| 78 |
|
| 79 |
.. object:: Add Encoding Name... |
| 80 |
|
| 81 |
Requests an encoding name from the user and searches for it in the iconv() |
| 82 |
database. It then adds that encoding to the menu. |
| 83 |
|
| 84 |
.. _encodingmenu.Load: |
| 85 |
|
| 86 |
.. object:: Load Encoding... |
| 87 |
|
| 88 |
Asks the user for a filename and attempts to load a user defined encoding |
| 89 |
from that file. (You can only load small encodings -- one byte encodings) |
| 90 |
|
| 91 |
.. _encodingmenu.Make: |
| 92 |
|
| 93 |
.. object:: Make from Font... |
| 94 |
|
| 95 |
Allows you to name the font's current encoding (if it isn't already named), |
| 96 |
and add it to the encoding menu. |
| 97 |
|
| 98 |
.. _encodingmenu.RemoveEnc: |
| 99 |
|
| 100 |
.. object:: Remove Encoding... |
| 101 |
|
| 102 |
Removes one of the user defined encodings from the menu. |
| 103 |
|
| 104 |
.. _encodingmenu.Display: |
| 105 |
|
| 106 |
.. object:: Display by Group... |
| 107 |
|
| 108 |
Allows you restrict the glyphs displayed in the font view to those in a user |
| 109 |
defined :doc:`group </ui/dialogs/groups>` (specified in the next command). |
| 110 |
|
| 111 |
.. _encodingmenu.Define: |
| 112 |
|
| 113 |
.. object:: Define Groups... |
| 114 |
|
| 115 |
Allows you to define :doc:`groups </ui/dialogs/groups>` of glyphs which (presumably) have |
| 116 |
some meaningful connection to each other. |
| 117 |
|
| 118 |
.. _encodingmenu.SaveNL: |
| 119 |
|
| 120 |
.. object:: Save NameList of Font... |
| 121 |
|
| 122 |
Creates a :ref:`namelist <encodingmenu.namelist>` file mapping unicode to the |
| 123 |
glyph names of the current font. |
| 124 |
|
| 125 |
.. _encodingmenu.LoadNL: |
| 126 |
|
| 127 |
.. object:: Load NameList... |
| 128 |
|
| 129 |
Loads a :ref:`namelist <encodingmenu.namelist>` file into fontforge and |
| 130 |
copies it so that fontforge will load it on start up in the future. |
| 131 |
|
| 132 |
.. _encodingmenu.RenameGlyphs: |
| 133 |
|
| 134 |
.. object:: Rename Glyphs... |
| 135 |
|
| 136 |
Allows you to specify a :ref:`namelist <encodingmenu.namelist>`. All glyphs |
| 137 |
in the current font will be renamed to match the scheme in the namelist. |
| 138 |
|
| 139 |
.. _encodingmenu.NameGlyphs: |
| 140 |
|
| 141 |
.. object:: Create Named Glyphs... |
| 142 |
|
| 143 |
Allows you to specify a file containing a list of glyph names. FontForge will |
| 144 |
create a sequence of unencoded glyphs with these names. This might be useful |
| 145 |
if all your fonts contain small caps and you always want to have the names |
| 146 |
"A.small", "B.small", "C.small" etc. or perhaps you always want the ligatures |
| 147 |
"longs_longs_t", "f_longs", "f_j", etc. |
| 148 |
|
| 149 |
|
| 150 |
.. _encodingmenu.General-encodings: |
| 151 |
|
| 152 |
General notes on encodings |
| 153 |
-------------------------- |
| 154 |
|
| 155 |
Not all font formats support all encodings. SVG fonts will always be output in a |
| 156 |
unicode encoding, truetype fonts in either unicode or one of the CJK encodings, |
| 157 |
type1 fonts only support single byte encodings, etc. |
| 158 |
|
| 159 |
In a CID keyed font you are not allowed to change the encoding (in essence |
| 160 |
because there is none), but there is an entry |
| 161 |
:ref:`CID->Change Supplement <cidmenu.ChangeSup>` which will display the |
| 162 |
Registry/Ordering information and allow you to change the supplement. |
| 163 |
|
| 164 |
-------------------------------------------------------------------------------- |
| 165 |
|
| 166 |
|
| 167 |
.. _encodingmenu.Encodings: |
| 168 |
|
| 169 |
Built in Encodings |
| 170 |
^^^^^^^^^^^^^^^^^^ |
| 171 |
|
| 172 |
FontForge knows about the following encodings by default: |
| 173 |
|
| 174 |
* ISO-8859-1 (Latin1) -- traditional encoding for western european characters. |
| 175 |
Default encoding for http. Does not include the Euro sign. |
| 176 |
* ISO-8859-15 (Latin0) -- Replacement for Latin1. Does include the Euro. |
| 177 |
* ISO-8859-2 (Latin2) -- Central & Eastern European (Czech, Hungarian, Polish, |
| 178 |
Romanian, Croatian, Slovak, Slovnian. |
| 179 |
* ISO-8859-3 (Latin3) -- Southern European (Esperanto, Maltese) |
| 180 |
* ISO-8859-4 (Latin4) -- Northern European (Estonian, Latvian, Lithuanian, |
| 181 |
Greenlandic, Lappish) |
| 182 |
* ISO-8859-9 (Latin5) -- Turkish |
| 183 |
* ISO-8859-10 (Latin6) -- Nordic (reworking of Latin4&Latin1) |
| 184 |
* ISO-8859-13 (Latin7) -- Another Baltic character set |
| 185 |
* ISO-8859-14 (Latin8) -- Celtic (Gaelic & Welsh) |
| 186 |
* ISO-8859-5 (Cyrillic) |
| 187 |
* ISO-8859-6 (Arabic) |
| 188 |
* ISO-8859-7 (Greek) |
| 189 |
* ISO-8859-8 (Hebrew) -- (and Yiddish) |
| 190 |
* ISO-8859-11 (Thai) -- Also know as TIS 620 |
| 191 |
|
| 192 |
<there is no ISO-8859-12> |
| 193 |
|
| 194 |
-------------------------------------------------------------------------------- |
| 195 |
|
| 196 |
* KOI8-R -- Cyrillic |
| 197 |
* Macintosh Roman |
| 198 |
* Windows "ANSI" (CodePage1252) |
| 199 |
* Adobe Standard |
| 200 |
* Symbol |
| 201 |
* TeX Base |
| 202 |
|
| 203 |
-------------------------------------------------------------------------------- |
| 204 |
|
| 205 |
* ISO-10646-1 (Unicode, BMP) |
| 206 |
* ISO-10646-1 (Unicode, Full) |
| 207 |
* ISO-10646-? (Unicode, by plane) |
| 208 |
|
| 209 |
(You can select a specific plane of unicode as an encoding (ie BMP, SMP, |
| 210 |
SIP,...) |
| 211 |
|
| 212 |
-------------------------------------------------------------------------------- |
| 213 |
|
| 214 |
* SJIS |
| 215 |
* JIS 208 -- Japanese Kanji (first 8000 characters) |
| 216 |
* JIS 212 -- Japanese Kanji (next 8000 characters) |
| 217 |
* Wansung |
| 218 |
* KSC 5601 -- Korean (this is the 94x94 version of KSC 5601) |
| 219 |
* Johab |
| 220 |
* GB 2312 -- Simplified Chinese |
| 221 |
* Packed GB 2312 -- (I don't know what the proper name for this is, ASCII for |
| 222 |
bytes<0x80, and GB 2312 EUC offset by 0x8080) |
| 223 |
* Big5 -- Traditional Chinese |
| 224 |
|
| 225 |
-------------------------------------------------------------------------------- |
| 226 |
|
| 227 |
* Custom -- An unknown encoding |
| 228 |
* Glyph Order -- the glyph ordering used in the original font file. |
| 229 |
|
| 230 |
Encoding sources: |
| 231 |
|
| 232 |
* `ISO 8859 Alphabet Soup <http://czyborra.com/charsets/iso8859.html>`__ |
| 233 |
* `Unicode Mapping Tables <http://www.unicode.org/Public/MAPPINGS/>`__ |
| 234 |
|
| 235 |
`An index to images of all the glyphs in unicode <http://www.unicode.org/charts/>`__. |
| 236 |
|
| 237 |
-------------------------------------------------------------------------------- |
| 238 |
|
| 239 |
|
| 240 |
.. _encodingmenu.User-def: |
| 241 |
|
| 242 |
User Defined Encodings |
| 243 |
^^^^^^^^^^^^^^^^^^^^^^ |
| 244 |
|
| 245 |
You can also add new encodings to the set that FontForge knows about. There are |
| 246 |
three menu items that manipulate a set of user defined encodings. As always |
| 247 |
these specify both a character set and an encoding. The encoding has a maximum |
| 248 |
of 256 entries, but the character set may be larger (up to 1024). This means |
| 249 |
that you can define a font with extra characters. Since postscript fonts can be |
| 250 |
reencoded at runtime this can be useful. |
| 251 |
|
| 252 |
The Load Encoding command allows you to load an encoding(s) from a file. |
| 253 |
Currently the file must either be in the format used by the unicode consortium |
| 254 |
for `mapping ISO 8859 <http://www.unicode.org/Public/MAPPINGS/ISO8859/>`__ |
| 255 |
encodings to unicode, or it must be a postscript encoding array. The first |
| 256 |
format looks like this: |
| 257 |
|
| 258 |
:: |
| 259 |
|
| 260 |
0x20 0x0020 # SPACE |
| 261 |
0x21 0x0021 # EXCLAMATION MARK |
| 262 |
... |
| 263 |
|
| 264 |
A postscript file looks like: |
| 265 |
|
| 266 |
:: |
| 267 |
|
| 268 |
/TeXBase1Encoding [ |
| 269 |
% 00 |
| 270 |
/.notdef /dotaccent /fi /fl |
| 271 |
/fraction /hungarianumlaut /Lslash /lslash |
| 272 |
... |
| 273 |
] def |
| 274 |
|
| 275 |
There may be more than one encoding in a postscript file. The encoding parser is |
| 276 |
not smart. It will only read arrays specified like this, don't try any of the |
| 277 |
innumerable other ways of specifying an array in postscript. |
| 278 |
|
| 279 |
If the font has a custom encoding then the ``Make From Font`` menu item is |
| 280 |
enabled. This allows you to name the encoding you have defined for the current |
| 281 |
font. |
| 282 |
|
| 283 |
The ``Remove Encoding`` menu item brings up a list showing all the custom |
| 284 |
encodings and allows you to delete them. |
| 285 |
|
| 286 |
Here's an `example of a postscript encoding file <https://fontforge.org/downloads/Encodings.ps.gz>`__. |
| 287 |
It contains: |
| 288 |
|
| 289 |
* TeXMathItalicEncoding |
| 290 |
* TeXMathSymbolEncoding |
| 291 |
* TeXMathExtensionEncoding |
| 292 |
|
| 293 |
-------------------------------------------------------------------------------- |
| 294 |
|
| 295 |
* IsoLatin -- (which specifies all the characters used in any of the ISO-Latin-* |
| 296 |
fonts |
| 297 |
|
| 298 |
-------------------------------------------------------------------------------- |
| 299 |
|
| 300 |
* AdobeExpert -- (Which contains things like lower case numbers, small caps, |
| 301 |
fractions, sub/superscript numbers, etc.) |
| 302 |
|
| 303 |
-------------------------------------------------------------------------------- |
| 304 |
|
| 305 |
* CodePage1250 -- Microsoft's encoding for Central European characters |
| 306 |
* CodePage1251 -- Microsoft's Cyrillic encoding |
| 307 |
* CodePage1252 -- Microsoft's Western European encoding (a superset of Latin1. |
| 308 |
Sometimes called "ANSI" though I can find no ANSI standard that it follows) |
| 309 |
* CodePage1253 -- Microsoft's Greek encoding |
| 310 |
* CodePage1254 -- Microsoft's Turkish encoding |
| 311 |
* CodePage1255 -- Microsoft's Hebrew encoding (an extension of ISO-8859-8) |
| 312 |
* CodePage1256 -- Microsoft's Arabic encoding |
| 313 |
* CodePage1257 -- Microsoft's Baltic encoding |
| 314 |
* CodePage1258 -- Microsoft's Viet Namese encoding |
| 315 |
* CodePage874 -- Microsoft's Thai encoding |
| 316 |
|
| 317 |
-------------------------------------------------------------------------------- |
| 318 |
|
| 319 |
* MacCentralEuropean |
| 320 |
* MacCyrillic |
| 321 |
* MacGreek |
| 322 |
* MacHebrew |
| 323 |
|
| 324 |
-------------------------------------------------------------------------------- |
| 325 |
|
| 326 |
* US-ASCII -- Not really useful by itself any more, but provides the first 128 |
| 327 |
characters of almost every other encoding. |
| 328 |
|
| 329 |
|
| 330 |
.. _encodingmenu.namelist: |
| 331 |
|
| 332 |
NameLists |
| 333 |
--------- |
| 334 |
|
| 335 |
Adobe has established a standard glyph naming convention which provides |
| 336 |
intelligible names for many glyphs of unicode characters. And some |
| 337 |
unintelligible names too. |
| 338 |
|
| 339 |
A :ref:`namelist <overview.Glyph-names>` is just a mapping from unicode to glyph |
| 340 |
names (a glyph name must be made up of alphanumeric characters (or the special |
| 341 |
characters '.' or '_'), it may not begin with a digit, and it must be 31 or |
| 342 |
fewer characters in length. |
| 343 |
|
| 344 |
FontForge provides a series of standard namelists: |
| 345 |
|
| 346 |
* Adobe Glyph List |
| 347 |
|
| 348 |
This is the set of names that Adobe publishes on the web. |
| 349 |
* AGL For New Fonts |
| 350 |
|
| 351 |
This is set of the names that Adobe recommends for the new fonts, without odd |
| 352 |
names like "afiiXXXXX" or incorrect commaaccent names. |
| 353 |
* AGL without afii |
| 354 |
|
| 355 |
The cyrillic and hebrew glyphs have been assigned some very odd names |
| 356 |
(afiiXXXXX) and some people prefer not to use them. This is now redundant; AGL |
| 357 |
for New Fonts should be used instead. |
| 358 |
* AGL with PUA |
| 359 |
|
| 360 |
Adobe has assigned part of the unicode public use area to hold some standard |
| 361 |
glyph variants like small caps, subscripts, old-style numbers, etc. |
| 362 |
* Greek small caps |
| 363 |
|
| 364 |
I've added some greek small cap assignments |
| 365 |
* TeX Names |
| 366 |
|
| 367 |
The TeX typesetting system has its own set of names |
| 368 |
* AMS Names |
| 369 |
|
| 370 |
The American Mathematical Society has its set of names (see the American |
| 371 |
Mathematical Society's |
| 372 |
`specification <http://www.ams.org/STIX/bnb/stix-tbl.asc-2003-10-10>`__) |
| 373 |
|
| 374 |
You may define your own namelist file. It should have the extension ".nam". And |
| 375 |
it should contain a series of lines that look like: |
| 376 |
|
| 377 |
:: |
| 378 |
|
| 379 |
0x0020 space |
| 380 |
0x0021 exclam |
| 381 |
0x0022 dblquote |
| 382 |
|
| 383 |
In many cases you will just want to make a few modifications to an already |
| 384 |
existing namelist. You can write: |
| 385 |
|
| 386 |
:: |
| 387 |
|
| 388 |
Based: Adobe Glyph List |
| 389 |
0x0021 exclamation |
| 390 |
|
| 391 |
Which means the namelist is the same as the Adobe Glyph List except that in your |
| 392 |
system U+0021 will be called "exclamation" rather than "exclam". |
| 393 |
|
| 394 |
Any glyphs you do not explicitly name will be named "uniXXXX" or "uXXXXX" where |
| 395 |
XXXX is the unicode value in hex. The prefix "uni" will be used for glyphs in |
| 396 |
the BMP, the prefix "u" for glyphs outside. |
| 397 |
|
| 398 |
I said that glyph names should contain only alphanumeric characters (and some |
| 399 |
others). But really this is only true of glyph names that get output into a |
| 400 |
font. If you design your own namelist you may include whatever glyph names you |
| 401 |
like, using (almost) the full range of unicode -- provided you rename all your |
| 402 |
glyphs to Adobe's names before you generate a font. If you use non-ASCII |
| 403 |
characters you should encode the file in utf-8. |
| 404 |
|
| 405 |
FontForge normally will restrict glyph names to be within the ASCII range, but |
| 406 |
if you go to |
| 407 |
:menuselection:`File --> Preferences --> Generic --> UnicodeGlyphNames` and set |
| 408 |
it on you can use unicode. |
| 409 |
|
| 410 |
I've created a `french namelist <https://fontforge.org/downloads/ListeDesGlyphs.nam>`__ |
| 411 |
which uses accented letters. This will work fine within fontforge, and most rasterizers |
| 412 |
will parse fonts generated using such names -- but they are non-standard and may |
| 413 |
cause problems. Best to do a rename just before generating your font. |
| 414 |
|
| 415 |
So if you find it easier to work with names other than those Adobe has |
| 416 |
established you may create your own namelist file. Then use |
| 417 |
:ref:`Encoding->Load NameList... <encodingmenu.LoadNL>` to load that into |
| 418 |
FontForge (you only need do this once, FontForge should remember it thereafter). |
| 419 |
You may use :ref:`File->Preferences->Font Info <prefs.NewFontNameList>` to |
| 420 |
decree that all your new fonts will use this namelist. You can change a font's |
| 421 |
namelist with either: |
| 422 |
|
| 423 |
* :ref:`Element->Font Info->General->NameList <fontinfo.PS-General>` |
| 424 |
|
| 425 |
Which will change the way new glyphs are assigned names |
| 426 |
* :ref:`Encoding->Rename Glyphs... <encodingmenu.RenameGlyphs>` |
| 427 |
|
| 428 |
Which will rename existing glyphs as well as changing the way new glyphs are |
| 429 |
named. |
| 430 |
|
| 431 |
You may also want to force a rename of all glyphs when you Open a font, and the |
| 432 |
open dialog now lets you do this. Similarly when generating a font you will |
| 433 |
probably want to force that font to be use the standard names of the Adobe Glyph |
| 434 |
List. |