avatar
Rosa has added 21a60b2bfe
initial: add from SRPM
... ... --- /dev/null
... ... +++ b/.abf.yml
... ... @@ -0,0 +1,3 @@
1
sources:
2
  "ReportLab_2_1-fontclean.tar.lzma": fd9acd5f14ce628f105165d6a04e39ddaca16ab8
3
  "rl_accel-0.61-daily-unix.tgz": a80ec90e9147d6ea3dc678ceaa8b44c9568a99af
view file @ 21a60b2bfe
... ... --- /dev/null
... ... +++ b/python-reportlab-2.1-fontclean.patch
... ... @@ -0,0 +1,527 @@
1
--- reportlab/graphics/testshapes.py.fontclean	2008-12-25 14:29:26.000000000 +0100
2
+++ reportlab/graphics/testshapes.py	2008-12-25 14:29:26.000000000 +0100
3
@@ -383,7 +383,7 @@
4
     on the font patch given in rl_config.py,
5
     for example in reportlab/lib/fonts/.
6
     """
7
-    faceName = "LettErrorRobot-Chrome"
8
+    faceName = "Wargames-Regular"
9
     D = Drawing(400, 200)
10
     for size in range(12, 36, 4):
11
         D.add(String(10+size*2,
12
--- reportlab/tools/docco/examples.py.fontclean	2008-12-25 14:29:26.000000000 +0100
13
+++ reportlab/tools/docco/examples.py	2008-12-25 14:29:26.000000000 +0100
14
@@ -461,16 +461,16 @@
15
     from reportlab.pdfbase import pdfmetrics
16
     afmFile, pfbFile = rl_doc_utils.getJustFontPaths()
17
     justFace = pdfmetrics.EmbeddedType1Face(afmFile, pfbFile)
18
-    faceName = 'LettErrorRobot-Chrome' # pulled from AFM file
19
+    faceName = 'Wargames' # pulled from AFM file
20
     pdfmetrics.registerTypeFace(justFace)
21
-    justFont = pdfmetrics.Font('LettErrorRobot-Chrome',
22
+    justFont = pdfmetrics.Font('Wargames',
23
                                faceName,
24
                                'WinAnsiEncoding')
25
     pdfmetrics.registerFont(justFont)
26
 
27
-    canvas.setFont('LettErrorRobot-Chrome', 32)
28
+    canvas.setFont('Wargames', 32)
29
     canvas.drawString(10, 150, 'This should be in')
30
-    canvas.drawString(10, 100, 'LettErrorRobot-Chrome')
31
+    canvas.drawString(10, 100, 'Wargames')
32
 """
33
 
34
 testttffont1 = """
35
@@ -480,12 +480,12 @@
36
     reportlab.rl_config.warnOnMissingFontGlyphs = 0
37
     from reportlab.pdfbase import pdfmetrics
38
     from reportlab.pdfbase.ttfonts import TTFont
39
-    pdfmetrics.registerFont(TTFont('Rina', 'rina.ttf'))
40
+    pdfmetrics.registerFont(TTFont('PenguinAttack', 'PenguinAttack.ttf'))
41
     from reportlab.pdfgen.canvas import Canvas
42
 
43
-    canvas.setFont('Rina', 32)
44
+    canvas.setFont('PenguinAttack', 24)
45
     canvas.drawString(10, 150, "Some UTF-8 text encoded")
46
-    canvas.drawString(10, 100, "in the Rina TT Font!")
47
+    canvas.drawString(10, 100, "in the PenguinAttack TT Font!")
48
 """
49
 
50
 testcursormoves1 = """
51
--- reportlab/tools/docco/rl_doc_utils.py.fontclean	2008-12-25 14:29:26.000000000 +0100
52
+++ reportlab/tools/docco/rl_doc_utils.py	2008-12-25 14:29:26.000000000 +0100
53
@@ -102,7 +102,7 @@
54
     '''return afm and pfb for Just's files'''
55
     import reportlab
56
     folder = os.path.dirname(reportlab.__file__) + os.sep + 'fonts'
57
-    return os.path.join(folder, 'LeERC___.AFM'), os.path.join(folder, 'LeERC___.PFB')
58
+    return os.path.join(folder, 'Wargames.afm'), os.path.join(folder, 'Wargames.pfb')
59
 
60
 # for testing
61
 def NOP(*x,**y):
62
--- reportlab/docs/graphguide/ch3_shapes.py.fontclean	2008-12-25 14:29:27.000000000 +0100
63
+++ reportlab/docs/graphguide/ch3_shapes.py	2008-12-25 14:29:27.000000000 +0100
64
@@ -224,7 +224,7 @@
65
 disc("""
