Update to version 3.1.2

This commit is contained in:
Parag A Nemade 2016-10-10 10:56:42 +05:30
parent 974a1e1968
commit 141ae600b6
No known key found for this signature in database
GPG Key ID: 71932951EB71E972
4 changed files with 28 additions and 150 deletions

2
.gitignore vendored
View File

@ -4,3 +4,5 @@ fonttools-2.3.tar.gz
/fonttools-8388a2e37ce349dac6555bb824c82723e3b65fbf.tar.gz /fonttools-8388a2e37ce349dac6555bb824c82723e3b65fbf.tar.gz
/2.5.tar.gz /2.5.tar.gz
/fonttools-3.0.tar.gz /fonttools-3.0.tar.gz
/fonttools-3.1.2.tar.gz
/fonttools-3.1.2.zip

View File

@ -1,103 +0,0 @@
diff -urN fonttools-3.0/Lib/fontTools/ttLib/tables/E_B_L_C_.py fonttools-3.0.new/Lib/fontTools/ttLib/tables/E_B_L_C_.py
--- fonttools-3.0/Lib/fontTools/ttLib/tables/E_B_L_C_.py 2015-08-31 23:27:15.000000000 +0530
+++ fonttools-3.0.new/Lib/fontTools/ttLib/tables/E_B_L_C_.py 2016-03-06 14:03:58.406847533 +0530
@@ -71,44 +71,46 @@
# Save the original data because offsets are from the start of the table.
origData = data
+ i=0
- dummy, data = sstruct.unpack2(eblcHeaderFormat, data, self)
-
+ dummy = sstruct.unpack(eblcHeaderFormat, data[:8], self)
+ i += 8
self.strikes = []
for curStrikeIndex in range(self.numSizes):
curStrike = Strike()
self.strikes.append(curStrike)
curTable = curStrike.bitmapSizeTable
- dummy, data = sstruct.unpack2(bitmapSizeTableFormatPart1, data, curTable)
+ dummy = sstruct.unpack2(bitmapSizeTableFormatPart1, data[i:i+16], curTable)
+ i += 16
for metric in ('hori', 'vert'):
metricObj = SbitLineMetrics()
vars(curTable)[metric] = metricObj
- dummy, data = sstruct.unpack2(sbitLineMetricsFormat, data, metricObj)
- dummy, data = sstruct.unpack2(bitmapSizeTableFormatPart2, data, curTable)
+ dummy = sstruct.unpack2(sbitLineMetricsFormat, data[i:i+12], metricObj)
+ i += 12
+ dummy = sstruct.unpack(bitmapSizeTableFormatPart2, data[i:i+8], curTable)
+ i += 8
for curStrike in self.strikes:
curTable = curStrike.bitmapSizeTable
for subtableIndex in range(curTable.numberOfIndexSubTables):
- lowerBound = curTable.indexSubTableArrayOffset + subtableIndex * indexSubTableArraySize
- upperBound = lowerBound + indexSubTableArraySize
- data = origData[lowerBound:upperBound]
+ i = curTable.indexSubTableArrayOffset + subtableIndex * indexSubTableArraySize
- tup = struct.unpack(indexSubTableArrayFormat, data)
+ tup = struct.unpack(indexSubTableArrayFormat, data[i:i+indexSubTableArraySize])
(firstGlyphIndex, lastGlyphIndex, additionalOffsetToIndexSubtable) = tup
- offsetToIndexSubTable = curTable.indexSubTableArrayOffset + additionalOffsetToIndexSubtable
- data = origData[offsetToIndexSubTable:]
+ i = curTable.indexSubTableArrayOffset + additionalOffsetToIndexSubtable
- tup = struct.unpack(indexSubHeaderFormat, data[:indexSubHeaderSize])
+ tup = struct.unpack(indexSubHeaderFormat, data[i:i+indexSubHeaderSize])
(indexFormat, imageFormat, imageDataOffset) = tup
indexFormatClass = self.getIndexFormatClass(indexFormat)
- indexSubTable = indexFormatClass(data[indexSubHeaderSize:], ttFont)
+ indexSubTable = indexFormatClass(data[i+indexSubHeaderSize:], ttFont)
indexSubTable.firstGlyphIndex = firstGlyphIndex
indexSubTable.lastGlyphIndex = lastGlyphIndex
indexSubTable.additionalOffsetToIndexSubtable = additionalOffsetToIndexSubtable
indexSubTable.indexFormat = indexFormat
indexSubTable.imageFormat = imageFormat
indexSubTable.imageDataOffset = imageDataOffset
+ indexSubTable.decompile() # https://github.com/behdad/fonttools/issues/317
curStrike.indexSubTables.append(indexSubTable)
def compile(self, ttFont):
@@ -336,7 +338,6 @@
if not hasattr(self, "data"):
raise AttributeError(attr)
self.decompile()
- del self.data, self.ttFont
return getattr(self, attr)
# This method just takes care of the indexSubHeader. Implementing subclasses
@@ -439,6 +440,7 @@
self.names = list(map(self.ttFont.getGlyphName, glyphIds))
self.removeSkipGlyphs()
+ del self.data, self.ttFont
def compile(self, ttFont):
# First make sure that all the data lines up properly. Formats 1 and 3
@@ -525,6 +527,7 @@
offsets = [self.imageSize * i + self.imageDataOffset for i in range(len(glyphIds)+1)]
self.locations = list(zip(offsets, offsets[1:]))
self.names = list(map(self.ttFont.getGlyphName, glyphIds))
+ del self.data, self.ttFont
def compile(self, ttFont):
glyphIds = list(map(ttFont.getGlyphID, self.names))
@@ -556,6 +559,7 @@
offsets = [offset + self.imageDataOffset for offset in offsets]
self.locations = list(zip(offsets, offsets[1:]))
self.names = list(map(self.ttFont.getGlyphName, glyphIds))
+ del self.data, self.ttFont
def compile(self, ttFont):
# First make sure that all the data lines up properly. Format 4
@@ -594,6 +598,7 @@
offsets = [self.imageSize * i + self.imageDataOffset for i in range(len(glyphIds)+1)]
self.locations = list(zip(offsets, offsets[1:]))
self.names = list(map(self.ttFont.getGlyphName, glyphIds))
+ del self.data, self.ttFont
def compile(self, ttFont):
self.imageDataOffset = min(zip(*self.locations)[0])

