Merge pull request #813 from anthrotype/readme-rst

convert README to reStructuredText for use with PyPI
This commit is contained in:
Cosimo Lupo 2017-01-19 09:24:39 +00:00 committed by GitHub
commit a141ddc400
7 changed files with 693 additions and 603 deletions

View File

@ -1,6 +1,6 @@
include README.md
include README.rst
include LICENSE
include NEWS
include NEWS.rst
include Snippets/*.py
include Snippets/README.md
include MetaTools/*.py

View File

@ -11,7 +11,7 @@ fontToolsDir = os.path.dirname(os.path.dirname(os.path.join(os.getcwd(), sys.arg
fontToolsDir= os.path.normpath(fontToolsDir)
tablesDir = os.path.join(fontToolsDir,
"Lib", "fontTools", "ttLib", "tables")
docFile = os.path.join(fontToolsDir, "README.md")
docFile = os.path.join(fontToolsDir, "README.rst")
names = glob.glob1(tablesDir, "*.py")
@ -57,8 +57,8 @@ if __name__ == "__main__":
file.close()
begin = "<!-- begin table list -->"
end = "<!-- end table list -->"
begin = ".. begin table list\n.. code::\n"
end = ".. end table list"
doc = open(docFile).read()
beginPos = doc.find(begin)
assert beginPos > 0

348
NEWS
View File

@ -1,348 +0,0 @@
- [ttx] Fixed 'I/O operation on closed file' error when dumping multiple TTXs
to standard output with the '-o -' option.
- The unit test modules (*_test.py) have been moved outside of the fontTools
package to the Tests folder, thus they are no longer installed (#811).
## TTX/FontTools Version 3.5.0
2017-01-14
- Font tables read from XML can now be written back to XML with no loss.
- GSUB/GPOS LookupType is written out in XML as an element, not comment. (#792)
- When parsing cmap table, do not store items mapped to glyph id 0. (#790)
- [otlLib] Make ClassDef sorting deterministic. Fixes #766 (7d1ddb2)
- [mtiLib] Added unit tests (#787)
- [cvar] Implemented cvar table
- [gvar] Renamed GlyphVariation to TupleVariation to match OpenType terminology.
- [otTables] Handle gracefully empty VarData.Item array when compiling XML. (#797)
- [varLib] Re-enabled generation of `HVAR` table for fonts with TrueType
outlines; removed `--build-HVAR` command-line option.
- [feaLib] The parser can now be extended to support non-standard statements in
FEA code by using a customized Abstract Syntax Tree. See, for example,
`feaLib.builder_test.test_extensions` and baseClass.feax (#794, fixes #773).
- [feaLib] Added `feaLib` command to the 'fonttools' command-line tool; applies
a feature file to a font. `fonttools feaLib -h` for help.
- [pens] The `T2CharStringPen` now takes an optional `roundTolerance` argument
to control the rounding of coordinates (#804, fixes #769).
- [ci] Measure test coverage on all supported python versions and OSes, combine
coverage data and upload to https://codecov.io/gh/fonttools/fonttools (#786)
- [ci] Configured Travis and Appveyor for running tests on Python 3.6 (#785, 55c03bc)
- The manual pages installation directory can be customized through
FONTTOOLS_MANPATH environment variable (#799, fixes #84).
- [Snippets] Added otf2ttf.py, for converting fonts from CFF to TrueType using
the googlei18n/cu2qu module (#802)
## TTX/FontTools Version 3.4.0
2016-12-21
- [feaLib] Added support for generating FEA text from abstract syntax tree
(AST) objects (#776). Thanks @mhosken
- Added `agl.toUnicode` function to convert AGL-compliant glyph names to
Unicode strings (#774)
- Implemented MVAR table (b4d5381)
## TTX/FontTools Version 3.3.1
2016-12-15
- [setup] We no longer use versioneer.py to compute fonttools version from git
metadata, as this has caused issues for some users (#767). Now we bump the
version strings manually with a custom `release` command of setup.py script.
## TTX/FontTools Version 3.3.0
2016-12-06
- [ttLib] Implemented STAT table from OpenType 1.8 (#758)
- [cffLib] Fixed decompilation of CFF fonts containing non-standard key/value pairs in FontDict (issue #740; PR #744)
- [py23] minor: in `round3` function, allow the second argument to be `None` (#757)
- The standalone `sstruct` and `xmlWriter` modules, deprecated since vesion 3.2.0, have been removed. They can be imported from the `fontTools.misc` package.
## TTX/FontTools Version 3.2.3
2016-12-02
- [py23] optimized performance of round3 function; added backport for py35 math.isclose() (9d8dacb)
- [subset] fixed issue with 'narrow' (UCS-2) Python 2 builds and --text/--text-file options containing non-BMP chararcters (16d0e5e)
- [varLib] fixed issuewhen normalizing location values (8fa2ee1, #749)
- [inspect] Made it compatible with both python2 and python3 (167ee60, #748). Thanks @pnemade
## TTX/FontTools Version 3.2.2
2016-11-24
- [varLib] Do not emit null axes in fvar (1bebcec). Thanks @robmck-ms
- [varLib] Handle fonts without GPOS (7915a45)
- [merge] Ignore LangSys if None (a11bc56)
- [subset] Fix subsetting MathVariants (78d3cbe)
- [OS/2] Fix "Private Use (plane 15)" range (08a0d55). Thanks @mashabow
## TTX/FontTools Version 3.2.1
2016-11-03
- [OS/2] fix checking `fsSelection` bits matching `head.macStyle` bits
- [varLib] added `--build-HVAR` option to generate `HVAR` table for fonts with TrueType outlines. For `CFF2`, it is enabled by default.
## TTX/FontTools Version 3.2.0
2016-11-02
- [varLib] Improve support for OpenType 1.8 Variable Fonts:
* Implement GDEF's VariationStore
* Implement HVAR/VVAR tables
* Partial support for loading MutatorMath .designspace files with varLib.designspace module
* Add varLib.models with Variation fonts interpolation models
* Implement GSUB/GPOS FeatureVariations
* Initial support for interpolating and merging OpenType Layout tables (see varLib.interpolate_layout and varLib.merger)
- [API change] Change version to be an integer instead of a float in XML output for GSUB, GPOS, GDEF, MATH, BASE, JSTF, HVAR, VVAR, feat, hhea and vhea tables. Scripts that set the Version for those to 1.0 or other float values also need fixing. A warning is emitted when code or XML needs fix.
- several bug fixes to the cffLib module, contributed by Adobe's @readroberts
- The XML output for CFF table now has a 'major' and 'minor' elements for specifying whether it's version 1.0 or 2.0 (support for CFF2 is coming soon)
- [setup.py] remove undocumented/deprecated 'extra_path' Distutils argument. This means that we no longer create a "FontTools" subfolder in site-packages containing the actual fontTools package, as well as the standalone xmlWriter and sstruct modules. The latter modules are also deprecated, and scheduled for removal in upcoming releases. Please change your import statements to point to from fontTools.misc import xmlWriter and from fontTools.misc import sstruct.
- [scripts] Add a 'fonttools' command-line tool that simply runs fontTools.* sub-modules: e.g. `fonttools ttx`, `fonttools subset`, etc.
- [hmtx/vmts] Read advance width/heights as unsigned short (uint16); automatically round float values to integers.
- [ttLib/xmlWriter] add 'newlinestr=None' keyword argument to `TTFont.saveXML` for overriding os-specific line endings (passed on to `XMLWriter` instances).
- [versioning] Use versioneer instead of setuptools_scm to dynamically load version info from a git checkout at import time.
- [feaLib] Support backslash-prefixed glyph names.
## TTX/FontTools Version 3.1.2
2016-09-27
- restore Makefile as an alternative way to build/check/install
- README.md: update instructions for installing package from source, and for running test suite
- NEWS: Change log was out of sync with tagged release
## TTX/FontTools Version 3.1.1
2016-09-27
- Fix 'ttLibVersion' attribute in TTX files still showing '3.0' instead of '3.1'.
- Use setuptools_scm to manage package versions.
## TTX/FontTools Version 3.1.0
2016-09-26
- [feaLib] New library to parse and compile Adobe FDK OpenType Feature files.
- [mtiLib] New library to parse and compile Monotype 'FontDame' OpenType Layout Tables files.
- [voltLib] New library to parse Microsoft VOLT project files.
- [otlLib] New library to work with OpenType Layout tables.
- [varLib] New library to work with OpenType Font Variations.
- [pens] Add ttGlyphPen to draw to TrueType glyphs, and t2CharStringPen to draw to Type 2 Charstrings (CFF); add areaPen and perimeterPen.
- [ttLib.tables] Implement 'meta' and 'trak' tables.
- [ttx] Add --flavor option for compiling to 'woff' or 'woff2'; add --with-zopfli option to use Zopfli to compress WOFF 1.0 fonts.
- [subset] Support subsetting 'COLR'/'CPAL' and 'CBDT'/'CBLC' color fonts tables, and 'gvar' table for variation fonts.
- [Snippets] Add symfont.py, for symbolic font statistics analysis; interpolatable.py, a preliminary script for detecting interpolation errors; {merge,dump}_woff_metadata.py.
- [classifyTools] Helpers to classify things into classes.
- [CI] Run tests on Windows, Linux and macOS using Appveyor and Travis CI; check unit test coverage with Coverage.py/Coveralls; automatic deployment to PyPI on tags.
- [loggingTools] Use Python built-in logging module to print messages.
- [py23] Make round() behave like Python 3 built-in round(); define round2() and round3().
## TTX/FontTools Version 3.0
2015-09-01 <https://github.com/behdad/fonttools/commit/58f86f318af8b2f8b553e8cceef678d6ce0017c5>
- Add Snippet scripts for cmap subtable format conversion, printing GSUB/GPOS features, building a GX font from two masters
- TTX WOFF2 support and a `-f` option to overwrite output file(s)
- Support GX tables: `avar`, `gvar`, `fvar`, `meta`
- Support `feat` and gzip-compressed SVG tables
- Upgrade Mac East Asian encodings to native implementation if available
- Add Roman Croatian and Romanian encodings, codecs for mac-extended East Asian encodings
- Implement optimal GLYF glyph outline packing; disabled by default
## TTX/FontTools Version 2.5
2014-09-24 <https://github.com/behdad/fonttools/commit/8388a2e37ce349dac6555bb824c82723e3b65fbf>
- Add a Qt pen
- Add VDMX table converter
- Load all OpenType sub-structures lazily
- Add support for cmap format 13.
- Add pyftmerge tool
- Update to Unicode 6.3.0d3
- Add pyftinspect tool
- Add support for Google CBLC/CBDT color bitmaps, standard EBLC/EBDT embedded bitmaps, and `SVG ` table (thanks to Read Roberts at Adobe)
- Add support for loading, saving and ttx'ing WOFF file format
- Add support for Microsoft COLR/CPAL layered color glyphs
- Support PyPy
- Support Jython, by replacing numpy with array/lists modules and removed it, pure-Python StringIO, not cStringIO
- Add pyftsubset and Subsetter object, supporting CFF and TTF
- Add to ttx args for -q for quiet mode, -z to choose a bitmap dump format
## TTX/FontTools Version 2.4
- Option to write to arbitrary files
- Better dump format for DSIG
- Better detection of OTF XML
- Fix issue with Apple's kern table format
- Fix mangling of TT glyph programs
- Fix issues related to mona.ttf
- Fix Windows Installer instructions
- Fix some modern MacOS issues
- Fix minor issues and typos
## TTX/FontTools Version 2.3
- TrueType Collection (TTC) support
- Python 2.6 support
- Update Unicode data to 5.2.0
- Couple of bug fixes
## TTX/FontTools Version 2.2
- ClearType support
- cmap format 1 support
- PFA font support
- Switched from Numeric to numpy
- Update Unicode data to 5.1.0
- Update AGLFN data to 1.6
- Many bug fixes
## TTX/FontTools Version 2.1
- Many years worth of fixes and features
## TTX/FontTools Version 2.0 beta 2 (released ??? 2002)
- Be "forgiving" when interpreting the maxp table version field:
interpret any value as 1.0 if it's not 0.5. Fixes dumping of these
GPL fonts: http://www.freebsd.org/cgi/pds.cgi?ports/chinese/wangttf
- Fixed ttx -l: it turned out this part of the code didn't work with
Python 2.2.1 and earlier. My bad to do most of my testing with a
different version than I shipped TTX with :-(
- Fixed bug in ClassDef format 1 subtable (Andreas Seidel bumped into
this one).
## TTX/FontTools Version 2.0 beta 1 (released September 10 2002)
- Fixed embarrassing bug: the master checksum in the head table is now
calculated correctly even on little-endian platforms (such as Intel).
- Made the cmap format 4 compiler smarter: the binary data it creates is
now more or less as compact as possible. TTX now makes more compact
data than in any shipping font I've tested it with.
- Dump glyph names as a separate "GlyphOrder" pseudo table as opposed to
as part of the glyf table (obviously needed for CFF-OTF's).
- Added proper support for the CFF table.
- Don't barf on empty tables (questionable, but "there are font out there...")
- When writing TT glyf data, align glyphs on 4-byte boundaries. This seems
to be the current recommendation by MS. Also: don't barf on fonts which
are already 4-byte aligned.
- Windows installer contributed bu Adam Twardoch! Yay!
- Changed the command line interface again, now by creating one new tool
replacing the old ones: ttx
It dumps and compiles, depending on input file types. The options have
changed somewhat.
- The -d option is back (output dir)
- ttcompile's -i options is now called -m (as in "merge"), to avoid clash
with dump's -i.
- The -s option ("split tables") no longer creates a directory,
but instead outputs a small .ttx file containing references to the
individual table files. This is not a true link, it's a simple file
name, and the referenced file should be in the same directory so
ttcompile can find them.
- compile no longer accepts a directory as input argument. Instead it
can parse the new "mini-ttx" format as output by "ttx -s".
- all arguments are input files
- Renamed the command line programs and moved them to the Tools
subdirectory. They are now installed by the setup.py install script.
- Added OpenType support. BASE, GDEF, GPOS, GSUB and JSTF are (almost)
fully supported. The XML output is not yet final, as I'm still
considering to output certain subtables in a more human-friendly
manner.
- Fixed 'kern' table to correctly accept subtables it doesn't know about,
as well as interpreting Apple's definition of the 'kern' table headers
correctly.
- Fixed bug where glyphnames were not calculated from 'cmap' if it was
(one of the) first tables to be decompiled. More specifically: it cmap
was the first to ask for a glyphID -> glyphName mapping.
- Switched XML parsers: use expat instead of xmlproc. Should be faster.
- Removed my UnicodeString object: I now require Python 2.0 or up, which
has unicode support built in.
- Removed assert in glyf table: redundant data at the end of the table
is now ignored instead of raising an error. Should become a warning.
- Fixed bug in hmtx/vmtx code that only occured if all advances were equal.
- Fixed subtle bug in TT instruction disassembler.
- Couple of fixes to the 'post' table.
- Updated OS/2 table to latest spec.
## TTX/FontTools Version 1.0 beta 1
2001-08-10
- Reorganized the command line interface for ttDump.py and ttCompile.py,
they now behave more like "normal" command line tool, in that they accept
multiple input files for batch processing.
- ttDump.py and ttCompile.py don't silently override files anymore, but ask
before doing so. Can be overridden by -f.
- Added -d <destination-directory> option to both ttDump.py and ttCompile.py.
- Installation is now done with distutils. (Needs work for environments without
compilers.)
- Updated installation instructions.
- Added some workarounds so as to handle certain buggy fonts more gracefully.
- Updated Unicode table to Unicode 3.0 (Thanks Antoine!)
- Included a Python script by Adam Twardoch that adds some useful stuff to the
Windows registry.
- Moved the project to SourceForge.
## TTX/FontTools Version 1.0 alpha 6
2000-03-15
- Big reorganization: made ttLib a subpackage of the new fontTools package,
changed several module names. Called the entire suite "FontTools"
- Added several submodules to fontTools, some new, some older.
- Added experimental CFF/GPOS/GSUB support to ttLib, read-only (but XML dumping
of GPOS/GSUB is for now disabled)
- Fixed hdmx endian bug
- Added -b option to ttCompile.py, it disables recalculation of bounding boxes,
as requested by Werner Lemberg.
- Renamed tt2xml.pt to ttDump.py and xml2tt.py to ttCompile.py
- Use ".ttx" as file extension instead of ".xml".
- TTX is now the name of the XML-based *format* for TT fonts, and not just
an application.
## Version 1.0 alpha 5
Never released
- More tables supported: hdmx, vhea, vmtx
## Version 1.0 alpha 3 & 4
Never released
- fixed most portability issues
- retracted the "Euro_or_currency" change from 1.0a2: it was nonsense!
## Version 1.0 alpha 2
1999-05-02
- binary release for MacOS
- genenates full FOND resources: including width table, PS
font name info and kern table if applicable.
- added cmap format 4 support. Extra: dumps Unicode char names as XML comments!
- added cmap format 6 support
- now accepts true type files starting with "true"
(instead of just 0x00010000 and "OTTO")
- 'glyf' table support is now complete: I added support for composite scale,
xy-scale and two-by-two for the 'glyf' table. For now, component offset scale
behaviour defaults to Apple-style. This only affects the (re)calculation of
the glyph bounding box.
- changed "Euro" to "Euro_or_currency" in the Standard Apple Glyph order list,
since we cannot tell from the 'post' table which is meant. I should probably
doublecheck with a Unicode encoding if available. (This does not affect the
output!)
Fixed bugs:
- 'hhea' table is now recalculated correctly
- fixed wrong assumption about sfnt resource names
## Version 1.0 alpha 1
1999-04-27
- initial binary release for MacOS

403
NEWS.rst Normal file
View File

@ -0,0 +1,403 @@
- [ttx] Fixed 'I/O operation on closed file' error when dumping
multiple TTXs to standard output with the '-o -' option.
- The unit test modules (``*_test.py``) have been moved outside of the
fontTools package to the Tests folder, thus they are no longer
installed (#811).
3.5.0 (released 2017-01-14)
---------------------------
- Font tables read from XML can now be written back to XML with no
loss.
- GSUB/GPOS LookupType is written out in XML as an element, not
comment. (#792)
- When parsing cmap table, do not store items mapped to glyph id 0.
(#790)
- [otlLib] Make ClassDef sorting deterministic. Fixes #766 (7d1ddb2)
- [mtiLib] Added unit tests (#787)
- [cvar] Implemented cvar table
- [gvar] Renamed GlyphVariation to TupleVariation to match OpenType
terminology.
- [otTables] Handle gracefully empty VarData.Item array when compiling
XML. (#797)
- [varLib] Re-enabled generation of ``HVAR`` table for fonts with
TrueType outlines; removed ``--build-HVAR`` command-line option.
- [feaLib] The parser can now be extended to support non-standard
statements in FEA code by using a customized Abstract Syntax Tree.
See, for example, ``feaLib.builder_test.test_extensions`` and
baseClass.feax (#794, fixes #773).
- [feaLib] Added ``feaLib`` command to the 'fonttools' command-line
tool; applies a feature file to a font. ``fonttools feaLib -h`` for
help.
- [pens] The ``T2CharStringPen`` now takes an optional
``roundTolerance`` argument to control the rounding of coordinates
(#804, fixes #769).
- [ci] Measure test coverage on all supported python versions and OSes,
combine coverage data and upload to
https://codecov.io/gh/fonttools/fonttools (#786)
- [ci] Configured Travis and Appveyor for running tests on Python 3.6
(#785, 55c03bc)
- The manual pages installation directory can be customized through
``FONTTOOLS_MANPATH`` environment variable (#799, fixes #84).
- [Snippets] Added otf2ttf.py, for converting fonts from CFF to
TrueType using the googlei18n/cu2qu module (#802)
3.4.0 (released 2016-12-21)
---------------------------
- [feaLib] Added support for generating FEA text from abstract syntax
tree (AST) objects (#776). Thanks @mhosken
- Added ``agl.toUnicode`` function to convert AGL-compliant glyph names
to Unicode strings (#774)
- Implemented MVAR table (b4d5381)
3.3.1 (released 2016-12-15)
---------------------------
- [setup] We no longer use versioneer.py to compute fonttools version
from git metadata, as this has caused issues for some users (#767).
Now we bump the version strings manually with a custom ``release``
command of setup.py script.
3.3.0 (released 2016-12-06)
---------------------------
- [ttLib] Implemented STAT table from OpenType 1.8 (#758)
- [cffLib] Fixed decompilation of CFF fonts containing non-standard
key/value pairs in FontDict (issue #740; PR #744)
- [py23] minor: in ``round3`` function, allow the second argument to be
``None`` (#757)
- The standalone ``sstruct`` and ``xmlWriter`` modules, deprecated
since vesion 3.2.0, have been removed. They can be imported from the
``fontTools.misc`` package.
3.2.3 (released 2016-12-02)
---------------------------
- [py23] optimized performance of round3 function; added backport for
py35 math.isclose() (9d8dacb)
- [subset] fixed issue with 'narrow' (UCS-2) Python 2 builds and
``--text``/``--text-file`` options containing non-BMP chararcters
(16d0e5e)
- [varLib] fixed issuewhen normalizing location values (8fa2ee1, #749)
- [inspect] Made it compatible with both python2 and python3 (167ee60,
#748). Thanks @pnemade
3.2.2 (released 2016-11-24)
---------------------------
- [varLib] Do not emit null axes in fvar (1bebcec). Thanks @robmck-ms
- [varLib] Handle fonts without GPOS (7915a45)
- [merge] Ignore LangSys if None (a11bc56)
- [subset] Fix subsetting MathVariants (78d3cbe)
- [OS/2] Fix "Private Use (plane 15)" range (08a0d55). Thanks @mashabow
3.2.1 (released 2016-11-03)
---------------------------
- [OS/2] fix checking ``fsSelection`` bits matching ``head.macStyle``
bits
- [varLib] added ``--build-HVAR`` option to generate ``HVAR`` table for
fonts with TrueType outlines. For ``CFF2``, it is enabled by default.
3.2.0 (released 2016-11-02)
---------------------------
- [varLib] Improve support for OpenType 1.8 Variable Fonts:
- Implement GDEF's VariationStore
- Implement HVAR/VVAR tables
- Partial support for loading MutatorMath .designspace files with
varLib.designspace module
- Add varLib.models with Variation fonts interpolation models
- Implement GSUB/GPOS FeatureVariations
- Initial support for interpolating and merging OpenType Layout tables
(see ``varLib.interpolate_layout`` and ``varLib.merger`` modules)
- [API change] Change version to be an integer instead of a float in
XML output for GSUB, GPOS, GDEF, MATH, BASE, JSTF, HVAR, VVAR, feat,
hhea and vhea tables. Scripts that set the Version for those to 1.0
or other float values also need fixing. A warning is emitted when
code or XML needs fix.
- several bug fixes to the cffLib module, contributed by Adobe's
@readroberts
- The XML output for CFF table now has a 'major' and 'minor' elements
for specifying whether it's version 1.0 or 2.0 (support for CFF2 is
coming soon)
- [setup.py] remove undocumented/deprecated ``extra_path`` Distutils
argument. This means that we no longer create a "FontTools" subfolder
in site-packages containing the actual fontTools package, as well as
the standalone xmlWriter and sstruct modules. The latter modules are
also deprecated, and scheduled for removal in upcoming releases.
Please change your import statements to point to from fontTools.misc
import xmlWriter and from fontTools.misc import sstruct.
- [scripts] Add a 'fonttools' command-line tool that simply runs
``fontTools.*`` sub-modules: e.g. ``fonttools ttx``,
``fonttools subset``, etc.
- [hmtx/vmts] Read advance width/heights as unsigned short (uint16);
automatically round float values to integers.
- [ttLib/xmlWriter] add 'newlinestr=None' keyword argument to
``TTFont.saveXML`` for overriding os-specific line endings (passed on
to ``XMLWriter`` instances).
- [versioning] Use versioneer instead of ``setuptools_scm`` to
dynamically load version info from a git checkout at import time.
- [feaLib] Support backslash-prefixed glyph names.
3.1.2 (released 2016-09-27)
---------------------------
- restore Makefile as an alternative way to build/check/install
- README.md: update instructions for installing package from source,
and for running test suite
- NEWS: Change log was out of sync with tagged release
3.1.1 (released 2016-09-27)
---------------------------
- Fix ``ttLibVersion`` attribute in TTX files still showing '3.0'
instead of '3.1'.
- Use ``setuptools_scm`` to manage package versions.
3.1.0 (released 2016-09-26)
---------------------------
- [feaLib] New library to parse and compile Adobe FDK OpenType Feature
files.
- [mtiLib] New library to parse and compile Monotype 'FontDame'
OpenType Layout Tables files.
- [voltLib] New library to parse Microsoft VOLT project files.
- [otlLib] New library to work with OpenType Layout tables.
- [varLib] New library to work with OpenType Font Variations.
- [pens] Add ttGlyphPen to draw to TrueType glyphs, and t2CharStringPen
to draw to Type 2 Charstrings (CFF); add areaPen and perimeterPen.
- [ttLib.tables] Implement 'meta' and 'trak' tables.
- [ttx] Add --flavor option for compiling to 'woff' or 'woff2'; add
``--with-zopfli`` option to use Zopfli to compress WOFF 1.0 fonts.
- [subset] Support subsetting 'COLR'/'CPAL' and 'CBDT'/'CBLC' color
fonts tables, and 'gvar' table for variation fonts.
- [Snippets] Add ``symfont.py``, for symbolic font statistics analysis;
interpolatable.py, a preliminary script for detecting interpolation
errors; ``{merge,dump}_woff_metadata.py``.
- [classifyTools] Helpers to classify things into classes.
- [CI] Run tests on Windows, Linux and macOS using Appveyor and Travis
CI; check unit test coverage with Coverage.py/Coveralls; automatic
deployment to PyPI on tags.
- [loggingTools] Use Python built-in logging module to print messages.
- [py23] Make round() behave like Python 3 built-in round(); define
round2() and round3().
3.0 (released 2015-09-01)
-------------------------
- Add Snippet scripts for cmap subtable format conversion, printing
GSUB/GPOS features, building a GX font from two masters
- TTX WOFF2 support and a ``-f`` option to overwrite output file(s)
- Support GX tables: ``avar``, ``gvar``, ``fvar``, ``meta``
- Support ``feat`` and gzip-compressed SVG tables
- Upgrade Mac East Asian encodings to native implementation if
available
- Add Roman Croatian and Romanian encodings, codecs for mac-extended
East Asian encodings
- Implement optimal GLYF glyph outline packing; disabled by default
2.5 (released 2014-09-24)
-------------------------
- Add a Qt pen
- Add VDMX table converter
- Load all OpenType sub-structures lazily
- Add support for cmap format 13.
- Add pyftmerge tool
- Update to Unicode 6.3.0d3
- Add pyftinspect tool
- Add support for Google CBLC/CBDT color bitmaps, standard EBLC/EBDT
embedded bitmaps, and ``SVG`` table (thanks to Read Roberts at Adobe)
- Add support for loading, saving and ttx'ing WOFF file format
- Add support for Microsoft COLR/CPAL layered color glyphs
- Support PyPy
- Support Jython, by replacing numpy with array/lists modules and
removed it, pure-Python StringIO, not cStringIO
- Add pyftsubset and Subsetter object, supporting CFF and TTF
- Add to ttx args for -q for quiet mode, -z to choose a bitmap dump
format
2.4 (released 2013-06-22)
-------------------------
- Option to write to arbitrary files
- Better dump format for DSIG
- Better detection of OTF XML
- Fix issue with Apple's kern table format
- Fix mangling of TT glyph programs
- Fix issues related to mona.ttf
- Fix Windows Installer instructions
- Fix some modern MacOS issues
- Fix minor issues and typos
2.3 (released 2009-11-08)
-------------------------
- TrueType Collection (TTC) support
- Python 2.6 support
- Update Unicode data to 5.2.0
- Couple of bug fixes
2.2 (released 2008-05-18)
-------------------------
- ClearType support
- cmap format 1 support
- PFA font support
- Switched from Numeric to numpy
- Update Unicode data to 5.1.0
- Update AGLFN data to 1.6
- Many bug fixes
2.1 (released 2008-01-28)
-------------------------
- Many years worth of fixes and features
2.0b2 (released 2002-??-??)
---------------------------
- Be "forgiving" when interpreting the maxp table version field:
interpret any value as 1.0 if it's not 0.5. Fixes dumping of these
GPL fonts: http://www.freebsd.org/cgi/pds.cgi?ports/chinese/wangttf
- Fixed ttx -l: it turned out this part of the code didn't work with
Python 2.2.1 and earlier. My bad to do most of my testing with a
different version than I shipped TTX with :-(
- Fixed bug in ClassDef format 1 subtable (Andreas Seidel bumped into
this one).
2.0b1 (released 2002-09-10)
---------------------------
- Fixed embarrassing bug: the master checksum in the head table is now
calculated correctly even on little-endian platforms (such as Intel).
- Made the cmap format 4 compiler smarter: the binary data it creates
is now more or less as compact as possible. TTX now makes more
compact data than in any shipping font I've tested it with.
- Dump glyph names as a separate "GlyphOrder" pseudo table as opposed
to as part of the glyf table (obviously needed for CFF-OTF's).
- Added proper support for the CFF table.
- Don't barf on empty tables (questionable, but "there are font out
there...")
- When writing TT glyf data, align glyphs on 4-byte boundaries. This
seems to be the current recommendation by MS. Also: don't barf on
fonts which are already 4-byte aligned.
- Windows installer contributed bu Adam Twardoch! Yay!
- Changed the command line interface again, now by creating one new
tool replacing the old ones: ttx It dumps and compiles, depending on
input file types. The options have changed somewhat.
- The -d option is back (output dir)
- ttcompile's -i options is now called -m (as in "merge"), to avoid
clash with dump's -i.
- The -s option ("split tables") no longer creates a directory, but
instead outputs a small .ttx file containing references to the
individual table files. This is not a true link, it's a simple file
name, and the referenced file should be in the same directory so
ttcompile can find them.
- compile no longer accepts a directory as input argument. Instead it
can parse the new "mini-ttx" format as output by "ttx -s".
- all arguments are input files
- Renamed the command line programs and moved them to the Tools
subdirectory. They are now installed by the setup.py install script.
- Added OpenType support. BASE, GDEF, GPOS, GSUB and JSTF are (almost)
fully supported. The XML output is not yet final, as I'm still
considering to output certain subtables in a more human-friendly
manner.
- Fixed 'kern' table to correctly accept subtables it doesn't know
about, as well as interpreting Apple's definition of the 'kern' table
headers correctly.
- Fixed bug where glyphnames were not calculated from 'cmap' if it was
(one of the) first tables to be decompiled. More specifically: it
cmap was the first to ask for a glyphID -> glyphName mapping.
- Switched XML parsers: use expat instead of xmlproc. Should be faster.
- Removed my UnicodeString object: I now require Python 2.0 or up,
which has unicode support built in.
- Removed assert in glyf table: redundant data at the end of the table
is now ignored instead of raising an error. Should become a warning.
- Fixed bug in hmtx/vmtx code that only occured if all advances were
equal.
- Fixed subtle bug in TT instruction disassembler.
- Couple of fixes to the 'post' table.
- Updated OS/2 table to latest spec.
1.0b1 (released 2001-08-10)
---------------------------
- Reorganized the command line interface for ttDump.py and
ttCompile.py, they now behave more like "normal" command line tool,
in that they accept multiple input files for batch processing.
- ttDump.py and ttCompile.py don't silently override files anymore, but
ask before doing so. Can be overridden by -f.
- Added -d option to both ttDump.py and ttCompile.py.
- Installation is now done with distutils. (Needs work for environments
without compilers.)
- Updated installation instructions.
- Added some workarounds so as to handle certain buggy fonts more
gracefully.
- Updated Unicode table to Unicode 3.0 (Thanks Antoine!)
- Included a Python script by Adam Twardoch that adds some useful stuff
to the Windows registry.
- Moved the project to SourceForge.
1.0a6 (released 2000-03-15)
---------------------------
- Big reorganization: made ttLib a subpackage of the new fontTools
package, changed several module names. Called the entire suite
"FontTools"
- Added several submodules to fontTools, some new, some older.
- Added experimental CFF/GPOS/GSUB support to ttLib, read-only (but XML
dumping of GPOS/GSUB is for now disabled)
- Fixed hdmx endian bug
- Added -b option to ttCompile.py, it disables recalculation of
bounding boxes, as requested by Werner Lemberg.
- Renamed tt2xml.pt to ttDump.py and xml2tt.py to ttCompile.py
- Use ".ttx" as file extension instead of ".xml".
- TTX is now the name of the XML-based *format* for TT fonts, and not
just an application.
1.0a5
-----
Never released
- More tables supported: hdmx, vhea, vmtx
1.0a3 & 1.0a4
-------------
Never released
- fixed most portability issues
- retracted the "Euro_or_currency" change from 1.0a2: it was
nonsense!
1.0a2 (released 1999-05-02)
---------------------------
- binary release for MacOS
- genenates full FOND resources: including width table, PS font name
info and kern table if applicable.
- added cmap format 4 support. Extra: dumps Unicode char names as XML
comments!
- added cmap format 6 support
- now accepts true type files starting with "true" (instead of just
0x00010000 and "OTTO")
- 'glyf' table support is now complete: I added support for composite
scale, xy-scale and two-by-two for the 'glyf' table. For now,
component offset scale behaviour defaults to Apple-style. This only
affects the (re)calculation of the glyph bounding box.
- changed "Euro" to "Euro_or_currency" in the Standard Apple Glyph
order list, since we cannot tell from the 'post' table which is
meant. I should probably doublecheck with a Unicode encoding if
available. (This does not affect the output!)
Fixed bugs: - 'hhea' table is now recalculated correctly - fixed wrong
assumption about sfnt resource names
1.0a1 (released 1999-04-27)
---------------------------
- initial binary release for MacOS

232
README.md
View File

@ -1,232 +0,0 @@
[![Travis Build Status](https://travis-ci.org/fonttools/fonttools.svg)](https://travis-ci.org/fonttools/fonttools)
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/0f7fmee9as744sl7/branch/master?svg=true)](https://ci.appveyor.com/project/fonttools/fonttools/branch/master)
[![Health](https://landscape.io/github/behdad/fonttools/master/landscape.svg?style=flat)](https://landscape.io/github/behdad/fonttools/master)
[![Coverage Status](https://codecov.io/gh/fonttools/fonttools/branch/master/graph/badge.svg)](https://codecov.io/gh/fonttools/fonttools)
[![PyPI](https://img.shields.io/pypi/v/fonttools.svg)](https://pypi.org/project/FontTools)
### What is this?
fontTools is a library for manipulating fonts, written in Python.
The project includes the TTX tool, that can convert TrueType and OpenType fonts to and from an XML text format, which is also called TTX.
It supports TrueType, OpenType, AFM and to an extent Type 1 and some Mac-specific formats.
The project has a [BSD-style open-source licence](LICENSE).
Among other things this means you can use it free of charge.
### Installation
FontTools requires [Python](http://www.python.org/download/) 2.7, 3.4 or later.
The package is listed in the Python Package Index (PyPI), so you can install it with [`pip`](https://pip.pypa.io):
```sh
pip install fonttools
```
If you would like to contribute to its development, you can clone the repository from Github, install the package in 'editable' mode and modify the source code in place. We recommend creating a virtual environment, using [`virtualenv`](https://virtualenv.pypa.io) or Python 3 [`venv`](https://docs.python.org/3/library/venv.html) module.
```sh
# download the source code to 'fonttools' folder
git clone https://github.com/fonttools/fonttools.git
cd fonttools
# create new virtual environment called e.g. 'fonttools-venv', or anything you like
python -m virtualenv fonttools-venv
# source the `activate` shell script to enter the environment (Un\*x); to exit, just type `deactivate`
. fonttools-venv/bin/activate
# to activate the virtual environment in Windows `cmd.exe`, do
fonttools-venv\Scripts\activate.bat
# install in 'editable' mode
pip install -e .
```
### TTX From OpenType and TrueType to XML and Back
Once installed you can use the `ttx` command to convert binary font files (`.otf`, `.ttf`, etc) to the TTX xml format, edit them, and convert them back to binary format.
TTX files have a .ttx file extension.
```sh
ttx /path/to/font.otf
ttx /path/to/font.ttx
```
The TTX application works can be used in two ways, depending on what platform you run it on:
* As a command line tool (Windows/DOS, Unix, MacOSX)
* By dropping files onto the application (Windows, MacOS)
TTX detects what kind of files it is fed: it will output a `.ttx` file when it sees a `.ttf` or `.otf`, and it will compile a `.ttf` or `.otf` when the input file is a `.ttx` file.
By default, the output file is created in the same folder as the input file, and will have the same name as the input file but with a different extension.
TTX will _never_ overwrite existing files, but if necessary will append a unique number to the output filename (before the extension) such as `Arial#1.ttf`
When using TTX from the command line there are a bunch of extra options, these are explained in the help text, as displayed when typing `ttx -h` at the command prompt.
These additional options include:
* specifying the folder where the output files are created
* specifying which tables to dump or which tables to exclude
* merging partial `.ttx` files with existing `.ttf` or `.otf` files
* listing brief table info instead of dumping to `.ttx`
* splitting tables to separate `.ttx` files
* disabling TrueType instruction disassembly
#### The TTX file format
The following tables are currently supported:
<!-- begin table list -->
BASE, CBDT, CBLC, CFF, COLR, CPAL, DSIG, EBDT, EBLC, FFTM, GDEF,
GMAP, GPKG, GPOS, GSUB, HVAR, JSTF, LTSH, MATH, META, MVAR, OS/2,
SING, STAT, SVG, TSI0, TSI1, TSI2, TSI3, TSI5, TSIB, TSID, TSIJ,
TSIP, TSIS, TSIV, VDMX, VORG, VVAR, avar, cmap, cvar, cvt, feat,
fpgm, fvar, gasp, glyf, gvar, hdmx, head, hhea, hmtx, kern, loca,
ltag, maxp, meta, name, post, prep, sbix, trak, vhea and vmtx
<!-- end table list -->
Other tables are dumped as hexadecimal data.
TrueType fonts use glyph indices (GlyphIDs) to refer to glyphs in most places.
While this is fine in binary form, it is really hard to work with for humans.
Therefore we use names instead.
The glyph names are either extracted from the `CFF ` table or the `post` table, or are derived from a Unicode `cmap` table.
In the latter case the Adobe Glyph List is used to calculate names based on Unicode values.
If all of these methods fail, names are invented based on GlyphID (eg `glyph00142`)
It is possible that different glyphs use the same name.
If this happens, we force the names to be unique by appending `#n` to the name (`n` being an integer number.)
The original names are being kept, so this has no influence on a "round tripped" font.
Because the order in which glyphs are stored inside the binary font is important, we maintain an ordered list of glyph names in the font.
### Other Tools
Commands for inspecting, merging and subsetting fonts are also available:
```sh
pyftinspect
pyftmerge
pyftsubset
```
### fontTools Python Module
The fontTools python module provides a convenient way to programmatically edit font files.
```py
>>> from fontTools.ttLib import TTFont
>>> font = TTFont('/path/to/font.ttf')
>>> font
<fontTools.ttLib.TTFont object at 0x10c34ed50>
>>>
```
A selection of sample python programs is in the [Snippets](https://github.com/fonttools/fonttools/blob/master/Snippets/) directory.
### Testing
To run the test suite, you can do:
```sh
python setup.py test
```
If you have [pytest](http://docs.pytest.org/en/latest/), you can run the `pytest` command directly.
The tests will run against the installed `fontTools` package, or the first one found in the `PYTHONPATH`.
You can also use [tox](https://testrun.org/tox/latest/) to automatically run tests on different Python versions in isolated virtual environments.
```sh
pip install tox
tox
```
Note that when you run `tox` without arguments, the tests are executed for all the environments listed in tox.ini's `envlist`. In our case, this includes Python 2.7, 3.5 and 3.6, so for this to work the `python2.7`, `python3.5` and `python3.6` executables must be available in your `PATH`.
You can specify an alternative environment list via the `-e` option, or the `TOXENV` environment variable:
```sh
tox -e py27-nocov
TOXENV="py{27,36}-cov" tox
```
### Development Community
TTX/FontTools development is ongoing in an active community of developers, that includes professional developers employed at major software corporations and type foundries as well as hobbyists.
Feature requests and bug reports are always welcome at <https://github.com/fonttools/fonttools/issues/>
The best place for discussions about TTX from an end-user perspective as well as TTX/FontTools development is the <https://groups.google.com/d/forum/fonttools> mailing list.
There is also a development <https://groups.google.com/d/forum/fonttools-dev> mailing list for continuous integration notifications.
You can also email Behdad privately at <behdad@behdad.org>
### History
The fontTools project was started by Just van Rossum in 1999, and was maintained as an open source project at <http://sourceforge.net/projects/fonttools/>.
In 2008, Paul Wise (pabs3) began helping Just with stability maintenance.
In 2013 Behdad Esfahbod began a friendly fork, thoroughly reviewing the codebase and making changes at <https://github.com/behdad/fonttools> to add new features and support for new font formats.
### Acknowledgements
In alphabetical order:
Olivier Berten,
Samyak Bhuta,
Erik van Blokland,
Petr van Blokland,
Jelle Bosma,
Sascha Brawer,
Tom Byrer,
Frédéric Coiffier,
Vincent Connare,
Dave Crossland,
Simon Daniels,
Behdad Esfahbod,
Behnam Esfahbod,
Hannes Famira,
Sam Fishman,
Matt Fontaine,
Yannis Haralambous,
Greg Hitchcock,
Jeremie Hornus,
Khaled Hosny,
John Hudson,
Denis Moyogo Jacquerye,
Jack Jansen,
Tom Kacvinsky,
Jens Kutilek,
Antoine Leca,
Werner Lemberg,
Tal Leming,
Peter Lofting,
Cosimo Lupo,
Masaya Nakamura,
Dave Opstad,
Laurence Penney,
Roozbeh Pournader,
Garret Rieger,
Read Roberts,
Guido van Rossum,
Just van Rossum,
Andreas Seidel,
Georg Seifert,
Miguel Sousa,
Adam Twardoch,
Adrien Tétar,
Vitaly Volkov,
Paul Wise.
### Copyrights
Copyright (c) 1999-2004 Just van Rossum, LettError (just@letterror.com)
See [LICENSE](LICENSE) for the full license.
Copyright (c) 2000 BeOpen.com.
All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved.
Have fun!

266
README.rst Normal file
View File

@ -0,0 +1,266 @@
|Travis Build Status| |Appveyor Build status| |Health| |Coverage Status|
|PyPI|
What is this?
~~~~~~~~~~~~~
| fontTools is a library for manipulating fonts, written in Python. The
project includes the TTX tool, that can convert TrueType and OpenType
fonts to and from an XML text format, which is also called TTX. It
supports TrueType, OpenType, AFM and to an extent Type 1 and some
Mac-specific formats. The project has a `BSD-style open-source
licence <LICENSE>`__.
| Among other things this means you can use it free of charge.
Installation
~~~~~~~~~~~~
FontTools requires `Python <http://www.python.org/download/>`__ 2.7, 3.4
or later.
The package is listed in the Python Package Index (PyPI), so you can
install it with `pip <https://pip.pypa.io>`__:
.. code:: sh
pip install fonttools
If you would like to contribute to its development, you can clone the
repository from Github, install the package in 'editable' mode and
modify the source code in place. We recommend creating a virtual
environment, using `virtualenv <https://virtualenv.pypa.io>`__ or
Python 3 `venv <https://docs.python.org/3/library/venv.html>`__ module.
.. code:: sh
# download the source code to 'fonttools' folder
git clone https://github.com/fonttools/fonttools.git
cd fonttools
# create new virtual environment called e.g. 'fonttools-venv', or anything you like
python -m virtualenv fonttools-venv
# source the `activate` shell script to enter the environment (Un\*x); to exit, just type `deactivate`
. fonttools-venv/bin/activate
# to activate the virtual environment in Windows `cmd.exe`, do
fonttools-venv\Scripts\activate.bat
# install in 'editable' mode
pip install -e .
TTX From OpenType and TrueType to XML and Back
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Once installed you can use the ``ttx`` command to convert binary font
files (``.otf``, ``.ttf``, etc) to the TTX xml format, edit them, and
convert them back to binary format. TTX files have a .ttx file
extension.
.. code:: sh
ttx /path/to/font.otf
ttx /path/to/font.ttx
The TTX application works can be used in two ways, depending on what
platform you run it on:
- As a command line tool (Windows/DOS, Unix, MacOSX)
- By dropping files onto the application (Windows, MacOS)
TTX detects what kind of files it is fed: it will output a ``.ttx`` file
when it sees a ``.ttf`` or ``.otf``, and it will compile a ``.ttf`` or
``.otf`` when the input file is a ``.ttx`` file. By default, the output
file is created in the same folder as the input file, and will have the
same name as the input file but with a different extension. TTX will
*never* overwrite existing files, but if necessary will append a unique
number to the output filename (before the extension) such as
``Arial#1.ttf``
When using TTX from the command line there are a bunch of extra options,
these are explained in the help text, as displayed when typing
``ttx -h`` at the command prompt. These additional options include:
- specifying the folder where the output files are created
- specifying which tables to dump or which tables to exclude
- merging partial ``.ttx`` files with existing ``.ttf`` or ``.otf``
files
- listing brief table info instead of dumping to ``.ttx``
- splitting tables to separate ``.ttx`` files
- disabling TrueType instruction disassembly
The TTX file format
^^^^^^^^^^^^^^^^^^^
The following tables are currently supported:
.. begin table list
.. code::
BASE, CBDT, CBLC, CFF, COLR, CPAL, DSIG, EBDT, EBLC, FFTM, GDEF,
GMAP, GPKG, GPOS, GSUB, HVAR, JSTF, LTSH, MATH, META, MVAR, OS/2,
SING, STAT, SVG, TSI0, TSI1, TSI2, TSI3, TSI5, TSIB, TSID, TSIJ,
TSIP, TSIS, TSIV, VDMX, VORG, VVAR, avar, cmap, cvar, cvt, feat,
fpgm, fvar, gasp, glyf, gvar, hdmx, head, hhea, hmtx, kern, loca,
ltag, maxp, meta, name, post, prep, sbix, trak, vhea and vmtx
.. end table list
Other tables are dumped as hexadecimal data.
TrueType fonts use glyph indices (GlyphIDs) to refer to glyphs in most
places. While this is fine in binary form, it is really hard to work
with for humans. Therefore we use names instead.
The glyph names are either extracted from the ``CFF`` table or the
``post`` table, or are derived from a Unicode ``cmap`` table. In the
latter case the Adobe Glyph List is used to calculate names based on
Unicode values. If all of these methods fail, names are invented based
on GlyphID (eg ``glyph00142``)
It is possible that different glyphs use the same name. If this happens,
we force the names to be unique by appending ``#n`` to the name (``n``
being an integer number.) The original names are being kept, so this has
no influence on a "round tripped" font.
Because the order in which glyphs are stored inside the binary font is
important, we maintain an ordered list of glyph names in the font.
Other Tools
~~~~~~~~~~~
Commands for inspecting, merging and subsetting fonts are also
available:
.. code:: sh
pyftinspect
pyftmerge
pyftsubset
fontTools Python Module
~~~~~~~~~~~~~~~~~~~~~~~
The fontTools python module provides a convenient way to
programmatically edit font files.
.. code:: py
>>> from fontTools.ttLib import TTFont
>>> font = TTFont('/path/to/font.ttf')
>>> font
<fontTools.ttLib.TTFont object at 0x10c34ed50>
>>>
A selection of sample python programs is in the
`Snippets <https://github.com/fonttools/fonttools/blob/master/Snippets/>`__
directory.
Testing
~~~~~~~
To run the test suite, you can do:
.. code:: sh
python setup.py test
If you have `pytest <http://docs.pytest.org/en/latest/>`__, you can run
the ``pytest`` command directly. The tests will run against the
installed ``fontTools`` package, or the first one found in the
``PYTHONPATH``.
You can also use `tox <https://testrun.org/tox/latest/>`__ to
automatically run tests on different Python versions in isolated virtual
environments.
.. code:: sh
pip install tox
tox
Note that when you run ``tox`` without arguments, the tests are executed
for all the environments listed in tox.ini's ``envlist``. In our case,
this includes Python 2.7, 3.5 and 3.6, so for this to work the
``python2.7``, ``python3.5`` and ``python3.6`` executables must be
available in your ``PATH``.
You can specify an alternative environment list via the ``-e`` option,
or the ``TOXENV`` environment variable:
.. code:: sh
tox -e py27-nocov
TOXENV="py{27,36}-cov" tox
Development Community
~~~~~~~~~~~~~~~~~~~~~
TTX/FontTools development is ongoing in an active community of
developers, that includes professional developers employed at major
software corporations and type foundries as well as hobbyists.
Feature requests and bug reports are always welcome at
https://github.com/fonttools/fonttools/issues/
The best place for discussions about TTX from an end-user perspective as
well as TTX/FontTools development is the
https://groups.google.com/d/forum/fonttools mailing list. There is also
a development https://groups.google.com/d/forum/fonttools-dev mailing
list for continuous integration notifications. You can also email Behdad
privately at behdad@behdad.org
History
~~~~~~~
The fontTools project was started by Just van Rossum in 1999, and was
maintained as an open source project at
http://sourceforge.net/projects/fonttools/. In 2008, Paul Wise (pabs3)
began helping Just with stability maintenance. In 2013 Behdad Esfahbod
began a friendly fork, thoroughly reviewing the codebase and making
changes at https://github.com/behdad/fonttools to add new features and
support for new font formats.
Acknowledgements
~~~~~~~~~~~~~~~~
In alphabetical order:
Olivier Berten, Samyak Bhuta, Erik van Blokland, Petr van Blokland,
Jelle Bosma, Sascha Brawer, Tom Byrer, Frédéric Coiffier, Vincent
Connare, Dave Crossland, Simon Daniels, Behdad Esfahbod, Behnam
Esfahbod, Hannes Famira, Sam Fishman, Matt Fontaine, Yannis Haralambous,
Greg Hitchcock, Jeremie Hornus, Khaled Hosny, John Hudson, Denis Moyogo
Jacquerye, Jack Jansen, Tom Kacvinsky, Jens Kutilek, Antoine Leca,
Werner Lemberg, Tal Leming, Peter Lofting, Cosimo Lupo, Masaya Nakamura,
Dave Opstad, Laurence Penney, Roozbeh Pournader, Garret Rieger, Read
Roberts, Guido van Rossum, Just van Rossum, Andreas Seidel, Georg
Seifert, Miguel Sousa, Adam Twardoch, Adrien Tétar, Vitaly Volkov, Paul
Wise.
Copyrights
~~~~~~~~~~
| Copyright (c) 1999-2004 Just van Rossum, LettError
(just@letterror.com)
| See `LICENSE <LICENSE>`__ for the full license.
Copyright (c) 2000 BeOpen.com. All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All
Rights Reserved.
Have fun!
.. |Travis Build Status| image:: https://travis-ci.org/fonttools/fonttools.svg
:target: https://travis-ci.org/fonttools/fonttools
.. |Appveyor Build status| image:: https://ci.appveyor.com/api/projects/status/0f7fmee9as744sl7/branch/master?svg=true
:target: https://ci.appveyor.com/project/fonttools/fonttools/branch/master
.. |Health| image:: https://landscape.io/github/behdad/fonttools/master/landscape.svg?style=flat
:target: https://landscape.io/github/behdad/fonttools/master
.. |Coverage Status| image:: https://codecov.io/gh/fonttools/fonttools/branch/master/graph/badge.svg
:target: https://codecov.io/gh/fonttools/fonttools
.. |PyPI| image:: https://img.shields.io/pypi/v/fonttools.svg
:target: https://pypi.org/project/FontTools

View File

@ -11,6 +11,7 @@ from distutils import log
from distutils.util import convert_path
import subprocess as sp
import contextlib
import re
# Force distutils to use py_compile.compile() function with 'doraise' argument
# set to True, in order to raise an exception on compilation errors
@ -47,13 +48,14 @@ classifiers = {"classifiers": [
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
]}
long_description = """\
FontTools/TTX is a library to manipulate font files from Python.
It supports reading and writing of TrueType/OpenType fonts, reading
and writing of AFM files, reading (and partially writing) of PS Type 1
fonts. The package also contains a tool called "TTX" which converts
TrueType/OpenType fonts to and from an XML-based format.
"""
# concatenate README.rst and NEWS.rest into long_description so they are
# displayed on the FontTols project page on PyPI
with io.open("README.rst", "r", encoding="utf-8") as readme:
long_description = readme.read()
long_description += "\n"
with io.open("NEWS.rst", "r", encoding="utf-8") as changelog:
long_description += changelog.read()
@contextlib.contextmanager
@ -89,8 +91,8 @@ class release(Command):
new backward-compatible functionalities. No options imply 'patch' or bug-fix
release.
A new header is also added to the changelog file ("NEWS"), containing the
new version string and the current 'YYYY-MM-DD' date.
A new header is also added to the changelog file ("NEWS.rst"), containing
the new version string and the current 'YYYY-MM-DD' date.
All changes are committed, and an annotated git tag is generated. With the
--sign option, the tag is GPG-signed with the user's default key.
@ -114,9 +116,10 @@ class release(Command):
("allow-dirty", None, "don't abort if working directory is dirty"),
]
changelog_name = "NEWS"
changelog_header = u"## TTX/FontTools Version "
changelog_date_fmt = "%Y-%m-%d"
changelog_name = "NEWS.rst"
version_RE = re.compile("^[0-9]+\.[0-9]+")
date_fmt = u"%Y-%m-%d"
header_fmt = u"%s (released %s)"
commit_message = "Release {new_version}"
tag_name = "{new_version}"
version_files = [
@ -226,19 +229,17 @@ class release(Command):
changes = []
with io.open(self.changelog_name, "r+", encoding="utf-8") as f:
for ln in f:
if ln.startswith(self.changelog_header):
if self.version_RE.match(ln):
break
else:
changes.append(ln)
if not self.dry_run:
f.seek(0)
content = f.read()
date = datetime.today().strftime(self.date_fmt)
f.seek(0)
f.write(u"%s%s\n\n%s\n\n%s" % (
self.changelog_header,
version,
datetime.today().strftime(self.changelog_date_fmt),
content))
header = self.header_fmt % (version, date)
f.write(header + u"\n" + u"-"*len(header) + u"\n\n" + content)
return u"".join(changes)