move MAX_F2DOT14 constant to fixedTools

This commit is contained in:
Cosimo Lupo 2019-09-25 17:27:05 +01:00
parent d96c92f95e
commit 550711e106
No known key found for this signature in database
GPG Key ID: 20D4A261E4A0E642
2 changed files with 6 additions and 5 deletions

View File

@ -21,6 +21,11 @@ __all__ = [
] ]
# the max value that can still fit in an F2Dot14:
# 1.99993896484375
MAX_F2DOT14 = 0x7FFF / (1 << 14)
def otRound(value): def otRound(value):
"""Round float value to nearest integer towards +Infinity. """Round float value to nearest integer towards +Infinity.
For fractional values of 0.5 and higher, take the next higher integer; For fractional values of 0.5 and higher, take the next higher integer;

View File

@ -1,5 +1,6 @@
from fontTools.misc.py23 import * from fontTools.misc.py23 import *
from array import array from array import array
from fontTools.misc.fixedTools import MAX_F2DOT14
from fontTools.pens.basePen import LoggingPen from fontTools.pens.basePen import LoggingPen
from fontTools.pens.transformPen import TransformPen from fontTools.pens.transformPen import TransformPen
from fontTools.ttLib.tables import ttProgram from fontTools.ttLib.tables import ttProgram
@ -11,11 +12,6 @@ from fontTools.ttLib.tables._g_l_y_f import GlyphCoordinates
__all__ = ["TTGlyphPen"] __all__ = ["TTGlyphPen"]
# the max value that can still fit in an F2Dot14:
# 1.99993896484375
MAX_F2DOT14 = 0x7FFF / (1 << 14)
class TTGlyphPen(LoggingPen): class TTGlyphPen(LoggingPen):
"""Pen used for drawing to a TrueType glyph. """Pen used for drawing to a TrueType glyph.