View File

@ -1,22 +1,25 @@
%global gittag0 3.0 %global pypi_name fonttools
%global desc \
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.
Name: fonttools Name: fonttools
Version: 3.0 Version: 3.1.2
Release: 5%{?dist} Release: 1%{?dist}
Summary: A tool to convert True/OpenType fonts to XML and back Summary: Tools to manipulate font files
License: BSD License: BSD
URL: https://github.com/behdad/%{name}/ URL: https://github.com/fonttools/%{name}/
Source0: https://github.com/behdad/%{name}/archive/%{gittag0}.tar.gz#/%{name}-%{version}.tar.gz Source0: https://files.pythonhosted.org/packages/source/f/%{pypi_name}/%{pypi_name}-%{version}.zip
Patch0: 0001-EBLC-Decompile-and-release-copies-of-data-early.patch
Requires: python3-fonttools Requires: python3-fonttools
BuildArch: noarch BuildArch: noarch
Provides: ttx = %{version}-%{release} Provides: ttx = %{version}-%{release}
%description %description
TTX/FontTools is a tool for manipulating TrueType and OpenType fonts. It is %{desc}
written in Python and has a BSD-style, open-source license. TTX can dump
TrueType and OpenType fonts to an XML-based text format and vice versa.
%package -n python2-fonttools %package -n python2-fonttools
Summary: Python 2 fonttools library Summary: Python 2 fonttools library
@ -27,10 +30,7 @@ BuildArch: noarch
Requires: numpy Requires: numpy
%description -n python2-fonttools %description -n python2-fonttools
TTX/FontTools is a tool for manipulating TrueType and OpenType fonts. It is %{desc}
written in Python and has a BSD-style, open-source license. TTX can dump
TrueType and OpenType fonts to an XML-based text format and vice versa.
%package -n python3-fonttools %package -n python3-fonttools
Summary: Python 3 fonttools library Summary: Python 3 fonttools library
@ -41,43 +41,19 @@ BuildArch: noarch
Requires: python3-numpy Requires: python3-numpy
%description -n python3-fonttools %description -n python3-fonttools
TTX/FontTools is a tool for manipulating TrueType and OpenType fonts. It is %{desc}
written in Python and has a BSD-style, open-source license. TTX can dump
TrueType and OpenType fonts to an XML-based text format and vice versa.
%prep %prep
%setup -qc %autosetup
%patch0 -p0
pushd %{name}-%{version}
mv LICENSE.txt Doc/documentation.html Doc/changes.txt ../
popd
pwd
mv %{name}-%{version} python2
pushd python2
rm -rf *.egg-info rm -rf *.egg-info
popd
cp -a python2 python3
find python2 -name '*.py' | xargs sed -i 's|^#!python|#!%{__python2}|'
find python3 -name '*.py' | xargs sed -i 's|^#!python|#!%{__python3}|'
%build %build
pushd python2 %py2_build
%{__python2} setup.py build %py3_build
popd
pushd python3
%{__python3} setup.py build
popd
%install %install
pushd python2
%{__python2} setup.py install --skip-build --root %{buildroot} %{__python2} setup.py install --skip-build --root %{buildroot}
popd
pushd python3
%{__python3} setup.py install --skip-build --root %{buildroot} %{__python3} setup.py install --skip-build --root %{buildroot}
popd
%files %files
%{_bindir}/pyftinspect %{_bindir}/pyftinspect
@ -87,18 +63,21 @@ popd
%{_mandir}/man1/ttx.1.gz %{_mandir}/man1/ttx.1.gz
%files -n python2-fonttools %files -n python2-fonttools
%license LICENSE.txt %license LICENSE
%doc changes.txt documentation.html %doc NEWS README.md
%{python2_sitelib}/FontTools.pth %{python2_sitelib}/FontTools.pth
%{python2_sitelib}/FontTools %{python2_sitelib}/FontTools
%files -n python3-fonttools %files -n python3-fonttools
%license LICENSE.txt %license LICENSE
%doc changes.txt documentation.html %doc NEWS README.md
%{python3_sitelib}/FontTools.pth %{python3_sitelib}/FontTools.pth
%{python3_sitelib}/FontTools %{python3_sitelib}/FontTools
%changelog %changelog
* Mon Oct 10 2016 Parag Nemade <pnemade AT redhat DOT com> - 3.1.2-1
- Update to version 3.1.2
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0-5 * Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0-5
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

View File

@ -1 +1 @@
e5de6f32a3db235a5adce4f456e8826b fonttools-3.0.tar.gz cee08ea7959b1deec9f3f1e08da06cb2 fonttools-3.1.2.zip