better float testing, so numpy.floats also work.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@541 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
parent
3afe3817cb
commit
f6ff48be3c
@ -1,12 +1,12 @@
|
||||
"""cffLib.py -- read/write tools for Adobe CFF fonts."""
|
||||
|
||||
#
|
||||
# $Id: cffLib.py,v 1.32 2006-10-21 13:41:18 jvr Exp $
|
||||
# $Id: cffLib.py,v 1.33 2008-03-07 19:49:25 jvr Exp $
|
||||
#
|
||||
|
||||
import struct, sstruct
|
||||
import string
|
||||
from types import FloatType, ListType, StringType, TupleType
|
||||
from types import ListType, StringType, TupleType
|
||||
from fontTools.misc import psCharStrings
|
||||
from fontTools.misc.textTools import safeEval
|
||||
|
||||
@ -1369,7 +1369,7 @@ class DictCompiler:
|
||||
|
||||
|
||||
def encodeNumber(num):
|
||||
if type(num) == FloatType:
|
||||
if isinstance(num, float):
|
||||
return psCharStrings.encodeFloat(num)
|
||||
else:
|
||||
return psCharStrings.encodeIntCFF(num)
|
||||
|
Loading…
x
Reference in New Issue
Block a user