Merge pull request #1686 from madig/make-py3-only
Make code Python 3 only
This commit is contained in:
commit
e13fca3449
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import logging
|
import logging
|
||||||
from fontTools.misc.loggingTools import configLogger
|
from fontTools.misc.loggingTools import configLogger
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
# It does not implement the full spec (Adobe Technote 5004, Adobe Font Metrics
|
# It does not implement the full spec (Adobe Technote 5004, Adobe Font Metrics
|
||||||
# File Format Specification). Still, it should read most "common" AFM files.
|
# File Format Specification). Still, it should read most "common" AFM files.
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
# The table below is taken from
|
# The table below is taken from
|
||||||
# http://www.adobe.com/devnet/opentype/archives/aglfn.txt
|
# http://www.adobe.com/devnet/opentype/archives/aglfn.txt
|
||||||
|
|
||||||
from __future__ import (print_function, division, absolute_import,
|
|
||||||
unicode_literals)
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""cffLib.py -- read/write tools for Adobe CFF fonts."""
|
"""cffLib.py -- read/write tools for Adobe CFF fonts."""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from fontTools.misc import psCharStrings
|
from fontTools.misc import psCharStrings
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
"""T2CharString operator specializer and generalizer."""
|
"""T2CharString operator specializer and generalizer."""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.cffLib import maxStackLimit
|
from fontTools.cffLib import maxStackLimit
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
"""T2CharString glyph width optimizer."""
|
"""T2CharString glyph width optimizer."""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.ttLib import TTFont, getTableClass
|
from fontTools.ttLib import TTFont, getTableClass
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.loggingTools import LogMixin
|
from fontTools.misc.loggingTools import LogMixin
|
||||||
import collections
|
import collections
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
|
||||||
MacRoman = [
|
MacRoman = [
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
|
||||||
StandardEncoding = [
|
StandardEncoding = [
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
"""Empty __init__.py file to signal Python this directory is a package."""
|
"""Empty __init__.py file to signal Python this directory is a package."""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
"""Extend the Python codecs module with a few encodings that are used in OpenType (name table)
|
"""Extend the Python codecs module with a few encodings that are used in OpenType (name table)
|
||||||
but missing from Python. See https://github.com/fonttools/fonttools/issues/236 for details."""
|
but missing from Python. See https://github.com/fonttools/fonttools/issues/236 for details."""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import codecs
|
import codecs
|
||||||
import encodings
|
import encodings
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.ttLib import TTFont
|
from fontTools.ttLib import TTFont
|
||||||
from fontTools.feaLib.builder import addOpenTypeFeatures, Builder
|
from fontTools.feaLib.builder import addOpenTypeFeatures, Builder
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.feaLib.error import FeatureLibError
|
from fontTools.feaLib.error import FeatureLibError
|
||||||
from fontTools.misc.encodingTools import getEncoding
|
from fontTools.misc.encodingTools import getEncoding
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from fontTools.misc.textTools import binary2num, safeEval
|
from fontTools.misc.textTools import binary2num, safeEval
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
|
|
||||||
class FeatureLibError(Exception):
|
class FeatureLibError(Exception):
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.feaLib.error import FeatureLibError, IncludedFeaNotFound
|
from fontTools.feaLib.error import FeatureLibError, IncludedFeaNotFound
|
||||||
import re
|
import re
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
from fontTools.feaLib.error import FeatureLibError
|
from fontTools.feaLib.error import FeatureLibError
|
||||||
from fontTools.feaLib.lexer import Lexer, IncludingLexer, NonIncludingLexer
|
from fontTools.feaLib.lexer import Lexer, IncludingLexer, NonIncludingLexer
|
||||||
from fontTools.misc.encodingTools import getEncoding
|
from fontTools.misc.encodingTools import getEncoding
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
__all__ = ["FontBuilder"]
|
__all__ = ["FontBuilder"]
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
"""Font merger.
|
"""Font merger.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.timeTools import timestampNow
|
from fontTools.misc.timeTools import timestampNow
|
||||||
from fontTools import ttLib, cffLib
|
from fontTools import ttLib, cffLib
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
"""Empty __init__.py file to signal Python this directory is a package."""
|
"""Empty __init__.py file to signal Python this directory is a package."""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.fixedTools import otRound
|
from fontTools.misc.fixedTools import otRound
|
||||||
from numbers import Number
|
from numbers import Number
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"""fontTools.misc.bezierTools.py -- tools for working with bezier path segments.
|
"""fontTools.misc.bezierTools.py -- tools for working with bezier path segments.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.arrayTools import calcBounds
|
from fontTools.misc.arrayTools import calcBounds
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import math
|
import math
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
""" fontTools.misc.classifyTools.py -- tools for classifying things.
|
""" fontTools.misc.classifyTools.py -- tools for classifying things.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
|
||||||
class Classifier(object):
|
class Classifier(object):
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
"""Collection of utilities for command-line interfaces and console scripts."""
|
"""Collection of utilities for command-line interfaces and console scripts."""
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""Misc dict tools."""
|
"""Misc dict tools."""
|
||||||
|
|
||||||
from __future__ import print_function, absolute_import, division
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
|
||||||
__all__ = ['hashdict']
|
__all__ = ['hashdict']
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
charstring encryption algorithm as used by PostScript Type 1 fonts.
|
charstring encryption algorithm as used by PostScript Type 1 fonts.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
|
||||||
def _decryptChar(cipher, R):
|
def _decryptChar(cipher, R):
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
"""fontTools.misc.encodingTools.py -- tools for working with OpenType encodings.
|
"""fontTools.misc.encodingTools.py -- tools for working with OpenType encodings.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import fontTools.encodings.codecs
|
import fontTools.encodings.codecs
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ or subclasses built-in ElementTree classes to add features that are
|
|||||||
only availble in lxml, like OrderedDict for attributes, pretty_print and
|
only availble in lxml, like OrderedDict for attributes, pretty_print and
|
||||||
iterwalk.
|
iterwalk.
|
||||||
"""
|
"""
|
||||||
from __future__ import absolute_import, unicode_literals
|
|
||||||
from fontTools.misc.py23 import basestring, unicode, tounicode, open
|
from fontTools.misc.py23 import basestring, unicode, tounicode, open
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ Copyright (c) 2005-2016, The RoboFab Developers:
|
|||||||
Tal Leming
|
Tal Leming
|
||||||
Just van Rossum
|
Just van Rossum
|
||||||
"""
|
"""
|
||||||
from __future__ import unicode_literals
|
|
||||||
from fontTools.misc.py23 import basestring, unicode
|
from fontTools.misc.py23 import basestring, unicode
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
"""fontTools.misc.fixedTools.py -- tools for working with fixed numbers.
|
"""fontTools.misc.fixedTools.py -- tools for working with fixed numbers.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import math
|
import math
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""Misc integer tools."""
|
"""Misc integer tools."""
|
||||||
|
|
||||||
from __future__ import print_function, absolute_import, division
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
|
||||||
__all__ = ['popCount']
|
__all__ = ['popCount']
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
logging package.
|
logging package.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
""" Tools for reading Mac resource forks. """
|
""" Tools for reading Mac resource forks. """
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import struct
|
import struct
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
CFF dictionary data and Type1/Type2 CharStrings.
|
CFF dictionary data and Type1/Type2 CharStrings.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.fixedTools import fixedToFloat, otRound
|
from fontTools.misc.fixedTools import fixedToFloat, otRound
|
||||||
from fontTools.pens.boundsPen import BoundsPen
|
from fontTools.pens.boundsPen import BoundsPen
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import eexec
|
from fontTools.misc import eexec
|
||||||
from .psOperators import *
|
from .psOperators import *
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
|
||||||
_accessstrings = {0: "", 1: "readonly", 2: "executeonly", 3: "noaccess"}
|
_accessstrings = {0: "", 1: "readonly", 2: "executeonly", 3: "noaccess"}
|
||||||
|
@ -1,525 +1,148 @@
|
|||||||
"""Python 2/3 compat layer."""
|
"""Python 2/3 compat layer leftovers."""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
import decimal as _decimal
|
||||||
import sys
|
import math as _math
|
||||||
|
import warnings
|
||||||
|
from contextlib import redirect_stderr, redirect_stdout
|
||||||
|
from io import BytesIO
|
||||||
|
from io import StringIO as UnicodeIO
|
||||||
|
from types import SimpleNamespace
|
||||||
|
|
||||||
|
warnings.warn(
|
||||||
|
"The py23 module has been deprecated and will be removed in the next release. "
|
||||||
|
"Please update your code.",
|
||||||
|
DeprecationWarning,
|
||||||
|
)
|
||||||
|
|
||||||
__all__ = ['basestring', 'unicode', 'unichr', 'byteord', 'bytechr', 'BytesIO',
|
__all__ = [
|
||||||
'StringIO', 'UnicodeIO', 'strjoin', 'bytesjoin', 'tobytes', 'tostr',
|
"basestring",
|
||||||
'tounicode', 'Tag', 'open', 'range', 'xrange', 'round', 'Py23Error',
|
"bytechr",
|
||||||
'SimpleNamespace', 'zip', 'RecursionError']
|
"byteord",
|
||||||
|
"BytesIO",
|
||||||
|
"bytesjoin",
|
||||||
|
"open",
|
||||||
|
"Py23Error",
|
||||||
|
"range",
|
||||||
|
"RecursionError",
|
||||||
|
"round",
|
||||||
|
"SimpleNamespace",
|
||||||
|
"StringIO",
|
||||||
|
"strjoin",
|
||||||
|
"Tag",
|
||||||
|
"tobytes",
|
||||||
|
"tostr",
|
||||||
|
"tounicode",
|
||||||
|
"unichr",
|
||||||
|
"unicode",
|
||||||
|
"UnicodeIO",
|
||||||
|
"xrange",
|
||||||
|
"zip",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class Py23Error(NotImplementedError):
|
class Py23Error(NotImplementedError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
PY3 = sys.version_info[0] == 3
|
RecursionError = RecursionError
|
||||||
PY2 = sys.version_info[0] == 2
|
StringIO = UnicodeIO
|
||||||
|
|
||||||
|
basestring = str
|
||||||
|
isclose = _math.isclose
|
||||||
|
isfinite = _math.isfinite
|
||||||
|
open = open
|
||||||
|
range = range
|
||||||
|
round = round3 = round
|
||||||
|
unichr = chr
|
||||||
|
unicode = str
|
||||||
|
zip = zip
|
||||||
|
|
||||||
|
|
||||||
try:
|
def bytechr(n):
|
||||||
basestring = basestring
|
return bytes([n])
|
||||||
except NameError:
|
|
||||||
basestring = str
|
|
||||||
|
|
||||||
try:
|
|
||||||
unicode = unicode
|
|
||||||
except NameError:
|
|
||||||
unicode = str
|
|
||||||
|
|
||||||
try:
|
|
||||||
unichr = unichr
|
|
||||||
|
|
||||||
if sys.maxunicode < 0x10FFFF:
|
|
||||||
# workarounds for Python 2 "narrow" builds with UCS2-only support.
|
|
||||||
|
|
||||||
_narrow_unichr = unichr
|
|
||||||
|
|
||||||
def unichr(i):
|
|
||||||
"""
|
|
||||||
Return the unicode character whose Unicode code is the integer 'i'.
|
|
||||||
The valid range is 0 to 0x10FFFF inclusive.
|
|
||||||
|
|
||||||
>>> _narrow_unichr(0xFFFF + 1)
|
|
||||||
Traceback (most recent call last):
|
|
||||||
File "<stdin>", line 1, in ?
|
|
||||||
ValueError: unichr() arg not in range(0x10000) (narrow Python build)
|
|
||||||
>>> unichr(0xFFFF + 1) == u'\U00010000'
|
|
||||||
True
|
|
||||||
>>> unichr(1114111) == u'\U0010FFFF'
|
|
||||||
True
|
|
||||||
>>> unichr(0x10FFFF + 1)
|
|
||||||
Traceback (most recent call last):
|
|
||||||
File "<stdin>", line 1, in ?
|
|
||||||
ValueError: unichr() arg not in range(0x110000)
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
return _narrow_unichr(i)
|
|
||||||
except ValueError:
|
|
||||||
try:
|
|
||||||
padded_hex_str = hex(i)[2:].zfill(8)
|
|
||||||
escape_str = "\\U" + padded_hex_str
|
|
||||||
return escape_str.decode("unicode-escape")
|
|
||||||
except UnicodeDecodeError:
|
|
||||||
raise ValueError('unichr() arg not in range(0x110000)')
|
|
||||||
|
|
||||||
import re
|
|
||||||
_unicode_escape_RE = re.compile(r'\\U[A-Fa-f0-9]{8}')
|
|
||||||
|
|
||||||
def byteord(c):
|
|
||||||
"""
|
|
||||||
Given a 8-bit or unicode character, return an integer representing the
|
|
||||||
Unicode code point of the character. If a unicode argument is given, the
|
|
||||||
character's code point must be in the range 0 to 0x10FFFF inclusive.
|
|
||||||
|
|
||||||
>>> ord(u'\U00010000')
|
|
||||||
Traceback (most recent call last):
|
|
||||||
File "<stdin>", line 1, in ?
|
|
||||||
TypeError: ord() expected a character, but string of length 2 found
|
|
||||||
>>> byteord(u'\U00010000') == 0xFFFF + 1
|
|
||||||
True
|
|
||||||
>>> byteord(u'\U0010FFFF') == 1114111
|
|
||||||
True
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
return ord(c)
|
|
||||||
except TypeError as e:
|
|
||||||
try:
|
|
||||||
escape_str = c.encode('unicode-escape')
|
|
||||||
if not _unicode_escape_RE.match(escape_str):
|
|
||||||
raise
|
|
||||||
hex_str = escape_str[3:]
|
|
||||||
return int(hex_str, 16)
|
|
||||||
except:
|
|
||||||
raise TypeError(e)
|
|
||||||
|
|
||||||
else:
|
|
||||||
byteord = ord
|
|
||||||
bytechr = chr
|
|
||||||
|
|
||||||
except NameError:
|
|
||||||
unichr = chr
|
|
||||||
def bytechr(n):
|
|
||||||
return bytes([n])
|
|
||||||
def byteord(c):
|
|
||||||
return c if isinstance(c, int) else ord(c)
|
|
||||||
|
|
||||||
|
|
||||||
# the 'io' module provides the same I/O interface on both 2 and 3.
|
def byteord(c):
|
||||||
# here we define an alias of io.StringIO to disambiguate it eternally...
|
return c if isinstance(c, int) else ord(c)
|
||||||
from io import BytesIO
|
|
||||||
from io import StringIO as UnicodeIO
|
|
||||||
try:
|
|
||||||
# in python 2, by 'StringIO' we still mean a stream of *byte* strings
|
|
||||||
from StringIO import StringIO
|
|
||||||
except ImportError:
|
|
||||||
# in Python 3, we mean instead a stream of *unicode* strings
|
|
||||||
StringIO = UnicodeIO
|
|
||||||
|
|
||||||
|
|
||||||
def strjoin(iterable, joiner=''):
|
def strjoin(iterable, joiner=""):
|
||||||
return tostr(joiner).join(iterable)
|
return tostr(joiner).join(iterable)
|
||||||
|
|
||||||
def tobytes(s, encoding='ascii', errors='strict'):
|
|
||||||
if not isinstance(s, bytes):
|
|
||||||
return s.encode(encoding, errors)
|
|
||||||
else:
|
|
||||||
return s
|
|
||||||
def tounicode(s, encoding='ascii', errors='strict'):
|
|
||||||
if not isinstance(s, unicode):
|
|
||||||
return s.decode(encoding, errors)
|
|
||||||
else:
|
|
||||||
return s
|
|
||||||
|
|
||||||
if str == bytes:
|
|
||||||
class Tag(str):
|
|
||||||
def tobytes(self):
|
|
||||||
if isinstance(self, bytes):
|
|
||||||
return self
|
|
||||||
else:
|
|
||||||
return self.encode('latin1')
|
|
||||||
|
|
||||||
tostr = tobytes
|
|
||||||
|
|
||||||
bytesjoin = strjoin
|
|
||||||
else:
|
|
||||||
class Tag(str):
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def transcode(blob):
|
|
||||||
if isinstance(blob, bytes):
|
|
||||||
blob = blob.decode('latin-1')
|
|
||||||
return blob
|
|
||||||
|
|
||||||
def __new__(self, content):
|
|
||||||
return str.__new__(self, self.transcode(content))
|
|
||||||
def __ne__(self, other):
|
|
||||||
return not self.__eq__(other)
|
|
||||||
def __eq__(self, other):
|
|
||||||
return str.__eq__(self, self.transcode(other))
|
|
||||||
|
|
||||||
def __hash__(self):
|
|
||||||
return str.__hash__(self)
|
|
||||||
|
|
||||||
def tobytes(self):
|
|
||||||
return self.encode('latin-1')
|
|
||||||
|
|
||||||
tostr = tounicode
|
|
||||||
|
|
||||||
def bytesjoin(iterable, joiner=b''):
|
|
||||||
return tobytes(joiner).join(tobytes(item) for item in iterable)
|
|
||||||
|
|
||||||
|
|
||||||
import os
|
def tobytes(s, encoding="ascii", errors="strict"):
|
||||||
import io as _io
|
if not isinstance(s, bytes):
|
||||||
|
return s.encode(encoding, errors)
|
||||||
try:
|
else:
|
||||||
from msvcrt import setmode as _setmode
|
return s
|
||||||
except ImportError:
|
|
||||||
_setmode = None # only available on the Windows platform
|
|
||||||
|
|
||||||
|
|
||||||
def open(file, mode='r', buffering=-1, encoding=None, errors=None,
|
def tounicode(s, encoding="ascii", errors="strict"):
|
||||||
newline=None, closefd=True, opener=None):
|
if not isinstance(s, unicode):
|
||||||
""" Wrapper around `io.open` that bridges the differences between Python 2
|
return s.decode(encoding, errors)
|
||||||
and Python 3's built-in `open` functions. In Python 2, `io.open` is a
|
else:
|
||||||
backport of Python 3's `open`, whereas in Python 3, it is an alias of the
|
return s
|
||||||
built-in `open` function.
|
|
||||||
|
|
||||||
One difference is that the 'opener' keyword argument is only supported in
|
|
||||||
Python 3. Here we pass the value of 'opener' only when it is not None.
|
|
||||||
This causes Python 2 to raise TypeError, complaining about the number of
|
|
||||||
expected arguments, so it must be avoided in py2 or py2-3 contexts.
|
|
||||||
|
|
||||||
Another difference between 2 and 3, this time on Windows, has to do with
|
|
||||||
opening files by name or by file descriptor.
|
|
||||||
|
|
||||||
On the Windows C runtime, the 'O_BINARY' flag is defined which disables
|
|
||||||
the newlines translation ('\r\n' <=> '\n') when reading/writing files.
|
|
||||||
On both Python 2 and 3 this flag is always set when opening files by name.
|
|
||||||
This way, the newlines translation at the MSVCRT level doesn't interfere
|
|
||||||
with the Python io module's own newlines translation.
|
|
||||||
|
|
||||||
However, when opening files via fd, on Python 2 the fd is simply copied,
|
|
||||||
regardless of whether it has the 'O_BINARY' flag set or not.
|
|
||||||
This becomes a problem in the case of stdout, stdin, and stderr, because on
|
|
||||||
Windows these are opened in text mode by default (ie. don't have the
|
|
||||||
O_BINARY flag set).
|
|
||||||
|
|
||||||
On Python 3, this issue has been fixed, and all fds are now opened in
|
|
||||||
binary mode on Windows, including standard streams. Similarly here, I use
|
|
||||||
the `_setmode` function to ensure that integer file descriptors are
|
|
||||||
O_BINARY'ed before I pass them on to io.open.
|
|
||||||
|
|
||||||
For more info, see: https://bugs.python.org/issue10841
|
|
||||||
"""
|
|
||||||
if isinstance(file, int):
|
|
||||||
# the 'file' argument is an integer file descriptor
|
|
||||||
fd = file
|
|
||||||
if fd < 0:
|
|
||||||
raise ValueError('negative file descriptor')
|
|
||||||
if _setmode:
|
|
||||||
# `_setmode` function sets the line-end translation and returns the
|
|
||||||
# value of the previous mode. AFAIK there's no `_getmode`, so to
|
|
||||||
# check if the previous mode already had the bit set, I fist need
|
|
||||||
# to duplicate the file descriptor, set the binary flag on the copy
|
|
||||||
# and check the returned value.
|
|
||||||
fdcopy = os.dup(fd)
|
|
||||||
current_mode = _setmode(fdcopy, os.O_BINARY)
|
|
||||||
if not (current_mode & os.O_BINARY):
|
|
||||||
# the binary mode was not set: use the file descriptor's copy
|
|
||||||
file = fdcopy
|
|
||||||
if closefd:
|
|
||||||
# close the original file descriptor
|
|
||||||
os.close(fd)
|
|
||||||
else:
|
|
||||||
# ensure the copy is closed when the file object is closed
|
|
||||||
closefd = True
|
|
||||||
else:
|
|
||||||
# original file descriptor already had binary flag, close copy
|
|
||||||
os.close(fdcopy)
|
|
||||||
|
|
||||||
if opener is not None:
|
|
||||||
# "opener" is not supported on Python 2, use it at your own risk!
|
|
||||||
return _io.open(
|
|
||||||
file, mode, buffering, encoding, errors, newline, closefd,
|
|
||||||
opener=opener)
|
|
||||||
else:
|
|
||||||
return _io.open(
|
|
||||||
file, mode, buffering, encoding, errors, newline, closefd)
|
|
||||||
|
|
||||||
|
|
||||||
# always use iterator for 'range' and 'zip' on both py 2 and 3
|
tostr = tounicode
|
||||||
try:
|
|
||||||
range = xrange
|
|
||||||
except NameError:
|
class Tag(str):
|
||||||
range = range
|
@staticmethod
|
||||||
|
def transcode(blob):
|
||||||
|
if isinstance(blob, bytes):
|
||||||
|
blob = blob.decode("latin-1")
|
||||||
|
return blob
|
||||||
|
|
||||||
|
def __new__(self, content):
|
||||||
|
return str.__new__(self, self.transcode(content))
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
return not self.__eq__(other)
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
return str.__eq__(self, self.transcode(other))
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
return str.__hash__(self)
|
||||||
|
|
||||||
|
def tobytes(self):
|
||||||
|
return self.encode("latin-1")
|
||||||
|
|
||||||
|
|
||||||
|
def bytesjoin(iterable, joiner=b""):
|
||||||
|
return tobytes(joiner).join(tobytes(item) for item in iterable)
|
||||||
|
|
||||||
|
|
||||||
def xrange(*args, **kwargs):
|
def xrange(*args, **kwargs):
|
||||||
raise Py23Error("'xrange' is not defined. Use 'range' instead.")
|
raise Py23Error("'xrange' is not defined. Use 'range' instead.")
|
||||||
|
|
||||||
try:
|
|
||||||
from itertools import izip as zip
|
|
||||||
except ImportError:
|
|
||||||
zip = zip
|
|
||||||
|
|
||||||
|
|
||||||
import math as _math
|
def round2(number, ndigits=None):
|
||||||
|
"""
|
||||||
|
Implementation of Python 2 built-in round() function.
|
||||||
|
Rounds a number to a given precision in decimal digits (default
|
||||||
|
0 digits). The result is a floating point number. Values are rounded
|
||||||
|
to the closest multiple of 10 to the power minus ndigits; if two
|
||||||
|
multiples are equally close, rounding is done away from 0.
|
||||||
|
ndigits may be negative.
|
||||||
|
See Python 2 documentation:
|
||||||
|
https://docs.python.org/2/library/functions.html?highlight=round#round
|
||||||
|
"""
|
||||||
|
if ndigits is None:
|
||||||
|
ndigits = 0
|
||||||
|
|
||||||
try:
|
if ndigits < 0:
|
||||||
isclose = _math.isclose
|
exponent = 10 ** (-ndigits)
|
||||||
except AttributeError:
|
quotient, remainder = divmod(number, exponent)
|
||||||
# math.isclose() was only added in Python 3.5
|
if remainder >= exponent // 2 and number >= 0:
|
||||||
|
quotient += 1
|
||||||
|
return float(quotient * exponent)
|
||||||
|
else:
|
||||||
|
exponent = _decimal.Decimal("10") ** (-ndigits)
|
||||||
|
|
||||||
_isinf = _math.isinf
|
d = _decimal.Decimal.from_float(number).quantize(
|
||||||
_fabs = _math.fabs
|
exponent, rounding=_decimal.ROUND_HALF_UP
|
||||||
|
)
|
||||||
|
|
||||||
def isclose(a, b, rel_tol=1e-09, abs_tol=0):
|
return float(d)
|
||||||
"""
|
|
||||||
Python 2 implementation of Python 3.5 math.isclose()
|
|
||||||
https://hg.python.org/cpython/file/v3.5.2/Modules/mathmodule.c#l1993
|
|
||||||
"""
|
|
||||||
# sanity check on the inputs
|
|
||||||
if rel_tol < 0 or abs_tol < 0:
|
|
||||||
raise ValueError("tolerances must be non-negative")
|
|
||||||
# short circuit exact equality -- needed to catch two infinities of
|
|
||||||
# the same sign. And perhaps speeds things up a bit sometimes.
|
|
||||||
if a == b:
|
|
||||||
return True
|
|
||||||
# This catches the case of two infinities of opposite sign, or
|
|
||||||
# one infinity and one finite number. Two infinities of opposite
|
|
||||||
# sign would otherwise have an infinite relative tolerance.
|
|
||||||
# Two infinities of the same sign are caught by the equality check
|
|
||||||
# above.
|
|
||||||
if _isinf(a) or _isinf(b):
|
|
||||||
return False
|
|
||||||
# Cast to float to allow decimal.Decimal arguments
|
|
||||||
if not isinstance(a, float):
|
|
||||||
a = float(a)
|
|
||||||
if not isinstance(b, float):
|
|
||||||
b = float(b)
|
|
||||||
# now do the regular computation
|
|
||||||
# this is essentially the "weak" test from the Boost library
|
|
||||||
diff = _fabs(b - a)
|
|
||||||
result = ((diff <= _fabs(rel_tol * a)) or
|
|
||||||
(diff <= _fabs(rel_tol * b)) or
|
|
||||||
(diff <= abs_tol))
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
_isfinite = _math.isfinite # Python >= 3.2
|
|
||||||
except AttributeError:
|
|
||||||
_isfinite = None
|
|
||||||
_isnan = _math.isnan
|
|
||||||
_isinf = _math.isinf
|
|
||||||
|
|
||||||
|
|
||||||
def isfinite(f):
|
|
||||||
"""
|
|
||||||
>>> isfinite(0.0)
|
|
||||||
True
|
|
||||||
>>> isfinite(-0.1)
|
|
||||||
True
|
|
||||||
>>> isfinite(1e10)
|
|
||||||
True
|
|
||||||
>>> isfinite(float("nan"))
|
|
||||||
False
|
|
||||||
>>> isfinite(float("+inf"))
|
|
||||||
False
|
|
||||||
>>> isfinite(float("-inf"))
|
|
||||||
False
|
|
||||||
"""
|
|
||||||
if _isfinite is not None:
|
|
||||||
return _isfinite(f)
|
|
||||||
else:
|
|
||||||
return not (_isnan(f) or _isinf(f))
|
|
||||||
|
|
||||||
|
|
||||||
import decimal as _decimal
|
|
||||||
|
|
||||||
if PY3:
|
|
||||||
def round2(number, ndigits=None):
|
|
||||||
"""
|
|
||||||
Implementation of Python 2 built-in round() function.
|
|
||||||
|
|
||||||
Rounds a number to a given precision in decimal digits (default
|
|
||||||
0 digits). The result is a floating point number. Values are rounded
|
|
||||||
to the closest multiple of 10 to the power minus ndigits; if two
|
|
||||||
multiples are equally close, rounding is done away from 0.
|
|
||||||
|
|
||||||
ndigits may be negative.
|
|
||||||
|
|
||||||
See Python 2 documentation:
|
|
||||||
https://docs.python.org/2/library/functions.html?highlight=round#round
|
|
||||||
"""
|
|
||||||
if ndigits is None:
|
|
||||||
ndigits = 0
|
|
||||||
|
|
||||||
if ndigits < 0:
|
|
||||||
exponent = 10 ** (-ndigits)
|
|
||||||
quotient, remainder = divmod(number, exponent)
|
|
||||||
if remainder >= exponent//2 and number >= 0:
|
|
||||||
quotient += 1
|
|
||||||
return float(quotient * exponent)
|
|
||||||
else:
|
|
||||||
exponent = _decimal.Decimal('10') ** (-ndigits)
|
|
||||||
|
|
||||||
d = _decimal.Decimal.from_float(number).quantize(
|
|
||||||
exponent, rounding=_decimal.ROUND_HALF_UP)
|
|
||||||
|
|
||||||
return float(d)
|
|
||||||
|
|
||||||
if sys.version_info[:2] >= (3, 6):
|
|
||||||
# in Python 3.6, 'round3' is an alias to the built-in 'round'
|
|
||||||
round = round3 = round
|
|
||||||
else:
|
|
||||||
# in Python3 < 3.6 we need work around the inconsistent behavior of
|
|
||||||
# built-in round(), whereby floats accept a second None argument,
|
|
||||||
# while integers raise TypeError. See https://bugs.python.org/issue27936
|
|
||||||
_round = round
|
|
||||||
|
|
||||||
def round3(number, ndigits=None):
|
|
||||||
return _round(number) if ndigits is None else _round(number, ndigits)
|
|
||||||
|
|
||||||
round = round3
|
|
||||||
|
|
||||||
else:
|
|
||||||
# in Python 2, 'round2' is an alias to the built-in 'round' and
|
|
||||||
# 'round' is shadowed by 'round3'
|
|
||||||
round2 = round
|
|
||||||
|
|
||||||
def round3(number, ndigits=None):
|
|
||||||
"""
|
|
||||||
Implementation of Python 3 built-in round() function.
|
|
||||||
|
|
||||||
Rounds a number to a given precision in decimal digits (default
|
|
||||||
0 digits). This returns an int when ndigits is omitted or is None,
|
|
||||||
otherwise the same type as the number.
|
|
||||||
|
|
||||||
Values are rounded to the closest multiple of 10 to the power minus
|
|
||||||
ndigits; if two multiples are equally close, rounding is done toward
|
|
||||||
the even choice (aka "Banker's Rounding"). For example, both round(0.5)
|
|
||||||
and round(-0.5) are 0, and round(1.5) is 2.
|
|
||||||
|
|
||||||
ndigits may be negative.
|
|
||||||
|
|
||||||
See Python 3 documentation:
|
|
||||||
https://docs.python.org/3/library/functions.html?highlight=round#round
|
|
||||||
|
|
||||||
Derived from python-future:
|
|
||||||
https://github.com/PythonCharmers/python-future/blob/master/src/future/builtins/newround.py
|
|
||||||
"""
|
|
||||||
if ndigits is None:
|
|
||||||
ndigits = 0
|
|
||||||
# return an int when called with one argument
|
|
||||||
totype = int
|
|
||||||
# shortcut if already an integer, or a float with no decimal digits
|
|
||||||
inumber = totype(number)
|
|
||||||
if inumber == number:
|
|
||||||
return inumber
|
|
||||||
else:
|
|
||||||
# return the same type as the number, when called with two arguments
|
|
||||||
totype = type(number)
|
|
||||||
|
|
||||||
m = number * (10 ** ndigits)
|
|
||||||
# if number is half-way between two multiples, and the mutliple that is
|
|
||||||
# closer to zero is even, we use the (slow) pure-Python implementation
|
|
||||||
if isclose(m % 1, .5) and int(m) % 2 == 0:
|
|
||||||
if ndigits < 0:
|
|
||||||
exponent = 10 ** (-ndigits)
|
|
||||||
quotient, remainder = divmod(number, exponent)
|
|
||||||
half = exponent//2
|
|
||||||
if remainder > half or (remainder == half and quotient % 2 != 0):
|
|
||||||
quotient += 1
|
|
||||||
d = quotient * exponent
|
|
||||||
else:
|
|
||||||
exponent = _decimal.Decimal('10') ** (-ndigits) if ndigits != 0 else 1
|
|
||||||
|
|
||||||
d = _decimal.Decimal.from_float(number).quantize(
|
|
||||||
exponent, rounding=_decimal.ROUND_HALF_EVEN)
|
|
||||||
else:
|
|
||||||
# else we use the built-in round() as it produces the same results
|
|
||||||
d = round2(number, ndigits)
|
|
||||||
|
|
||||||
return totype(d)
|
|
||||||
|
|
||||||
round = round3
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
from types import SimpleNamespace
|
|
||||||
except ImportError:
|
|
||||||
class SimpleNamespace(object):
|
|
||||||
"""
|
|
||||||
A backport of Python 3.3's ``types.SimpleNamespace``.
|
|
||||||
"""
|
|
||||||
def __init__(self, **kwargs):
|
|
||||||
self.__dict__.update(kwargs)
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
keys = sorted(self.__dict__)
|
|
||||||
items = ("{0}={1!r}".format(k, self.__dict__[k]) for k in keys)
|
|
||||||
return "{0}({1})".format(type(self).__name__, ", ".join(items))
|
|
||||||
|
|
||||||
def __eq__(self, other):
|
|
||||||
return self.__dict__ == other.__dict__
|
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info[:2] > (3, 4):
|
|
||||||
from contextlib import redirect_stdout, redirect_stderr
|
|
||||||
else:
|
|
||||||
# `redirect_stdout` was added with python3.4, while `redirect_stderr`
|
|
||||||
# with python3.5. For simplicity, I redefine both for any versions
|
|
||||||
# less than or equal to 3.4.
|
|
||||||
# The code below is copied from:
|
|
||||||
# https://github.com/python/cpython/blob/57161aa/Lib/contextlib.py
|
|
||||||
|
|
||||||
class _RedirectStream(object):
|
|
||||||
|
|
||||||
_stream = None
|
|
||||||
|
|
||||||
def __init__(self, new_target):
|
|
||||||
self._new_target = new_target
|
|
||||||
# We use a list of old targets to make this CM re-entrant
|
|
||||||
self._old_targets = []
|
|
||||||
|
|
||||||
def __enter__(self):
|
|
||||||
self._old_targets.append(getattr(sys, self._stream))
|
|
||||||
setattr(sys, self._stream, self._new_target)
|
|
||||||
return self._new_target
|
|
||||||
|
|
||||||
def __exit__(self, exctype, excinst, exctb):
|
|
||||||
setattr(sys, self._stream, self._old_targets.pop())
|
|
||||||
|
|
||||||
|
|
||||||
class redirect_stdout(_RedirectStream):
|
|
||||||
"""Context manager for temporarily redirecting stdout to another file.
|
|
||||||
# How to send help() to stderr
|
|
||||||
with redirect_stdout(sys.stderr):
|
|
||||||
help(dir)
|
|
||||||
# How to write help() to a file
|
|
||||||
with open('help.txt', 'w') as f:
|
|
||||||
with redirect_stdout(f):
|
|
||||||
help(pow)
|
|
||||||
"""
|
|
||||||
|
|
||||||
_stream = "stdout"
|
|
||||||
|
|
||||||
|
|
||||||
class redirect_stderr(_RedirectStream):
|
|
||||||
"""Context manager for temporarily redirecting stderr to another file."""
|
|
||||||
|
|
||||||
_stream = "stderr"
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
RecursionError = RecursionError
|
|
||||||
except NameError:
|
|
||||||
RecursionError = RuntimeError
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
import doctest, sys
|
|
||||||
sys.exit(doctest.testmod().failed)
|
|
||||||
|
@ -46,7 +46,6 @@ calcsize(fmt)
|
|||||||
it returns the size of the data in bytes.
|
it returns the size of the data in bytes.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.fixedTools import fixedToFloat as fi2fl, floatToFixed as fl2fi
|
from fontTools.misc.fixedTools import fixedToFloat as fi2fl, floatToFixed as fl2fi
|
||||||
import struct
|
import struct
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import BasePen
|
from fontTools.pens.basePen import BasePen
|
||||||
from functools import partial
|
from functools import partial
|
||||||
@ -113,8 +112,7 @@ MomentXYPen = partial(GreenPen, func=x*y)
|
|||||||
def printGreenPen(penName, funcs, file=sys.stdout):
|
def printGreenPen(penName, funcs, file=sys.stdout):
|
||||||
|
|
||||||
print(
|
print(
|
||||||
'''from __future__ import print_function, division, absolute_import
|
'''from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.py23 import *
|
|
||||||
from fontTools.pens.basePen import BasePen
|
from fontTools.pens.basePen import BasePen
|
||||||
|
|
||||||
class %s(BasePen):
|
class %s(BasePen):
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
"""Helpers for writing unit tests."""
|
"""Helpers for writing unit tests."""
|
||||||
|
|
||||||
from __future__ import (print_function, division, absolute_import,
|
|
||||||
unicode_literals)
|
|
||||||
try:
|
try:
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
except ImportError: # python < 3.3
|
except ImportError: # python < 3.3
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
"""fontTools.misc.textTools.py -- miscellaneous routines."""
|
"""fontTools.misc.textTools.py -- miscellaneous routines."""
|
||||||
|
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import ast
|
import ast
|
||||||
import string
|
import string
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
"""fontTools.misc.timeTools.py -- tools for working with OpenType timestamps.
|
"""fontTools.misc.timeTools.py -- tools for working with OpenType timestamps.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
@ -45,7 +45,6 @@ Examples:
|
|||||||
>>>
|
>>>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
|
||||||
__all__ = ["Transform", "Identity", "Offset", "Scale"]
|
__all__ = ["Transform", "Identity", "Offset", "Scale"]
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools import ttLib
|
from fontTools import ttLib
|
||||||
from fontTools.misc.textTools import safeEval
|
from fontTools.misc.textTools import safeEval
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""xmlWriter.py -- Simple XML authoring class"""
|
"""xmlWriter.py -- Simple XML authoring class"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
# http://monotype.github.io/OpenType_Table_Source/otl_source.html
|
# http://monotype.github.io/OpenType_Table_Source/otl_source.html
|
||||||
# https://github.com/Monotype/OpenType_Table_Source/
|
# https://github.com/Monotype/OpenType_Table_Source/
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools import ttLib
|
from fontTools import ttLib
|
||||||
from fontTools.ttLib.tables._c_m_a_p import cmap_classes
|
from fontTools.ttLib.tables._c_m_a_p import cmap_classes
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import sys
|
import sys
|
||||||
from fontTools.mtiLib import main
|
from fontTools.mtiLib import main
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from fontTools import ttLib
|
from fontTools import ttLib
|
||||||
from fontTools.ttLib.tables import otTables as ot
|
from fontTools.ttLib.tables import otTables as ot
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import, unicode_literals
|
|
||||||
|
|
||||||
__all__ = ['maxCtxFont']
|
__all__ = ['maxCtxFont']
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
"""Empty __init__.py file to signal Python this directory is a package."""
|
"""Empty __init__.py file to signal Python this directory is a package."""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""Calculate the area of a glyph."""
|
"""Calculate the area of a glyph."""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import BasePen
|
from fontTools.pens.basePen import BasePen
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@ Coordinates are usually expressed as (x, y) tuples, but generally any
|
|||||||
sequence of length 2 will do.
|
sequence of length 2 will do.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.loggingTools import LogMixin
|
from fontTools.misc.loggingTools import LogMixin
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.arrayTools import updateBounds, pointInRect, unionRect
|
from fontTools.misc.arrayTools import updateBounds, pointInRect, unionRect
|
||||||
from fontTools.misc.bezierTools import calcCubicBounds, calcQuadraticBounds
|
from fontTools.misc.bezierTools import calcCubicBounds, calcQuadraticBounds
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import BasePen
|
from fontTools.pens.basePen import BasePen
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import AbstractPen
|
from fontTools.pens.basePen import AbstractPen
|
||||||
from fontTools.pens.recordingPen import RecordingPen
|
from fontTools.pens.recordingPen import RecordingPen
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""Pen calculating 0th, 1st, and 2nd moments of area of glyph shapes.
|
"""Pen calculating 0th, 1st, and 2nd moments of area of glyph shapes.
|
||||||
This is low-level, autogenerated pen. Use statisticsPen instead."""
|
This is low-level, autogenerated pen. Use statisticsPen instead."""
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import BasePen
|
from fontTools.pens.basePen import BasePen
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""Calculate the perimeter of a glyph."""
|
"""Calculate the perimeter of a glyph."""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import BasePen
|
from fontTools.pens.basePen import BasePen
|
||||||
from fontTools.misc.bezierTools import approximateQuadraticArcLengthC, calcQuadraticArcLengthC, approximateCubicArcLengthC, calcCubicArcLengthC
|
from fontTools.misc.bezierTools import approximateQuadraticArcLengthC, calcQuadraticArcLengthC, approximateCubicArcLengthC, calcCubicArcLengthC
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
for shapes.
|
for shapes.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import BasePen
|
from fontTools.pens.basePen import BasePen
|
||||||
from fontTools.misc.bezierTools import solveQuadratic, solveCubic
|
from fontTools.misc.bezierTools import solveQuadratic, solveCubic
|
||||||
|
@ -11,7 +11,6 @@ steps through all the points in a call from glyph.drawPoints().
|
|||||||
This allows the caller to provide more data for each point.
|
This allows the caller to provide more data for each point.
|
||||||
For instance, whether or not a point is smooth, and its name.
|
For instance, whether or not a point is smooth, and its name.
|
||||||
"""
|
"""
|
||||||
from __future__ import absolute_import, unicode_literals
|
|
||||||
from fontTools.pens.basePen import AbstractPen
|
from fontTools.pens.basePen import AbstractPen
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import BasePen
|
from fontTools.pens.basePen import BasePen
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
"""Pen recording operations that can be accessed or replayed."""
|
"""Pen recording operations that can be accessed or replayed."""
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import AbstractPen, DecomposingPen
|
from fontTools.pens.basePen import AbstractPen, DecomposingPen
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import BasePen
|
from fontTools.pens.basePen import BasePen
|
||||||
from reportlab.graphics.shapes import Path
|
from reportlab.graphics.shapes import Path
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.arrayTools import pairwise
|
from fontTools.misc.arrayTools import pairwise
|
||||||
from fontTools.pens.filterPen import ContourFilterPen
|
from fontTools.pens.filterPen import ContourFilterPen
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""Pen calculating area, center of mass, variance and standard-deviation,
|
"""Pen calculating area, center of mass, variance and standard-deviation,
|
||||||
covariance and correlation, and slant, of glyph shapes."""
|
covariance and correlation, and slant, of glyph shapes."""
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import math
|
import math
|
||||||
from fontTools.pens.momentsPen import MomentsPen
|
from fontTools.pens.momentsPen import MomentsPen
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import BasePen
|
from fontTools.pens.basePen import BasePen
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# Copyright (c) 2009 Type Supply LLC
|
# Copyright (c) 2009 Type Supply LLC
|
||||||
# Author: Tal Leming
|
# Author: Tal Leming
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.fixedTools import otRound
|
from fontTools.misc.fixedTools import otRound
|
||||||
from fontTools.misc.psCharStrings import T2CharString
|
from fontTools.misc.psCharStrings import T2CharString
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
"""Pen multiplexing drawing to one or more pens."""
|
"""Pen multiplexing drawing to one or more pens."""
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import AbstractPen
|
from fontTools.pens.basePen import AbstractPen
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.filterPen import FilterPen
|
from fontTools.pens.filterPen import FilterPen
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from array import array
|
from array import array
|
||||||
from fontTools.pens.basePen import LoggingPen
|
from fontTools.pens.basePen import LoggingPen
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.pens.basePen import BasePen
|
from fontTools.pens.basePen import BasePen
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#
|
#
|
||||||
# Google Author(s): Behdad Esfahbod
|
# Google Author(s): Behdad Esfahbod
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.fixedTools import otRound
|
from fontTools.misc.fixedTools import otRound
|
||||||
from fontTools import ttLib
|
from fontTools import ttLib
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
import sys
|
import sys
|
||||||
from fontTools.subset import main
|
from fontTools.subset import main
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
|
||||||
from .path import SVGPath, parse_path
|
from .path import SVGPath, parse_path
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
from __future__ import (
|
|
||||||
print_function, division, absolute_import, unicode_literals)
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
|
||||||
from fontTools.pens.transformPen import TransformPen
|
from fontTools.pens.transformPen import TransformPen
|
||||||
|
@ -4,7 +4,6 @@ The code is mostly adapted from Blink's SVGPathNormalizer::DecomposeArcToCubic
|
|||||||
https://github.com/chromium/chromium/blob/93831f2/third_party/
|
https://github.com/chromium/chromium/blob/93831f2/third_party/
|
||||||
blink/renderer/core/svg/svg_path_parser.cc#L169-L278
|
blink/renderer/core/svg/svg_path_parser.cc#L169-L278
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function, division, absolute_import, unicode_literals
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.py23 import isfinite
|
from fontTools.misc.py23 import isfinite
|
||||||
from fontTools.misc.transform import Identity, Scale
|
from fontTools.misc.transform import Identity, Scale
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
# Copyright (c) 2013-2014 Lennart Regebro
|
# Copyright (c) 2013-2014 Lennart Regebro
|
||||||
# License: MIT
|
# License: MIT
|
||||||
|
|
||||||
from __future__ import (
|
|
||||||
print_function, division, absolute_import, unicode_literals)
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from .arc import EllipticalArc
|
from .arc import EllipticalArc
|
||||||
import re
|
import re
|
||||||
|
@ -15,7 +15,6 @@ write(path, data, kind='OTHER', dohex=False)
|
|||||||
part should be written as hexadecimal or binary, but only if kind
|
part should be written as hexadecimal or binary, but only if kind
|
||||||
is 'OTHER'.
|
is 'OTHER'.
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import eexec
|
from fontTools.misc import eexec
|
||||||
from fontTools.misc.macCreatorType import getMacCreatorAndType
|
from fontTools.misc.macCreatorType import getMacCreatorAndType
|
||||||
|
@ -41,7 +41,6 @@ Dumping 'prep' table...
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.loggingTools import deprecateFunction
|
from fontTools.misc.loggingTools import deprecateFunction
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
"""ttLib.macUtils.py -- Various Mac-specific stuff."""
|
"""ttLib.macUtils.py -- Various Mac-specific stuff."""
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.macRes import ResourceReader, ResourceError
|
from fontTools.misc.macRes import ResourceReader, ResourceError
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ classes, since whenever to number of tables changes or whenever
|
|||||||
a table's length chages you need to rewrite the whole file anyway.
|
a table's length chages you need to rewrite the whole file anyway.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from fontTools.ttLib import TTLibError
|
from fontTools.ttLib import TTLibError
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from .otBase import BaseTTXConverter
|
from .otBase import BaseTTXConverter
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
# Since bitmap glyph metrics are shared between EBLC and EBDT
|
# Since bitmap glyph metrics are shared between EBLC and EBDT
|
||||||
# this class gets its own python file.
|
# this class gets its own python file.
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from fontTools.misc.textTools import safeEval
|
from fontTools.misc.textTools import safeEval
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
# Google Author(s): Matt Fontaine
|
# Google Author(s): Matt Fontaine
|
||||||
|
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from . import E_B_D_T_
|
from . import E_B_D_T_
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#
|
#
|
||||||
# Google Author(s): Matt Fontaine
|
# Google Author(s): Matt Fontaine
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from . import E_B_L_C_
|
from . import E_B_L_C_
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools import cffLib
|
from fontTools import cffLib
|
||||||
from . import DefaultTable
|
from . import DefaultTable
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools import cffLib
|
from fontTools import cffLib
|
||||||
from fontTools.ttLib.tables.C_F_F_ import table_C_F_F_
|
from fontTools.ttLib.tables.C_F_F_ import table_C_F_F_
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#
|
#
|
||||||
# Google Author(s): Behdad Esfahbod
|
# Google Author(s): Behdad Esfahbod
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.textTools import safeEval
|
from fontTools.misc.textTools import safeEval
|
||||||
from . import DefaultTable
|
from . import DefaultTable
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#
|
#
|
||||||
# Google Author(s): Behdad Esfahbod
|
# Google Author(s): Behdad Esfahbod
|
||||||
|
|
||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.textTools import safeEval
|
from fontTools.misc.textTools import safeEval
|
||||||
from . import DefaultTable
|
from . import DefaultTable
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc.textTools import safeEval
|
from fontTools.misc.textTools import safeEval
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.ttLib import getClassTag
|
from fontTools.ttLib import getClassTag
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from fontTools.misc.textTools import safeEval, readHex, hexStr, deHexStr
|
from fontTools.misc.textTools import safeEval, readHex, hexStr, deHexStr
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from . import DefaultTable
|
from . import DefaultTable
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from fontTools.misc.textTools import safeEval
|
from fontTools.misc.textTools import safeEval
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from fontTools.misc.textTools import safeEval
|
from fontTools.misc.textTools import safeEval
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from .otBase import BaseTTXConverter
|
from .otBase import BaseTTXConverter
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from __future__ import print_function, division, absolute_import
|
|
||||||
from fontTools.misc.py23 import *
|
from fontTools.misc.py23 import *
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from fontTools.misc.textTools import safeEval
|
from fontTools.misc.textTools import safeEval
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user