66
 Here is a more fancy example using the code snippet below.
67
 Please consult the ReportLab User Guide to see how non-standard
68
-like 'LettErrorRobot-Chrome' fonts are being registered!
69
+like 'Wargames' fonts are being registered!
70
 """)
71
 
72
 eg("""
73
@@ -239,7 +239,7 @@
74
                  fontSize=36))
75
 
76
     d.add(String(150, 160, 'Hello World',
77
-                 fontName='LettErrorRobot-Chrome',
78
+                 fontName='Wargames',
79
                  fontSize=36))
80
 """)
81
 
82
@@ -248,7 +248,7 @@
83
 rl_config.warnOnMissingFontGlyphs = 0
84
 afmFile, pfbFile = getJustFontPaths()
85
 T1face = pdfmetrics.EmbeddedType1Face(afmFile, pfbFile)
86
-T1faceName = 'LettErrorRobot-Chrome'
87
+T1faceName = 'Wargames'
88
 pdfmetrics.registerTypeFace(T1face)
89
 T1font = pdfmetrics.Font(T1faceName, T1faceName, 'WinAnsiEncoding')
90
 pdfmetrics.registerFont(T1font)
91
@@ -264,7 +264,7 @@
92
              fontSize=36))
93
 
94
 d.add(String(150, 160, 'Hello World',
95
-             fontName='LettErrorRobot-Chrome',
96
+             fontName='Wargames',
97
              fontSize=36))
98
 
99
 draw(d, 'fancy font example')
100
--- reportlab/docs/userguide/ch2a_fonts.py.fontclean	2008-12-25 14:29:27.000000000 +0100
101
+++ reportlab/docs/userguide/ch2a_fonts.py	2008-12-25 14:29:27.000000000 +0100
102
@@ -117,7 +117,10 @@
103
 font named <i>LettErrorRobot-Chrome</i> which we may
104
 use for testing and/or documenting purposes (and which you may
105
 use as well). It comes bundled with the ReportLab distribution in the
106
-directory $reportlab/fonts$.
107
+directory $reportlab/fonts$ This font can't be shipped with the 
108
+Mandriva package of ReportLab, since it license is not free. Instead,
109
+we use an subset of Dustin Norlander's font <i>Wargames</i>, which
110
+can be distributed freely (under the terms of the GPL).
111
 """)
112
 
113
 disc("""
114
@@ -127,7 +130,7 @@
115
 ('glyphs') in the font such as height, width, bounding box info and
116
 other 'metrics', while the latter is a binary file that describes the
117
 shapes of the font. The $reportlab/fonts$ directory contains the files
118
-$'LeERC___.AFM'$ and $'LeERC___.PFB'$ that are used as an example
119
+$'Wargames.afm'$ and $'Wargames.pfb'$ that are used as an example
120
 font.
121
 """)
122
 
123
@@ -142,21 +145,21 @@
124
 import os
125
 import reportlab
126
 folder = os.path.dirname(reportlab.__file__) + os.sep + 'fonts'
127
-afmFile = os.path.join(folder, 'LeERC___.AFM')
128
-pfbFile = os.path.join(folder, 'LeERC___.PFB')
129
+afmFile = os.path.join(folder, 'Wargames.afm')
130
+pfbFile = os.path.join(folder, 'Wargames.pfb')
131
 
132
 from reportlab.pdfbase import pdfmetrics
133
 justFace = pdfmetrics.EmbeddedType1Face(afmFile, pfbFile)
134
-faceName = 'LettErrorRobot-Chrome' # pulled from AFM file
135
+faceName = 'Wargames' # pulled from AFM file
136
 pdfmetrics.registerTypeFace(justFace)
137
-justFont = pdfmetrics.Font('LettErrorRobot-Chrome',
138
+justFont = pdfmetrics.Font('Wargames',
139
                            faceName,
140
                            'WinAnsiEncoding')
141
 pdfmetrics.registerFont(justFont)
142
 
143
-canvas.setFont('LettErrorRobot-Chrome', 32)
144
+canvas.setFont('Wargames', 32)
145
 canvas.drawString(10, 150, 'This should be in')
146
-canvas.drawString(10, 100, 'LettErrorRobot-Chrome')
147
+canvas.drawString(10, 100, 'Wargames')
148
 """)
149
 
150
 
151
@@ -201,7 +204,7 @@
152
 """)
153
 
