• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1##################################################
2encodings: Support for OpenType-specific encodings
3##################################################
4
5fontTools includes support for some character encodings found in legacy Mac
6TrueType fonts. Many of these legacy encodings have found their way into the
7standard Python ``encodings`` library, but others still remain unimplemented.
8Importing ``fontTools.encodings.codecs`` will therefore add string ``encode``
9and ``decode`` support for the following encodings:
10
11* ``x_mac_japanese_ttx``
12* ``x_mac_trad_chinese_ttx``
13* ``x_mac_korean_ttx``
14* ``x_mac_simp_chinese_ttx``
15
16fontTools also includes a package (``fontTools.encodings.MacRoman``) which
17contains a mapping of glyph IDs to glyph names in the MacRoman character set::
18
19		>>> from fontTools.encodings.MacRoman import MacRoman
20		>>> MacRoman[26]
21		'twosuperior'
22