De-orphan

This commit is contained in:
Roozbeh Pournader 2006-11-08 19:17:12 +00:00
parent 40d4d46228
commit 7984f628bd
6 changed files with 418 additions and 1 deletions

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
# Makefile for source rpm: fonttools
# $Id: Makefile,v 1.3 2006/11/08 19:17:12 roozbeh Exp $
NAME := fonttools
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View File

@ -1 +0,0 @@
http://fedoraproject.org/wiki/Extras/Schedule/FC6MassRebuild

View File

@ -0,0 +1,279 @@
diff -urN fonttools-20050315/Lib/fontTools/fondLib.py fonttools-20050624/Lib/fontTools/fondLib.py
--- fonttools-20050315/Lib/fontTools/fondLib.py 2002-10-29 19:19:25.000000000 +0330
+++ fonttools-20050624/Lib/fontTools/fondLib.py 2005-06-24 14:05:16.000000000 +0430
@@ -12,6 +12,7 @@
DEBUG = 0
headerformat = """
+ >
ffFlags: h
ffFamID: h
ffFirstChar: h
@@ -127,9 +128,9 @@
def _getheader(self):
data = self.FOND.data
sstruct.unpack(headerformat, data[:28], self)
- self.ffProperty = struct.unpack("9h", data[28:46])
- self.ffIntl = struct.unpack("hh", data[46:50])
- self.ffVersion, = struct.unpack("h", data[50:FONDheadersize])
+ self.ffProperty = struct.unpack(">9h", data[28:46])
+ self.ffIntl = struct.unpack(">hh", data[46:50])
+ self.ffVersion, = struct.unpack(">h", data[50:FONDheadersize])
if DEBUG:
self._rawheader = data[:FONDheadersize]
@@ -137,9 +138,9 @@
def _buildheader(self):
header = sstruct.pack(headerformat, self)
- header = header + apply(struct.pack, ("9h",) + self.ffProperty)
- header = header + apply(struct.pack, ("hh",) + self.ffIntl)
- header = header + struct.pack("h", self.ffVersion)
+ header = header + apply(struct.pack, (">9h",) + self.ffProperty)
+ header = header + apply(struct.pack, (">hh",) + self.ffIntl)
+ header = header + struct.pack(">h", self.ffVersion)
if DEBUG:
print "header is the same?", self._rawheader == header and 'yes.' or 'no.'
if self._rawheader <> header:
@@ -149,12 +150,12 @@
def _getfontassociationtable(self):
data = self.FOND.data
offset = FONDheadersize
- numberofentries, = struct.unpack("h", data[offset:offset+2])
+ numberofentries, = struct.unpack(">h", data[offset:offset+2])
numberofentries = numberofentries + 1
size = numberofentries * 6
self.fontAssoc = []
for i in range(offset + 2, offset + size, 6):
- self.fontAssoc.append(struct.unpack("3h", data[i:i+6]))
+ self.fontAssoc.append(struct.unpack(">3h", data[i:i+6]))
self._endoffontassociationtable = offset + size + 2
if DEBUG:
@@ -162,9 +163,9 @@
self.parsedthings.append((offset, self._endoffontassociationtable, 'fontassociationtable'))
def _buildfontassociationtable(self):
- data = struct.pack("h", len(self.fontAssoc) - 1)
+ data = struct.pack(">h", len(self.fontAssoc) - 1)
for size, stype, ID in self.fontAssoc:
- data = data + struct.pack("3h", size, stype, ID)
+ data = data + struct.pack(">3h", size, stype, ID)
if DEBUG:
print "font association table is the same?", self._rawfontassociationtable == data and 'yes.' or 'no.'
@@ -194,10 +195,10 @@
return
boxes = {}
data = self._rawoffsettable[6:]
- numstyles = struct.unpack("h", data[:2])[0] + 1
+ numstyles = struct.unpack(">h", data[:2])[0] + 1
data = data[2:]
for i in range(numstyles):
- style, l, b, r, t = struct.unpack("hhhhh", data[:10])
+ style, l, b, r, t = struct.unpack(">hhhhh", data[:10])
boxes[style] = (l, b, r, t)
data = data[10:]
self.boundingBoxes = boxes
@@ -206,9 +207,9 @@
if self.boundingBoxes and self._rawoffsettable[:6] == '\0\0\0\0\0\6':
boxes = self.boundingBoxes.items()
boxes.sort()
- data = '\0\0\0\0\0\6' + struct.pack("h", len(boxes) - 1)
+ data = '\0\0\0\0\0\6' + struct.pack(">h", len(boxes) - 1)
for style, (l, b, r, t) in boxes:
- data = data + struct.pack("hhhhh", style, l, b, r, t)
+ data = data + struct.pack(">hhhhh", style, l, b, r, t)
self._rawoffsettable = data
def _getglyphwidthtable(self):
@@ -217,15 +218,15 @@
return
data = self.FOND.data
offset = self.ffWTabOff
- numberofentries, = struct.unpack("h", data[offset:offset+2])
+ numberofentries, = struct.unpack(">h", data[offset:offset+2])
numberofentries = numberofentries + 1
count = offset + 2
for i in range(numberofentries):
- stylecode, = struct.unpack("h", data[count:count+2])
+ stylecode, = struct.unpack(">h", data[count:count+2])
widthtable = self.widthTables[stylecode] = []
count = count + 2
for j in range(3 + self.ffLastChar - self.ffFirstChar):
- width, = struct.unpack("h", data[count:count+2])
+ width, = struct.unpack(">h", data[count:count+2])
widthtable.append(width)
count = count + 2
@@ -238,15 +239,15 @@
self._rawglyphwidthtable = ""
return
numberofentries = len(self.widthTables)
- data = struct.pack('h', numberofentries - 1)
+ data = struct.pack('>h', numberofentries - 1)
tables = self.widthTables.items()
tables.sort()
for stylecode, table in tables:
- data = data + struct.pack('h', stylecode)
+ data = data + struct.pack('>h', stylecode)
if len(table) <> (3 + self.ffLastChar - self.ffFirstChar):
raise error, "width table has wrong length"
for width in table:
- data = data + struct.pack('h', width)
+ data = data + struct.pack('>h', width)
if DEBUG:
print "glyph width table is the same?", self._rawglyphwidthtable == data and 'yes.' or 'no.'
self._rawglyphwidthtable = data
@@ -257,17 +258,17 @@
return
data = self.FOND.data
offset = self.ffKernOff
- numberofentries, = struct.unpack("h", data[offset:offset+2])
+ numberofentries, = struct.unpack(">h", data[offset:offset+2])
numberofentries = numberofentries + 1
count = offset + 2
for i in range(numberofentries):
- stylecode, = struct.unpack("h", data[count:count+2])
+ stylecode, = struct.unpack(">h", data[count:count+2])
count = count + 2
- numberofpairs, = struct.unpack("h", data[count:count+2])
+ numberofpairs, = struct.unpack(">h", data[count:count+2])
count = count + 2
kerntable = self.kernTables[stylecode] = []
for j in range(numberofpairs):
- firstchar, secondchar, kerndistance = struct.unpack("cch", data[count:count+4])
+ firstchar, secondchar, kerndistance = struct.unpack(">cch", data[count:count+4])
kerntable.append((ord(firstchar), ord(secondchar), kerndistance))
count = count + 4
@@ -281,14 +282,14 @@
self.ffKernOff = 0
return
numberofentries = len(self.kernTables)
- data = [struct.pack('h', numberofentries - 1)]
+ data = [struct.pack('>h', numberofentries - 1)]
tables = self.kernTables.items()
tables.sort()
for stylecode, table in tables:
- data.append(struct.pack('h', stylecode))
- data.append(struct.pack('h', len(table))) # numberofpairs
+ data.append(struct.pack('>h', stylecode))
+ data.append(struct.pack('>h', len(table))) # numberofpairs
for firstchar, secondchar, kerndistance in table:
- data.append(struct.pack("cch", chr(firstchar), chr(secondchar), kerndistance))
+ data.append(struct.pack(">cch", chr(firstchar), chr(secondchar), kerndistance))
data = string.join(data, '')
@@ -308,9 +309,9 @@
return
data = self.FOND.data
self.fondClass, self.glyphTableOffset, self.styleMappingReserved, = \
- struct.unpack("hll", data[offset:offset+10])
- self.styleIndices = struct.unpack('48b', data[offset + 10:offset + 58])
- stringcount, = struct.unpack('h', data[offset+58:offset+60])
+ struct.unpack(">hll", data[offset:offset+10])
+ self.styleIndices = struct.unpack('>48b', data[offset + 10:offset + 58])
+ stringcount, = struct.unpack('>h', data[offset+58:offset+60])
count = offset + 60
for i in range(stringcount):
@@ -331,14 +332,14 @@
if not self.styleIndices:
self._rawstylemappingtable = ""
return
- data = struct.pack("hll", self.fondClass, self.glyphTableOffset,
+ data = struct.pack(">hll", self.fondClass, self.glyphTableOffset,
self.styleMappingReserved)
self._packstylestrings()
- data = data + apply(struct.pack, ("48b",) + self.styleIndices)
+ data = data + apply(struct.pack, (">48b",) + self.styleIndices)
stringcount = len(self.styleStrings)
- data = data + struct.pack("h", stringcount)
+ data = data + struct.pack(">h", stringcount)
for string in self.styleStrings:
data = data + chr(len(string)) + string
@@ -401,7 +402,7 @@
data = self._rawstylemappingtable
if not data:
return
- data = data[:2] + struct.pack("l", self.glyphTableOffset) + data[6:]
+ data = data[:2] + struct.pack(">l", self.glyphTableOffset) + data[6:]
self._rawstylemappingtable = data
def _getglyphencodingsubtable(self):
@@ -410,7 +411,7 @@
return
offset = self.ffStylOff + self.glyphTableOffset
data = self.FOND.data
- numberofentries, = struct.unpack("h", data[offset:offset+2])
+ numberofentries, = struct.unpack(">h", data[offset:offset+2])
count = offset + 2
for i in range(numberofentries):
glyphcode = ord(data[count])
@@ -430,7 +431,7 @@
self._rawglyphencodingsubtable = ""
return
numberofentries = len(self.glyphEncoding)
- data = struct.pack("h", numberofentries)
+ data = struct.pack(">h", numberofentries)
items = self.glyphEncoding.items()
items.sort()
for glyphcode, glyphname in items:
diff -urN fonttools-20050315/Lib/fontTools/misc/psCharStrings.py fonttools-20050624/Lib/fontTools/misc/psCharStrings.py
--- fonttools-20050315/Lib/fontTools/misc/psCharStrings.py 2005-02-24 00:52:27.000000000 +0330
+++ fonttools-20050624/Lib/fontTools/misc/psCharStrings.py 2005-05-07 13:11:12.000000000 +0430
@@ -780,7 +780,8 @@
#
def op_hflex(self, index):
dx1, dx2, dy2, dx3, dx4, dx5, dx6 = self.popall()
- dy1 = dy3 = dy4 = dy5 = dy6 = 0
+ dy1 = dy3 = dy4 = dy6 = 0
+ dy5 = -dy2
self.rCurveTo((dx1, dy1), (dx2, dy2), (dx3, dy3))
self.rCurveTo((dx4, dy4), (dx5, dy5), (dx6, dy6))
def op_flex(self, index):
@@ -789,7 +790,9 @@
self.rCurveTo((dx4, dy4), (dx5, dy5), (dx6, dy6))
def op_hflex1(self, index):
dx1, dy1, dx2, dy2, dx3, dx4, dx5, dy5, dx6 = self.popall()
- dy3 = dy4 = dy6 = 0
+ dy3 = dy4 = 0
+ dy6 = -(dy1 + dy2 + dy3 + dy4 + dy5)
+
self.rCurveTo((dx1, dy1), (dx2, dy2), (dx3, dy3))
self.rCurveTo((dx4, dy4), (dx5, dy5), (dx6, dy6))
def op_flex1(self, index):
@@ -798,9 +801,9 @@
dy = dy1 + dy2 + dy3 + dy4 + dy5
if abs(dx) > abs(dy):
dx6 = d6
- dy6 = 0
+ dy6 = -dy
else:
- dx6 = 0
+ dx6 = -dx
dy6 = d6
self.rCurveTo((dx1, dy1), (dx2, dy2), (dx3, dy3))
self.rCurveTo((dx4, dy4), (dx5, dy5), (dx6, dy6))
diff -urN fonttools-20050315/Lib/fontTools/pens/basePen.py fonttools-20050624/Lib/fontTools/pens/basePen.py
--- fonttools-20050315/Lib/fontTools/pens/basePen.py 2005-03-08 13:20:55.000000000 +0330
+++ fonttools-20050624/Lib/fontTools/pens/basePen.py 2005-04-10 17:48:42.000000000 +0430
@@ -162,8 +162,11 @@
of the base glyph and draws it onto self.
"""
from fontTools.pens.transformPen import TransformPen
- glyph = self.glyphSet.get(glyphName)
- if glyph is not None:
+ try:
+ glyph = self.glyphSet[glyphName]
+ except KeyError:
+ pass
+ else:
tPen = TransformPen(self, transformation)
glyph.draw(tPen)