154
 disc("""
155
-In the <i>LettErrorRobot-Chrome</i> example we explicitely specified
156
+In the <i>Wargames</i> example we explicitely specified
157
 the place of the font description files to be loaded.
158
 In general, you'll prefer to store your fonts in some canonic
159
 locations and make the embedding mechanism aware of them.
160
@@ -299,12 +302,12 @@
161
 
162
 from reportlab.pdfbase import pdfmetrics
163
 from reportlab.pdfbase.ttfonts import TTFont
164
-pdfmetrics.registerFont(TTFont('Rina', 'rina.ttf'))
165
-canvas.setFont(Rina, 32)
166
+pdfmetrics.registerFont(TTFont('PenguinAttack', 'PenguinAttack.ttf'))
167
+canvas.setFont(PenguinAttack, 24)
168
 canvas.drawString(10, 150, "Some text encoded in UTF-8")
169
-canvas.drawString(10, 100, "In the Rina TT Font!")
170
+canvas.drawString(10, 100, "In the PenguinAttack TT Font!")
171
 """)
172
-illust(examples.ttffont1, "Using a the Rina TrueType Font")
173
+illust(examples.ttffont1, "Using a the PenguinAttack TrueType Font")
174
 disc("""In the above example the true type font object is created using""")
175
 eg("""
176
     TTFont(name,filename)
177
@@ -318,29 +321,29 @@
178
 from reportlab.lib.styles import ParagraphStyle
179
 
180
 from reportlab.lib.fonts import addMapping
181
-addMapping('Rina', 0, 0, 'Rina')
182
-addMapping('Rina', 0, 1, 'Rina')
183
-addMapping('Rina', 1, 0, 'Rina')
184
-addMapping('Rina', 1, 1, 'Rina')
185
+addMapping('PenguinAttack', 0, 0, 'PenguinAttack')
186
+addMapping('PenguinAttack', 0, 1, 'PenguinAttack')
187
+addMapping('PenguinAttack', 1, 0, 'PenguinAttack')
188
+addMapping('PenguinAttack', 1, 1, 'PenguinAttack')
189
 
190
 disc("""Before using the TT Fonts in Platypus we should add a mapping from the family name to the
191
 individual font names that describe the behaviour under the $<b>$ and $<i>$ attributes.""")
192
 
193
 eg("""
194
 from reportlab.lib.fonts import addMapping
195
-addMapping('Rina', 0, 0, 'Rina')    #normal
196
-addMapping('Rina', 0, 1, 'Rina')    #italic
197
-addMapping('Rina', 1, 0, 'Rina')    #bold
198
-addMapping('Rina', 1, 1, 'Rina')    #italic and bold
199
+addMapping('PenguinAttack', 0, 0, 'PenguinAttack')    #normal
200
+addMapping('PenguinAttack', 0, 1, 'PenguinAttack')    #italic
201
+addMapping('PenguinAttack', 1, 0, 'PenguinAttack')    #bold
202
+addMapping('PenguinAttack', 1, 1, 'PenguinAttack')    #italic and bold
203
 """)
204
 
205
-disc("""We only have a Rina regular font, no bold or italic, so we must map all to the
206
+disc("""We only have a PenguinAttack regular font, no bold or italic, so we must map all to the
207
 same internal fontname.  ^&lt;b&gt;^ and ^&lt;i&gt;^ tags may now be used safely, but
208
 have no effect.
209
 After registering and mapping
210
-the Rina font as above we can use paragraph text like""")
211
+the PenguinAttack font as above we can use paragraph text like""")
212
 parabox2("""<font name="Times-Roman" size="14">This is in Times-Roman</font>
213
-<font name="Rina" color="magenta" size="14">and this is in magenta <b>Rina!</b></font>""","Using TTF fonts in paragraphs")
214
+<font name="PenguinAttack" color="magenta" size="14">and this is in magenta <b>PenguinAttack!</b></font>""","Using TTF fonts in paragraphs")
215
 
216
 
217
 
218
--- reportlab/docs/userguide/ch1_intro.py.fontclean	2008-12-25 14:29:27.000000000 +0100
219
+++ reportlab/docs/userguide/ch1_intro.py	2008-12-25 14:29:27.000000000 +0100
220
@@ -150,6 +150,10 @@
221
 are glad to include these in the toolkit. Finally we thank Bigelow &amp; Holmes Inc ($design@bigelowandholmes.com$)
