Merge branch 'main' into ttf2otf
This commit is contained in:
commit
fd2f34285f
@ -1,6 +1,6 @@
|
||||
###########################################
|
||||
afmLib: Read/write Adobe Font Metrics files
|
||||
###########################################
|
||||
###############################################
|
||||
afmLib: Read and write Adobe Font Metrics files
|
||||
###############################################
|
||||
|
||||
.. automodule:: fontTools.afmLib
|
||||
|
||||
|
10
Doc/source/cffLib/CFF2ToCFF.rst
Normal file
10
Doc/source/cffLib/CFF2ToCFF.rst
Normal file
@ -0,0 +1,10 @@
|
||||
##############################
|
||||
CFF2ToCFF: convert CFF2 to CFF
|
||||
##############################
|
||||
|
||||
.. automodule:: fontTools.cffLib.CFF2ToCFF
|
||||
:inherited-members:
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
|
8
Doc/source/cffLib/CFFToCFF2.rst
Normal file
8
Doc/source/cffLib/CFFToCFF2.rst
Normal file
@ -0,0 +1,8 @@
|
||||
##############################
|
||||
CFFToCFF2: convert CFF to CFF2
|
||||
##############################
|
||||
|
||||
.. automodule:: fontTools.cffLib.CFFToCFF2
|
||||
:inherited-members:
|
||||
:members:
|
||||
:undoc-members:
|
@ -1,13 +1,38 @@
|
||||
##################################
|
||||
cffLib: read/write Adobe CFF fonts
|
||||
##################################
|
||||
######################################
|
||||
cffLib: Read and write Adobe CFF fonts
|
||||
######################################
|
||||
|
||||
.. rubric:: Overview:
|
||||
:heading-level: 3
|
||||
|
||||
|
||||
.. automodule:: fontTools.cffLib
|
||||
:inherited-members:
|
||||
:members:
|
||||
:undoc-members:
|
||||
:member-order: bysource
|
||||
|
||||
This package also contains two modules for manipulating CFF format glyphs:
|
||||
.. rubric:: Submodules:
|
||||
:heading-level: 3
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
cffLib contains submodules for converting between CCF and CFF2.
|
||||
Each can be used within other Python scripts or run as a
|
||||
subcommand of the ``fonttools`` command-line tool:
|
||||
|
||||
specializer
|
||||
width
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
CFFToCFF2
|
||||
CFF2ToCFF
|
||||
|
||||
It also contains submodules for manipulating CFF-formatted glyphs:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
specializer
|
||||
width
|
||||
|
||||
.. rubric:: Module members:
|
||||
:heading-level: 3
|
||||
|
||||
|
@ -2,7 +2,15 @@
|
||||
specializer: T2CharString operator specializer and generalizer
|
||||
##############################################################
|
||||
|
||||
.. rubric:: Overview:
|
||||
:heading-level: 3
|
||||
|
||||
.. automodule:: fontTools.cffLib.specializer
|
||||
:inherited-members:
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
|
||||
.. rubric:: Module members:
|
||||
:heading-level: 3
|
||||
|
||||
|
@ -44,6 +44,7 @@ autodoc_default_options = {
|
||||
"members": True,
|
||||
"inherited-members": True,
|
||||
"show-inheritance": True,
|
||||
"member-order": "bysource",
|
||||
}
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
@ -89,6 +90,9 @@ language = "en"
|
||||
# This patterns also effect to html_static_path and html_extra_path
|
||||
exclude_patterns = []
|
||||
|
||||
# The programming language to be used by default in syntax highlighting.
|
||||
highlight_language = "python"
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
# pygments_style = "sphinx" (the default sphinx docs style on RTD)
|
||||
pygments_style = "default"
|
||||
|
@ -1,5 +1,5 @@
|
||||
###########################
|
||||
config: configure fontTools
|
||||
config: Configure fontTools
|
||||
###########################
|
||||
|
||||
.. automodule:: fontTools.config
|
||||
|
@ -1,6 +1,6 @@
|
||||
##########################################
|
||||
cu2qu: Cubic to quadratic curve conversion
|
||||
##########################################
|
||||
########################################
|
||||
cu2qu: Convert cubic curves to quadratic
|
||||
########################################
|
||||
|
||||
Routines for converting cubic curves to quadratic splines, suitable for use
|
||||
in OpenType to TrueType outline conversion.
|
||||
|
@ -4,7 +4,7 @@ designspaceLib: Read, write, and edit designspace files
|
||||
|
||||
Implements support for reading and manipulating ``designspace`` files.
|
||||
Allows the users to define axes, rules, sources, variable fonts and instances,
|
||||
and their STAT information.
|
||||
and their ``STAT`` information.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
##################################################
|
||||
encodings: Support for OpenType-specific encodings
|
||||
##################################################
|
||||
############################################################
|
||||
encodings: Support for OpenType-specific character encodings
|
||||
############################################################
|
||||
|
||||
fontTools includes support for some character encodings found in legacy Mac
|
||||
TrueType fonts. Many of these legacy encodings have found their way into the
|
||||
|
@ -1,6 +1,6 @@
|
||||
#########################################
|
||||
feaLib: Read/write OpenType feature files
|
||||
#########################################
|
||||
#############################################
|
||||
feaLib: Read and write OpenType feature files
|
||||
#############################################
|
||||
|
||||
fontTools' ``feaLib`` allows for the creation and parsing of Adobe
|
||||
Font Development Kit for OpenType feature (``.fea``) files. The syntax
|
||||
|
@ -1,6 +1,26 @@
|
||||
####
|
||||
pens
|
||||
####
|
||||
###########################################
|
||||
pens: Inspect and manipulate glyph outlines
|
||||
###########################################
|
||||
|
||||
.. rubric:: Overview:
|
||||
:heading-level: 3
|
||||
|
||||
The fontTools **pens** are a collection of classes that can operate
|
||||
on a font glyph via the points and the contours of the glyph's outlines.
|
||||
|
||||
Some pens trace through the outlines and generate graphical output,
|
||||
such as a new glyph outline or a formatted image, but other
|
||||
pens analyze the outlines and return information about the glyph.
|
||||
|
||||
Pens that alter or produce a pen-compatible :class:`.ttGlyph` object can
|
||||
be chained together.
|
||||
|
||||
New pens can be written by sub-classing the :class:`.AbstractPen` or,
|
||||
somewhat more practically, :class:`.BasePen` classes. The Pen Protocol is
|
||||
documented on the :ref:`basePen` page.
|
||||
|
||||
.. rubric:: Pen modules:
|
||||
:heading-level: 3
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
######
|
||||
subset
|
||||
######
|
||||
########################################################
|
||||
subset: Generate subsets of fonts or optimize file sizes
|
||||
########################################################
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
######
|
||||
svgLib
|
||||
######
|
||||
############################################
|
||||
svgLib: Read and write SVG-in-OpenType fonts
|
||||
############################################
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
#####
|
||||
t1Lib
|
||||
#####
|
||||
#############################################
|
||||
t1Lib: Read and write PostScript Type 1 fonts
|
||||
#############################################
|
||||
|
||||
.. automodule:: fontTools.t1Lib
|
||||
:inherited-members:
|
||||
|
@ -1,6 +1,6 @@
|
||||
#############################################
|
||||
ttLib: Read/write OpenType and TrueType fonts
|
||||
#############################################
|
||||
#################################################
|
||||
ttLib: Read and write OpenType and TrueType fonts
|
||||
#################################################
|
||||
|
||||
Most users of the fontTools library will be using it to generate or manipulate
|
||||
OpenType and TrueType fonts. (FontTools initially only supported TrueType fonts,
|
||||
|
@ -1,6 +1,6 @@
|
||||
###
|
||||
ttx
|
||||
###
|
||||
##################################
|
||||
ttx: Convert fonts to XML and back
|
||||
##################################
|
||||
|
||||
|
||||
TTX – From OpenType and TrueType to XML and Back
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
##########
|
||||
converters
|
||||
##########
|
||||
#######################################################
|
||||
converters: Conversion functions for kerning and groups
|
||||
#######################################################
|
||||
|
||||
.. automodule:: fontTools.ufoLib.converters
|
||||
:inherited-members:
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
######
|
||||
errors
|
||||
######
|
||||
###################################################
|
||||
errors: Exceptions for handling UFO-specific errors
|
||||
###################################################
|
||||
|
||||
.. automodule:: fontTools.ufoLib.errors
|
||||
:inherited-members:
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
#########
|
||||
filenames
|
||||
#########
|
||||
##########################################################################
|
||||
filenames: Functions to convert between file names and user-facing strings
|
||||
##########################################################################
|
||||
|
||||
.. automodule:: fontTools.ufoLib.filenames
|
||||
:inherited-members:
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
#######
|
||||
glifLib
|
||||
#######
|
||||
#######################################
|
||||
glifLib: Read and write UFO .glif files
|
||||
#######################################
|
||||
|
||||
.. automodule:: fontTools.ufoLib.glifLib
|
||||
:inherited-members:
|
||||
|
@ -1,22 +1,45 @@
|
||||
################################################
|
||||
ufoLib: Read and write Unified Font Object files
|
||||
################################################
|
||||
|
||||
######
|
||||
ufoLib
|
||||
######
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
converters
|
||||
errors
|
||||
filenames
|
||||
glifLib
|
||||
kerning
|
||||
plistlib
|
||||
pointpen
|
||||
utils
|
||||
validators
|
||||
.. rubric:: Overview:
|
||||
:heading-level: 3
|
||||
|
||||
.. automodule:: fontTools.ufoLib
|
||||
:inherited-members:
|
||||
:members:
|
||||
:members:
|
||||
:undoc-members:
|
||||
:member-order: bysource
|
||||
|
||||
.. rubric:: Submodules:
|
||||
:heading-level: 3
|
||||
|
||||
ufoLib provides the following submodules:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:titlesonly:
|
||||
|
||||
converters
|
||||
errors
|
||||
filenames
|
||||
glifLib
|
||||
kerning
|
||||
utils
|
||||
validators
|
||||
|
||||
Two deprecated submodules are also currently included:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
plistlib
|
||||
pointpen
|
||||
|
||||
.. rubric:: Module members:
|
||||
:heading-level: 3
|
||||
|
||||
.. autodata:: fontInfoAttributesVersion1
|
||||
.. autodata:: fontInfoAttributesVersion2
|
||||
.. autodata:: fontInfoAttributesVersion3
|
||||
.. autodata:: deprecatedFontInfoAttributesVersion2
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
#######
|
||||
kerning
|
||||
#######
|
||||
###########################################
|
||||
kerning: Support for accessing kerning data
|
||||
###########################################
|
||||
|
||||
.. automodule:: fontTools.ufoLib.kerning
|
||||
:inherited-members:
|
||||
|
@ -1,9 +1,10 @@
|
||||
#####################################################################
|
||||
plistlib: Support for reading and writing .plist files *[deprecated]*
|
||||
#####################################################################
|
||||
|
||||
########
|
||||
plistlib
|
||||
########
|
||||
|
||||
.. automodule:: fontTools.ufoLib.plistlib
|
||||
:inherited-members:
|
||||
:members:
|
||||
:undoc-members:
|
||||
.. important::
|
||||
|
||||
.. automodule:: fontTools.ufoLib.plistlib
|
||||
:inherited-members:
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
@ -1,9 +1,10 @@
|
||||
######################################################################
|
||||
pointPen: A pen for accessing points in a glyph contour *[deprecated]*
|
||||
######################################################################
|
||||
|
||||
########
|
||||
pointPen
|
||||
########
|
||||
|
||||
.. automodule:: fontTools.ufoLib.pointPen
|
||||
:inherited-members:
|
||||
:members:
|
||||
:undoc-members:
|
||||
.. important::
|
||||
|
||||
.. automodule:: fontTools.ufoLib.pointPen
|
||||
:inherited-members:
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
#####
|
||||
utils
|
||||
#####
|
||||
#####################################
|
||||
utils: Miscellaneous helper functions
|
||||
#####################################
|
||||
|
||||
.. automodule:: fontTools.ufoLib.utils
|
||||
:inherited-members:
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
##########
|
||||
validators
|
||||
##########
|
||||
#####################################
|
||||
validators: Data-validation functions
|
||||
#####################################
|
||||
|
||||
.. automodule:: fontTools.ufoLib.validators
|
||||
:inherited-members:
|
||||
|
@ -1,7 +1,6 @@
|
||||
##################################
|
||||
varLib: OpenType Variation Support
|
||||
##################################
|
||||
|
||||
#######################################
|
||||
varLib: Support for OpenType Variations
|
||||
#######################################
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
@ -1,6 +1,6 @@
|
||||
####################################
|
||||
voltLib: Read/write MS VOLT projects
|
||||
####################################
|
||||
########################################
|
||||
voltLib: Read and write MS VOLT projects
|
||||
########################################
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
@ -3,6 +3,6 @@ from fontTools.misc.loggingTools import configLogger
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
version = __version__ = "4.54.1.dev0"
|
||||
version = __version__ = "4.54.2.dev0"
|
||||
|
||||
__all__ = ["version", "log", "configLogger"]
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""cffLib: read/write Adobe CFF fonts
|
||||
|
||||
OpenType fonts with PostScript outlines contain a completely independent
|
||||
font file, Adobe's *Compact Font Format*. So dealing with OpenType fonts
|
||||
OpenType fonts with PostScript outlines embed a completely independent
|
||||
font file in Adobe's *Compact Font Format*. So dealing with OpenType fonts
|
||||
requires also dealing with CFF. This module allows you to read and write
|
||||
fonts written in the CFF format.
|
||||
|
||||
|
@ -1,35 +1,35 @@
|
||||
"""
|
||||
A library for importing .ufo files and their descendants.
|
||||
Refer to http://unifiedfontobject.com for the UFO specification.
|
||||
Refer to http://unifiedfontobject.org for the UFO specification.
|
||||
|
||||
The UFOReader and UFOWriter classes support versions 1, 2 and 3
|
||||
of the specification.
|
||||
The main interfaces are the :class:`.UFOReader` and :class:`.UFOWriter`
|
||||
classes, which support versions 1, 2, and 3 of the UFO specification.
|
||||
|
||||
Sets that list the font info attribute names for the fontinfo.plist
|
||||
formats are available for external use. These are:
|
||||
Set variables are available for external use that list the font
|
||||
info attribute names for the `fontinfo.plist` formats. These are:
|
||||
|
||||
- fontInfoAttributesVersion1
|
||||
- fontInfoAttributesVersion2
|
||||
- fontInfoAttributesVersion3
|
||||
- :obj:`.fontInfoAttributesVersion1`
|
||||
- :obj:`.fontInfoAttributesVersion2`
|
||||
- :obj:`.fontInfoAttributesVersion3`
|
||||
|
||||
A set listing the fontinfo.plist attributes that were deprecated
|
||||
A set listing the `fontinfo.plist` attributes that were deprecated
|
||||
in version 2 is available for external use:
|
||||
|
||||
- deprecatedFontInfoAttributesVersion2
|
||||
- :obj:`.deprecatedFontInfoAttributesVersion2`
|
||||
|
||||
Functions that do basic validation on values for fontinfo.plist
|
||||
Functions that do basic validation on values for `fontinfo.plist`
|
||||
are available for external use. These are
|
||||
|
||||
- validateFontInfoVersion2ValueForAttribute
|
||||
- validateFontInfoVersion3ValueForAttribute
|
||||
- :func:`.validateFontInfoVersion2ValueForAttribute`
|
||||
- :func:`.validateFontInfoVersion3ValueForAttribute`
|
||||
|
||||
Value conversion functions are available for converting
|
||||
fontinfo.plist values between the possible format versions.
|
||||
`fontinfo.plist` values between the possible format versions.
|
||||
|
||||
- convertFontInfoValueForAttributeFromVersion1ToVersion2
|
||||
- convertFontInfoValueForAttributeFromVersion2ToVersion1
|
||||
- convertFontInfoValueForAttributeFromVersion2ToVersion3
|
||||
- convertFontInfoValueForAttributeFromVersion3ToVersion2
|
||||
- :func:`.convertFontInfoValueForAttributeFromVersion1ToVersion2`
|
||||
- :func:`.convertFontInfoValueForAttributeFromVersion2ToVersion1`
|
||||
- :func:`.convertFontInfoValueForAttributeFromVersion2ToVersion3`
|
||||
- :func:`.convertFontInfoValueForAttributeFromVersion3ToVersion2`
|
||||
"""
|
||||
|
||||
import os
|
||||
@ -201,8 +201,12 @@ class _UFOBaseIO:
|
||||
|
||||
|
||||
class UFOReader(_UFOBaseIO):
|
||||
"""
|
||||
Read the various components of the .ufo.
|
||||
"""Read the various components of a .ufo.
|
||||
|
||||
Attributes:
|
||||
path: An `os.PathLike` object pointing to the .ufo.
|
||||
validate: A boolean indicating if the data read should be
|
||||
validated. Defaults to `True`.
|
||||
|
||||
By default read data is validated. Set ``validate`` to
|
||||
``False`` to not validate the data.
|
||||
@ -884,20 +888,27 @@ class UFOReader(_UFOBaseIO):
|
||||
|
||||
|
||||
class UFOWriter(UFOReader):
|
||||
"""
|
||||
Write the various components of the .ufo.
|
||||
"""Write the various components of a .ufo.
|
||||
|
||||
Attributes:
|
||||
path: An `os.PathLike` object pointing to the .ufo.
|
||||
formatVersion: the UFO format version as a tuple of integers (major, minor),
|
||||
or as a single integer for the major digit only (minor is implied to be 0).
|
||||
By default, the latest formatVersion will be used; currently it is 3.0,
|
||||
which is equivalent to formatVersion=(3, 0).
|
||||
fileCreator: The creator of the .ufo file. Defaults to
|
||||
`com.github.fonttools.ufoLib`.
|
||||
structure: The internal structure of the .ufo file: either `ZIP` or `PACKAGE`.
|
||||
validate: A boolean indicating if the data read should be validated. Defaults
|
||||
to `True`.
|
||||
|
||||
By default, the written data will be validated before writing. Set ``validate`` to
|
||||
``False`` if you do not want to validate the data. Validation can also be overriden
|
||||
on a per method level if desired.
|
||||
on a per-method level if desired.
|
||||
|
||||
The ``formatVersion`` argument allows to specify the UFO format version as a tuple
|
||||
of integers (major, minor), or as a single integer for the major digit only (minor
|
||||
is implied as 0). By default the latest formatVersion will be used; currently it's
|
||||
3.0, which is equivalent to formatVersion=(3, 0).
|
||||
|
||||
An UnsupportedUFOFormat exception is raised if the requested UFO formatVersion is
|
||||
not supported.
|
||||
Raises:
|
||||
UnsupportedUFOFormat: An exception indicating that the requested UFO
|
||||
formatVersion is not supported.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""DEPRECATED - This module is kept here only as a backward compatibility shim
|
||||
for the old ufoLib.plistlib module, which was moved to fontTools.misc.plistlib.
|
||||
for the old `ufoLib.plistlib` module, which was moved to :class:`fontTools.misc.plistlib`.
|
||||
Please use the latter instead.
|
||||
"""
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""DEPRECATED - This module is kept here only as a backward compatibility shim
|
||||
for the old ufoLib.pointPen module, which was moved to fontTools.pens.pointPen.
|
||||
for the old `ufoLib.pointPen` module, which was moved to :class:`fontTools.pens.pointPen`.
|
||||
Please use the latter instead.
|
||||
"""
|
||||
|
||||
|
@ -55,10 +55,10 @@ def test_contour_order(glyph0, glyph1):
|
||||
m1GreenReversed = [(-m[0],) + m[1:] for m in m1Green]
|
||||
(
|
||||
matching_control_reversed,
|
||||
matching_cost_control_reversed,
|
||||
identity_cost_control_reversed,
|
||||
) = matching_for_vectors(m0Control, m1ControlReversed)
|
||||
done = matching_cost_control_reversed == identity_cost_control_reversed
|
||||
matching_cost_green_reversed,
|
||||
identity_cost_green_reversed,
|
||||
) = matching_for_vectors(m0Green, m1GreenReversed)
|
||||
done = matching_cost_green_reversed == identity_cost_green_reversed
|
||||
|
||||
if not done:
|
||||
# Otherwise, use the worst of the two matchings.
|
||||
|
@ -50,7 +50,7 @@ class OnlineMultiVarStoreBuilder(object):
|
||||
self._cache = None
|
||||
self._data = None
|
||||
|
||||
def finish(self, optimize=True):
|
||||
def finish(self):
|
||||
self._regionList.RegionCount = len(self._regionList.Region)
|
||||
self._store.MultiVarDataCount = len(self._store.MultiVarData)
|
||||
return self._store
|
||||
|
6
NEWS.rst
6
NEWS.rst
@ -1,3 +1,9 @@
|
||||
4.54.1 (released 2024-09-24)
|
||||
----------------------------
|
||||
|
||||
- [unicodedata] Update to Unicode 16
|
||||
- [subset] Escape ``\\`` in doc string
|
||||
|
||||
4.54.0 (released 2024-09-23)
|
||||
----------------------------
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
[bumpversion]
|
||||
current_version = 4.54.1.dev0
|
||||
current_version = 4.54.2.dev0
|
||||
commit = True
|
||||
tag = False
|
||||
tag_name = {new_version}
|
||||
|
Loading…
x
Reference in New Issue
Block a user