View File

@ -0,0 +1,17 @@
--- fonttools/Lib/fontTools/ttLib/tables/O_S_2f_2.py.unsigned-ranges 2006-05-08 17:13:17.000000000 +0330
+++ fonttools/Lib/fontTools/ttLib/tables/O_S_2f_2.py 2006-05-08 17:14:04.000000000 +0330
@@ -52,10 +52,10 @@
yStrikeoutPosition: h # strikeout position
sFamilyClass: h # font family class and subclass
panose: 10s # panose classification number
- ulUnicodeRange1: l # character range
- ulUnicodeRange2: l # character range
- ulUnicodeRange3: l # character range
- ulUnicodeRange4: l # character range
+ ulUnicodeRange1: L # character range
+ ulUnicodeRange2: L # character range
+ ulUnicodeRange3: L # character range
+ ulUnicodeRange4: L # character range
achVendID: 4s # font vendor identification
fsSelection: H # font selection flags
fsFirstCharIndex: H # first unicode character index

100
fonttools.spec Normal file
View File

@ -0,0 +1,100 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%define alphatag 20050624cvs
Name: fonttools
Version: 2.0
Release: 0.6.%{alphatag}%{?dist}
Summary: A tool to convert True/OpenType fonts to XML and back
Group: Development/Tools
License: BSD
URL: http://sourceforge.net/projects/fonttools/
Source0: http://fonttools.sourceforge.net/cvs-snapshots/bzip2/fonttools-2005-03-15.210812.tar.bz2
Patch1: fonttools-20050315-20050624.patch
Patch2: fonttools-unsigned-ranges.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python-devel python-numeric
Requires: python-abi = %(%{__python} -c "import sys ; print sys.version[:3]")
Requires: python-numeric
Provides: ttx
%description
TTX/FontTools is a tool for manipulating TrueType and OpenType fonts. It is
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
%setup -q -n %{name}
%patch1 -p1 -b .20050624
%patch2 -p1 -b .unsigned-ranges
%{__sed} -i.nobang '1 d' Lib/fontTools/ttx.py
%{__chmod} a-x LICENSE.txt
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT%{python_sitearch}/FontTools/fontTools/ttLib/test
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc LICENSE.txt
%doc Doc/bugs.txt Doc/ChangeLog.txt Doc/changes.txt Doc/documentation.html
%{python_sitearch}/FontTools.pth
%dir %{python_sitearch}/FontTools
%dir %{python_sitearch}/FontTools/fontTools
%dir %{python_sitearch}/FontTools/fontTools/encodings
%dir %{python_sitearch}/FontTools/fontTools/misc
%dir %{python_sitearch}/FontTools/fontTools/pens
%dir %{python_sitearch}/FontTools/fontTools/ttLib
%dir %{python_sitearch}/FontTools/fontTools/ttLib/tables
%{python_sitearch}/FontTools/*.py
%{python_sitearch}/FontTools/*.pyc
%ghost %{python_sitearch}/FontTools/*.pyo
%{python_sitearch}/FontTools/fontTools/*.py
%{python_sitearch}/FontTools/fontTools/*.pyc
%ghost %{python_sitearch}/FontTools/fontTools/*.pyo
%{python_sitearch}/FontTools/fontTools/*/*.py
%{python_sitearch}/FontTools/fontTools/*/*.pyc
%ghost %{python_sitearch}/FontTools/fontTools/*/*.pyo
%{python_sitearch}/FontTools/fontTools/*/*/*.py
%{python_sitearch}/FontTools/fontTools/*/*/*.pyc
%ghost %{python_sitearch}/FontTools/fontTools/*/*/*.pyo
%{python_sitearch}/FontTools/fontTools/misc/eexecOp.so
%{_bindir}/ttx
%changelog
* Mon May 08 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 2.0-0.6.20050624cvs
- Change specification of ulUnicodeRange1-4 to unsigned long
* Mon Feb 13 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 2.0-0.5.20050624cvs
- Rebuild for Fedora Extras 5
* Thu Feb 02 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 2.0-0.4.20050624cvs
- Provide ttx
* Wed Feb 01 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 2.0-0.3.20050624cvs
- Use upstream snapshots, moving the difference into a patch
- Change alphatag time to the latest change in CVS
- Use %%{python_sitearch} instead of %%{python_sitelib} (for x86_86)
- Use sed instead of a patch to remove shebang
* Sun Jan 08 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 2.0-0.2.20060103cvs
- Add %%{?dist} tag
* Fri Jan 06 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 2.0-0.1.20060103cvs
- Initial packaging

1
sources Normal file
View File

@ -0,0 +1 @@
b44a299a0530a2a4f65d1937aa99f734 fonttools-2005-03-15.210812.tar.bz2