222
 for Luxi Serif Regular and Ray Larabie ($http://www.larabiefonts.com$) for the Rina TrueType font.""")
223
 
224
+disc("""Remark regarding the Mandriva package: Sadly, these three fonts have non-free
225
+licenses and therefore are not provided with the Mandriva package of ReportLab. The Mandriva package
226
+replaces this fonts with GPL fonts by Dustin Norlander.""")
227
+
228
 heading2("Installation and Setup")
229
 
230
 disc("""
231
--- reportlab/setup.py.fontclean	2008-12-25 14:29:27.000000000 +0100
232
+++ reportlab/setup.py	2008-12-25 14:29:26.000000000 +0100
233
@@ -143,19 +143,17 @@
234
         'docs/userguide/testfile.txt',
235
 
236
         'extensions/README',
237
-        
238
-        'fonts/00readme.txt',
239
-        'fonts/bitstream-vera-license.txt',
240
-        'fonts/LeERC___.AFM',
241
-        'fonts/LeERC___.PFB',
242
-        'fonts/luxiserif.ttf',
243
-        'fonts/luxiserif_license.txt',
244
-        'fonts/rina.ttf',
245
-        'fonts/rina_license.txt',
246
-        'fonts/Vera.ttf',
247
-        'fonts/VeraBd.ttf',
248
-        'fonts/VeraBI.ttf',
249
-        'fonts/VeraIt.ttf',
250
+
251
+	'fonts/00readme.txt',
252
+	'fonts/bitstream-vera-license.txt',
253
+	'fonts/Dustismo_Roman.ttf',
254
+	'fonts/PenguinAttack.ttf',
255
+	'fonts/VeraBd.ttf',
256
+	'fonts/VeraBI.ttf',
257
+	'fonts/VeraIt.ttf',
258
+	'fonts/Vera.ttf',
259
+	'fonts/Wargames.afm',
260
+	'fonts/Wargames.pfb',
261
 
262
         'test/pythonpowered.gif',
263
 
264
@@ -167,8 +165,8 @@
265
         'tools/pythonpoint/README',
266
         'tools/pythonpoint/pythonpoint.dtd',
267
         'tools/pythonpoint/demos/htu.xml',
268
-        'tools/pythonpoint/demos/LeERC___.AFM',
269
-        'tools/pythonpoint/demos/LeERC___.PFB',
270
+#        'tools/pythonpoint/demos/LeERC___.AFM',
271
+#        'tools/pythonpoint/demos/LeERC___.PFB',
272
         'tools/pythonpoint/demos/leftlogo.a85',
273
         'tools/pythonpoint/demos/leftlogo.gif',
274
         'tools/pythonpoint/demos/lj8100.jpg',
275
--- reportlab/test/test_pdfbase_ttfonts.py.fontclean	2008-12-25 14:29:27.000000000 +0100
276
+++ reportlab/test/test_pdfbase_ttfonts.py	2008-12-25 14:29:27.000000000 +0100
277
@@ -1,8 +1,8 @@
278
 
279
 """Test TrueType font subsetting & embedding code.
280
 
281
-This test uses a sample font (luxiserif.ttf) taken from XFree86 which is called Luxi
282
-Serif Regular and is covered under the license in ../fonts/luxiserif_licence.txt.
283
+This test uses a sample font by Dustin Norlander (Dustismo_Roman.ttf).
284
+The font is free and can be distributed under the terms of the GPL.
285
 """
286
 
287
 import string
288
@@ -63,7 +63,7 @@
289
     c.drawString(100,700, 'Unicode TrueType Font Test %d pages' % npages)
290
     # Draw a table of Unicode characters
291
     for p in xrange(npages):
292
-        for fontName in ('TestFont','RinaFont'):
293
+        for fontName in ('TestFont','PenguinFont'):
294
             c.setFont(fontName, 10)
295
             for i in xrange(32):
296
                 for j in xrange(32):
297
@@ -77,8 +77,8 @@
298
 
299
     def testTTF(self):
300
         "Test PDF generation with TrueType fonts"
301
-        pdfmetrics.registerFont(TTFont("TestFont", "luxiserif.ttf"))
302
-        pdfmetrics.registerFont(TTFont("RinaFont", "rina.ttf"))
303
+         pdfmetrics.registerFont(TTFont("TestFont", "Dustismo_Roman.ttf"))
304
+         pdfmetrics.registerFont(TTFont("PenguinFont", "PenguinAttack.ttf"))
305
         _simple_subset_generation('test_pdfbase_ttfonts1.pdf',1)
306
         _simple_subset_generation('test_pdfbase_ttfonts3.pdf',3)
307
         _simple_subset_generation('test_pdfbase_ttfonts35.pdf',3,5)
308
@@ -123,16 +123,16 @@
309
 
310
     def testFontFile(self):
311
         "Tests TTFontFile and TTF parsing code"
312
-        ttf = TTFontFile("luxiserif.ttf")
313
-        self.assertEquals(ttf.name, "LuxiSerif")
314
+        ttf = TTFontFile("Dustismo_Roman.ttf")
315
+        self.assertEquals(ttf.name, "DustismoRoman")
316
         self.assertEquals(ttf.flags, FF_SYMBOLIC)
317
         self.assertEquals(ttf.italicAngle, 0.0)
318
-        self.assertNear(ttf.ascent,783.203125)    # FIXME: or 992?
319
-        self.assertNear(ttf.descent,-205.078125)    # FIXME: or -210?
320
-        self.assertEquals(ttf.capHeight, 0)
321
-        self.assertNear(ttf.bbox, [-203.125, -210.9375, 983.3984375, 992.67578125])
322
+        self.assertEquals(ttf.ascent, 712)
323
+        self.assertEquals(ttf.descent, -238)
324
+        self.assertEquals(ttf.capHeight, 712)
325
+        self.assertEquals(ttf.bbox, [-113, -256, 923, 1051])
326
         self.assertEquals(ttf.stemV, 87)
327
-        self.assertEquals(ttf.defaultWidth, 250)
328
+        self.assertEquals(ttf.defaultWidth, 500)
329
 
330
     def testAdd32(self):
331
         "Test add32"
332
@@ -158,7 +158,7 @@
333
 
334
     def testFontFileChecksum(self):
335
         "Tests TTFontFile and TTF parsing code"
336
-        file = TTFOpenFile("luxiserif.ttf")[1].read()
337
+        file = TTFOpenFile("Dustismo_Roman.ttf")[1].read()
338
         TTFontFile(StringIO(file), validate=1) # should not fail
339
         file1 = file[:12345] + "\xFF" + file[12346:] # change one byte
340
         self.assertRaises(TTFError, TTFontFile, StringIO(file1), validate=1)
341
@@ -167,7 +167,7 @@
342
 
343
     def testSubsetting(self):
344
         "Tests TTFontFile and TTF parsing code"
345
-        ttf = TTFontFile("luxiserif.ttf")
346
+        ttf = TTFontFile("Dustismo_Roman.ttf")
347
         subset = ttf.makeSubset([0x41, 0x42])
348
         subset = TTFontFile(StringIO(subset), 0)
349
         for tag in ('cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'OS/2',
350
@@ -179,13 +179,13 @@
351
             pos = subset.read_ushort()    # this is actually offset / 2
352
             self.failIf(pos % 2 != 0, "glyph %d at +%d should be long aligned" % (n, pos * 2))
353
 
354
-        self.assertEquals(subset.name, "LuxiSerif")
355
+        self.assertEquals(subset.name, "DustismoRoman")
356
         self.assertEquals(subset.flags, FF_SYMBOLIC)
357
         self.assertEquals(subset.italicAngle, 0.0)
358
-        self.assertNear(subset.ascent,783.203125)       # FIXME: or 992?
359
-        self.assertNear(subset.descent,-205.078125)     # FIXME: or -210?
360
-        self.assertEquals(subset.capHeight, 0)
361
-        self.assertNear(subset.bbox, [-203.125, -210.9375, 983.3984375, 992.67578125])
362
+        self.assertEquals(subset.ascent, 712)
363
+        self.assertEquals(subset.descent, -238)
364
+        self.assertEquals(subset.capHeight, 712)
365
+        self.assertEquals(subset.bbox, [-113, -256, 923, 1051])
366
         self.assertEquals(subset.stemV, 87)
367
 
368
     def testFontMaker(self):
369
@@ -205,7 +205,7 @@
370
 
371
     def testAddSubsetObjects(self):
372
         "Tests TTFontFace.addSubsetObjects"
373
-        face = TTFontFace("luxiserif.ttf")
374
+        face = TTFontFace("Dustismo_Roman.ttf")
375
         doc = PDFDocument()
376
         fontDescriptor = face.addSubsetObjects(doc, "TestFont", [ 0x78, 0x2017 ])
377
         fontDescriptor = doc.idToObject[fontDescriptor.name].dict
378
@@ -243,7 +243,7 @@
379
 
380
     def testStringWidth(self):
381
         "Test TTFont.stringWidth"
382
-        font = TTFont("TestFont", "luxiserif.ttf")
383
+        font = TTFont("TestFont", "Dustismo_Roman.ttf")
384
         self.assert_(font.stringWidth("test", 10) > 0)
385
         width = font.stringWidth(utf8(0x2260) * 2, 1000)
386
         expected = font.face.getCharWidth(0x2260) * 2
387
@@ -252,7 +252,7 @@
388
     def testSplitString(self):
389
         "Tests TTFont.splitString"
390
         doc = PDFDocument()
391
-        font = TTFont("TestFont", "luxiserif.ttf")
392
+        font = TTFont("TestFont", "Dustismo_Roman.ttf")
393
         text = string.join(map(utf8, xrange(0, 511)), "")
394
         allchars = string.join(map(chr, xrange(0, 256)), "")
395
         nospace = allchars[:32] + allchars[33:]
396
@@ -284,7 +284,7 @@
397
     def testSubsetInternalName(self):
398
         "Tests TTFont.getSubsetInternalName"
399
         doc = PDFDocument()
400
-        font = TTFont("TestFont", "luxiserif.ttf")
401
+        font = TTFont("TestFont", "Dustismo_Roman.ttf")
402
         # Actually generate some subsets
403
         text = string.join(map(utf8, range(0, 513)), "")
404
         font.splitString(text, doc)
405
@@ -297,7 +297,7 @@
406
 
407
     def testAddObjectsEmpty(self):
408
         "TTFont.addObjects should not fail when no characters were used"
409
-        font = TTFont("TestFont", "luxiserif.ttf")
410
+        font = TTFont("TestFont", "Dustismo_Roman.ttf")
411
         doc = PDFDocument()
412
         font.addObjects(doc)
413
 
414
@@ -305,7 +305,7 @@
415
         "Test that TTFont.addObjects resets the font"
416
         # Actually generate some subsets
417
         doc = PDFDocument()
418
-        font = TTFont("TestFont", "luxiserif.ttf")
419
+        font = TTFont("TestFont", "Dustismo_Roman.ttf")
420
         font.splitString('a', doc)            # create some subset
421
         doc = PDFDocument()
422
         font.addObjects(doc)
423
@@ -319,7 +319,7 @@
424
         "Test that TTFont can be used for different documents at the same time"
425
         doc1 = PDFDocument()
426
         doc2 = PDFDocument()
427
-        font = TTFont("TestFont", "luxiserif.ttf")
428
+        font = TTFont("TestFont", "Dustismo_Roman.ttf")
429
         self.assertEquals(font.splitString(u'hello ', doc1), [(0, 'hello ')])
430
         self.assertEquals(font.splitString(u'hello ', doc2), [(0, 'hello ')])
431
         self.assertEquals(font.splitString(u'\u0410\u0411'.encode('UTF-8'), doc1), [(0, '\x80\x81')])
432
@@ -332,14 +332,14 @@
433
         "Test TTFont.addObjects"
434
         # Actually generate some subsets
435
         doc = PDFDocument()
436
-        font = TTFont("TestFont", "luxiserif.ttf")
437
+        font = TTFont("TestFont", "Dustismo_Roman.ttf")
438
         font.splitString('a', doc)            # create some subset
439
         internalName = font.getSubsetInternalName(0, doc)[1:]
440
         font.addObjects(doc)
441
         pdfFont = doc.idToObject[internalName]
442
         self.assertEquals(doc.idToObject['BasicFonts'].dict[internalName], pdfFont)
443
         self.assertEquals(pdfFont.Name, internalName)
444
-        self.assertEquals(pdfFont.BaseFont, "AAAAAA+LuxiSerif")
445
+        self.assertEquals(pdfFont.BaseFont, "AAAAAA+DustismoRoman")
446
         self.assertEquals(pdfFont.FirstChar, 0)
447
         self.assertEquals(pdfFont.LastChar, 127)
448
         self.assertEquals(len(pdfFont.Widths.sequence), 128)
449
--- reportlab/test/test_platypus_general.py.fontclean	2008-12-25 14:29:27.000000000 +0100
450
+++ reportlab/test/test_platypus_general.py	2008-12-25 14:29:27.000000000 +0100
451
@@ -461,14 +461,14 @@
452
     #######################################################################
453
     #     Examples Page 4 - custom fonts
454
     #######################################################################
455
-    # custom font with LettError-Robot font
456
+    # custom font with Wargames font
457
     import reportlab.rl_config
458
     reportlab.rl_config.warnOnMissingFontGlyphs = 0
459
 
460
     from reportlab.pdfbase import pdfmetrics
461
     fontDir = os.path.join(os.path.dirname(reportlab.__file__),'fonts')
462
-    face = pdfmetrics.EmbeddedType1Face(os.path.join(fontDir,'LeERC___.AFM'),os.path.join(fontDir,'LeERC___.PFB'))
463
-    faceName = face.name  # should be 'LettErrorRobot-Chrome'
464
+    face = pdfmetrics.EmbeddedType1Face(os.path.join(fontDir,'LeERC___.AFM'),os.path.join(fontDir,'Wargames.pfb'))
465
+    faceName = face.name  # should be 'Wargames'
466
     pdfmetrics.registerTypeFace(face)
467
     font = pdfmetrics.Font(faceName, faceName, 'WinAnsiEncoding')
468
     pdfmetrics.registerFont(font)
469
@@ -478,18 +478,18 @@
470
     story.append(Paragraph(
471
         """This is an ordinary paragraph, which happens to contain
472
         text in an embedded font:
473
-        <font name="LettErrorRobot-Chrome">LettErrorRobot-Chrome</font>.
474
+        <font name="Wargames">Wargames</font>.
475
         Now for the real challenge...""", styleSheet['Normal']))
476
 
477
 
478
-    styRobot = ParagraphStyle('Robot', styleSheet['Normal'])
479
-    styRobot.fontSize = 16
480
-    styRobot.leading = 20
481
-    styRobot.fontName = 'LettErrorRobot-Chrome'
482
+    styWargames = ParagraphStyle('Wargames', styleSheet['Normal'])
483
+    styWargames.fontSize = 16
484
+    styWargames.leading = 20
485
+    styWargames.fontName = 'Wargames'
486
 
487
     story.append(Paragraph(
488
-                "This whole paragraph is 16-point Letterror-Robot-Chrome.",
489
-                styRobot))
490
+                "This whole paragraph is 16-point Wargames.",
491
+                styWargames))
492
     story.append(FrameBreak())
493
 
494
     if _GIF:
495
--- reportlab/test/test_pdfbase_fontembed.py.fontclean	2008-12-25 14:29:27.000000000 +0100
496
+++ reportlab/test/test_pdfbase_fontembed.py	2008-12-25 14:29:27.000000000 +0100
497
@@ -16,7 +16,11 @@
498
 
499
         Just vam Rossum has kindly donated a font which we may use
500
         for testing purposes.  You need to contact him at just@letterror.com
501
-        if you want to use it for real."""
502
+        if you want to use it for real.
503
+	
504
+	Message from the Mandriva package maintainer: The Mandriva package
505
+	can't ship Just's font, therefore we have replaced it with a subset 
506
+	of a free font by Dustin Norlander, Wargames."""
507
 
508
         #LettError fonts should always be there.  The others are voluntary.
509
 
510
@@ -67,14 +71,14 @@
511
 ##        justFont = pdfmetrics.Font('LettErrorRobot-Chrome', faceName, 'WinAnsiEncoding')
512
 ##        pdfmetrics.registerFont(justFont)
513
 
514
-        c.setFont('LettErrorRobot-Chrome', 12)
515
-        c.drawString(100, y, 'This should be in LettErrorRobot-Chrome')
516
+        c.setFont('Wargames', 12)
517
+        c.drawString(100, y, 'This should be in Wargames')
518
 
519
         def testNamedFont(canv, fontName):
520
             canv.showPage()
521
             makeWidthTestForAllGlyphs(canv, fontName, outlining=0)
522
 
523
-        testNamedFont(c, 'LettErrorRobot-Chrome')
524
+        testNamedFont(c, 'Wargames')
525
 
526
         c.save()
527
 
view file @ 21a60b2bfe
... ... --- /dev/null
... ... +++ b/python-reportlab-2.1-link.patch
... ... @@ -0,0 +1,11 @@
1
--- reportlab/setup.py.link	2011-05-05 10:03:02.000000000 +0200
2
+++ reportlab/setup.py	2011-05-05 10:04:16.000000000 +0200
3
@@ -194,7 +194,7 @@
4
 
5
     if tra:
6
         RL_ACCEL = _find_rl_accel()
7
-        LIBS = []
8
+        LIBS = ['m']
9
         DATA_FILES = {}
10
         if not RL_ACCEL:
11
             EXT_MODULES = []
view file @ 21a60b2bfe
... ... --- /dev/null
... ... +++ b/python-reportlab.spec
... ... @@ -0,0 +1,139 @@
1
%define ver 2_1
2
3
Summary:	ReportLab library to create PDF documents using Python
4
Name:		python-reportlab
5
Version:	2.5
6
Release:	%mkrel 3
7
URL:		http://www.reportlab.org/
8
# Upstream tarball with Odyssey text and non-free font files replaced
9
# Changes copied from Debian package - AdamW 2008/02
10
Source0:	http://www.reportlab.org/ftp/ReportLab_%{ver}-fontclean.tar.lzma
11
Source1:	rl_accel-0.61-daily-unix.tgz
12
# From Debian, rediffed: changes source to use the free replacement 
13
# fonts - AdamW 2008/02
14
Patch0:		python-reportlab-2.1-fontclean.patch
15
Patch1:		python-reportlab-2.1-link.patch
16
License:	BSD
17
Group:		Publishing
18
BuildRoot:	%{_tmppath}/%{name}-buildroot
19
%py_requires -d
20
21
%description
22
ReportLab is a library that lets you directly create documents in
23
Adobe's Portable Document Format (PDF) using the Python programming
24
language.
25
26
ReportLab library creates PDF based on graphics commands without
27
intervening steps. It's therefore extremely fast, and flexible (since
28
you're using a full-blown programming language).
29
30
Sample use cases are:
31
32
  * Dynamic PDF generation on the web
33
  * High-volume corporate reporting and database publishing
34
  * As embeddable print engine for other applications, including a
35
    'report language' so that users can customize their own reports.
36
  * As 'build system' for complex documents with charts, tables and text
37
    such as management accounts, statistical reports and scientific papers
38
  * from XML to PDF in one step
39
40
%prep
41
%setup -q -n reportlab_%{ver}
42
%patch0 -p0 -b .fontclean
43
%patch1 -p0 -b .link
44
tar zxf %{SOURCE1}
45
mv rl_accel*/rl_accel reportlab/
46
find . -type f | xargs perl -p -i -e 's@#!/bin/env python@#!/usr/bin/env python@'
47
48
%build
49
cd reportlab
50
python setup.py build
51
52
%install
53
rm -rf %{buildroot}
54
cd reportlab
55
python setup.py install --root=%{buildroot} --compile --optimize=2
56
#cd %{buildroot}%_libdir/python*
57
#tar c reportlab | tar x -C site-packages
58
#rm -rf reportlab
59
60
%clean
61
rm -rf %{buildroot}
62
63
%files
64
%defattr(-,root,root)
65
%doc reportlab/license.txt reportlab/README 
66
%{py_platsitedir}/*
67
68
69
%changelog
70
* Thu May 05 2011 Funda Wang <fwang@mandriva.org> 2.5-3mdv2011.0
71
+ Revision: 669074
72
- fix linkage
73
74
  + Oden Eriksson <oeriksson@mandriva.com>
75
    - mass rebuild
76
77
* Sun Oct 31 2010 Andrey Borzenkov <arvidjaar@mandriva.org> 2.5-2mdv2011.0
78
+ Revision: 590771
79
- rebuild for new python 2.7
80
81
* Sat Oct 23 2010 Guillaume Rousse <guillomovitch@mandriva.org> 2.5-1mdv2011.0
82
+ Revision: 587729
83
- update to new version 2.5
84
85
* Mon Jan 25 2010 Guillaume Rousse <guillomovitch@mandriva.org> 2.4-1mdv2010.1
86
+ Revision: 496371
87
- update to new version 2.4
88
89
* Tue Oct 06 2009 Thierry Vignaud <tv@mandriva.org> 2.3-2mdv2010.0
90
+ Revision: 454778
91
- do not package huge doc
92
93
* Tue Jun 09 2009 Guillaume Rousse <guillomovitch@mandriva.org> 2.3-1mdv2010.0
94
+ Revision: 384256
95
- update to new version 2.3
96
97
* Thu Dec 25 2008 Funda Wang <fwang@mandriva.org> 2.2-2mdv2009.1
98
+ Revision: 318902
99
- rediff fontclean patch
100
- rebuild for new python
101
102
* Sat Nov 22 2008 Guillaume Rousse <guillomovitch@mandriva.org> 2.2-1mdv2009.1
103
+ Revision: 305869
104
- update to new version 2.2
105
106
* Wed Jun 18 2008 Thierry Vignaud <tv@mandriva.org> 2.1-3mdv2009.0
107
+ Revision: 225140
108
- rebuild
109
110
* Thu Feb 28 2008 Adam Williamson <awilliamson@mandriva.org> 2.1-2mdv2008.1
111
+ Revision: 176412
112
- tweak install command to pre-generate .pyo as well as .pyc files
113
- add fontclean.patch: uses the free replacement fonts (#38254)
114
- use modified tarball with non-free Odyssey translation and non-free fonts replaced (#38254)
115
- spec clean
116
117
  + Olivier Blin <oblin@mandriva.com>
118
    - restore BuildRoot
119
120
  + Thierry Vignaud <tv@mandriva.org>
121
    - kill re-definition of %%buildroot on Pixel's request
122
123
* Tue Oct 16 2007 Lev Givon <lev@mandriva.org> 2.1-1mdv2008.1
124
+ Revision: 99385
125
- Update to 2.1.
126
127
* Thu Jul 26 2007 Guillaume Rousse <guillomovitch@mandriva.org> 2.0-1mdv2008.0
128
+ Revision: 55866
129
- update to new version 2.0
130
131
132
* Tue Dec 05 2006 Michael Scherer <misc@mandriva.org> 1.19-5mdv2007.0
133
+ Revision: 91357
134
- rebuild for new python, fix file listing, as it is not a noarch package
135
136
  + Nicolas Lécureuil <neoclust@mandriva.org>
137
    - Rebuild against new python
138
    - import python-reportlab-1.19-3mdk
139

Comments