debian/0000755000000000000000000000000012201017174007161 5ustar debian/rules0000755000000000000000000000220412201014355010235 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) #export DH_RUBY_IGNORE_TESTS=all # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec %: dh $@ --buildsystem=ruby --with ruby override_dh_auto_install: # copy specs' data to data dir in order to install them correctly to run the specs cp -R spec/data/ data/spec # install manually and temporarily data mkdir -p debian/ruby-prawn/usr/share/ruby-prawn cp -R data/* debian/ruby-prawn/usr/share/ruby-prawn dh_auto_install ruby -I "debian/ruby-prawn/usr/lib/ruby/vendor_ruby" manual/manual/manual.rb # remove the copy of data in debian/ruby-prawn (will be reinstalled by dh_install) rm -rf debian/ruby-prawn/usr/share/ruby-prawn rm -rf data/spec override_dh_auto_clean: # remove the copy of spec/data in data/ rm -rf data/spec rm -f manual.pdf dh_auto_clean get-orig-source: chmod +x debian/repack.sh debian/repack.sh debian/watch0000644000000000000000000000044512146004300010210 0ustar version=3 opts=uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|b|a)\d*)$/$1~$2/,dversionmangle=s/\+(debian|dfsg|ds|deb)\d*$// \ https://github.com/prawnpdf/prawn/tags .*/v?(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) # Bart Martens Sat, 22 Dec 2012 15:33:44 +0000 debian/source/0000755000000000000000000000000012201014446010460 5ustar debian/source/format0000644000000000000000000000001411663547305011706 0ustar 3.0 (quilt) debian/ruby-prawn-doc.docs0000644000000000000000000000005211663547360012721 0ustar README.md debian/README.source manual.pdf debian/repack.sh0000755000000000000000000000462212161041714010773 0ustar #!/bin/sh # repack.sh - repacks Prawn's upstream tarball to remove embedded non-free # fonts or fonts available as Debian packages, and images with unclear # licensing. set -e DEB_UPSTREAM_VERSION=$(dpkg-parsechangelog | sed -rne 's/^Version: ([^+]+).*/\1/p') IMGDIR=prawn-$DEB_UPSTREAM_VERSION/data/images FONTDIR=prawn-$DEB_UPSTREAM_VERSION/data/fonts uscan --noconf --verbose --force-download --rename --download-current-version --destdir=. rm -rf prawn-${DEB_UPSTREAM_VERSION} # unpack upstream tarball tar -xf ruby-prawn_${DEB_UPSTREAM_VERSION}.orig.tar.gz mv prawn-* prawn-$DEB_UPSTREAM_VERSION rm ruby-prawn_${DEB_UPSTREAM_VERSION}.orig.tar.gz # delete truetype fonts and Action Man.dfont for x in $FONTDIR/*.ttf "$FONTDIR/*.dfont" do rm $x done # remove content of needed images with problematic license or without license # requires imagemagick convert $IMGDIR/pigs.jpg\ -fill white -draw "color 0,0 reset" \ -fill red -draw "rectangle 0,0 10,10" \ -fill blue -draw "rectangle 0,10 10,20" \ -fill green -draw "rectangle 10,0 20,10" \ -fill black -pointsize 18\ -draw "text 20,40 'content removed'"\ -draw "text 20,60 'Please consult README.source'"\ -draw "text 20,80 'in /usr/share/doc/ruby-prawn/'" $IMGDIR/pigs.jpg convert $IMGDIR/fractal.jpg\ -fill white -draw "color 0,0 reset" \ -fill red -draw "rectangle 0,0 10,10" \ -fill blue -draw "rectangle 0,10 10,20" \ -fill green -draw "rectangle 10,0 20,10" \ -fill black -pointsize 14\ -draw "text 20,40 'content removed'"\ -draw "text 20,55 'Please consult README.source'"\ -draw "text 20,70 'in /usr/share/doc/ruby-prawn/'" $IMGDIR/fractal.jpg convert $IMGDIR/stef.jpg\ -fill white -draw "color 0,0 reset"\ -fill black -pointsize 8\ -draw "text 0,10 'content removed'"\ -draw "text 0,20 'see README.source'"\ -draw "text 0,30 'in /usr/share/\\'"\ -draw "text 0,40 ' doc/ruby-prawn'" $IMGDIR/stef.jpg # remove images not needed for the manual and data until their license is made clear. rm -f $IMGDIR/16bit.* $IMGDIR/arrow* $IMGDIR/barcode* $IMGDIR/dice* $IMGDIR/letter* rm -f $IMGDIR/page* $IMGDIR/rails* $IMGDIR/ruport* $IMGDIR/tru256.bmp $IMGDIR/web-links* # repack the tarball mv prawn-$DEB_UPSTREAM_VERSION ruby-prawn-$DEB_UPSTREAM_VERSION.orig GZIP=--best tar -cz --owner root --group root --mode a+rX -f \ ../ruby-prawn_$DEB_UPSTREAM_VERSION+dfsg.orig.tar.gz ruby-prawn-$DEB_UPSTREAM_VERSION.orig rm -r ruby-prawn-$DEB_UPSTREAM_VERSION.orig debian/ruby-prawn-doc.doc-base0000644000000000000000000000047711663547360013461 0ustar Document: prawn-manual Title: Prawn's manual Author: Gregory Brown et al. Abstract: This manual is a collection of examples of usage of Prawn Ruby library. categorized by theme and organized from the least to the most complex. Section: Programming/Ruby Format: PDF Files: /usr/share/doc/ruby-prawn-doc/manual.pdf.gz debian/copyright0000644000000000000000000006466112146004300011124 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: prawn Source: http://www.github.com/sandal/prawn Source has been repacked to exclude embedded (free or non-free) truetype and .dfont font files, and images with unclear license statement. Two image files (pigs.jpg and stef.jpg) are kept but their content is wiped out, as they are needed for the construction of the manual and testing purpose. See README.source for details. Files: * Copyright: 2008-2011 Gregory Brown 2009-2011 Brad Ediger 2009-2011 Daniel Nelson 2011 Jonathan Greenberg 2008-2011 James Healy 2008-2009 Jamis Buck License: Ruby or GPL-2 or GPL-3 Comment: the list of all contributors to prawn can be found at https://github.com/sandal/prawn/contributors Files: lib/prawn/measurement.rb lib/prawn/measurement_extensions.rb Copyright: 2008 Florian Witteler License: Ruby or GPL-2 or GPL-3 Files: lib/prawn/document/column_box.rb Copyright: Paul Ostazeski License: Ruby or GPL-2 or GPL-3 Files: lib/prawn/document/graphics_state.rb lib/prawn/graphics/transformation.rb Copyright: 2010 Michael Witrant License: Ruby or GPL-2 or GPL-3 Files: lib/prawn/graphics/gradient.rb Copyright: 2009 Wojciech Piekutowski License: Ruby or GPL-2 or GPL-3 Files: data/fonts/*.afm Copyright: Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated License: Adobe-fonts Files: data/images/prawn.png Copyright: 2008 Richard Mason License: CC-BY-SA-3.0 Comment: http://groups.google.com/group/prawn-ruby/browse_thread/thread/257fbd9a13bdf78 Files: debian/* Copyright: 2011 Cédric Boutillier License: Ruby or GPL-2 or GPL-3 License: Ruby You can redistribute Prawn and/or modify it under either the terms of the GPLv2 or GPLv3 (see GPLv2 and GPLv3 files), or the conditions below: . 1. You may make and give away verbatim copies of the source form of the software without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. . 2. You may modify your copy of the software in any way, provided that you do at least ONE of the following: . a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or by allowing the author to include your modifications in the software. . b) use the modified software only within your corporation or organization. . c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided. . d) make other distribution arrangements with the author. . 3. You may distribute the software in object code or executable form, provided that you do at least ONE of the following: . a) distribute the executables and library files of the software, together with instructions (in the manual page or equivalent) on where to get the original distribution. . b) accompany the distribution with the machine-readable source of the software. . c) give non-standard executables non-standard names, with instructions on where to get the original software distribution. . d) make other distribution arrangements with the author. . 4. You may modify and include the part of the software into any other software (possibly commercial). . 5. The scripts and library files supplied as input to or produced as output from the software do not automatically fall under the copyright of the software, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this software. . 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. License: GPL-2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 as published by the Free Software Foundation. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. License: GPL-3 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . . On Debian systems, full text of the GPL-3 license can be found in `/usr/share/common-licenses/GPL-3' License: Adobe-fonts This file and the 14 PostScript(R) AFM files it accompanies may be used, copied, and distributed for any purpose and without charge, with or without modification, provided that all copyright notices are retained; that the AFM files are not distributed without this file; that all modifications to this file or any of the AFM files are prominently noted in the modified file(s); and that this paragraph is not modified. Adobe Systems has no responsibility or obligation to support the use of the AFM files. License: CC-BY-SA-3.0 THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. . BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. . 1. Definitions . a. "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. b. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined below) for the purposes of this License. c. "Creative Commons Compatible License" means a license that is listed at http://creativecommons.org/compatiblelicenses that has been approved by Creative Commons as being essentially equivalent to this License, including, at a minimum, because that license: (i) contains terms that have the same purpose, meaning and effect as the License Elements of this License; and, (ii) explicitly permits the relicensing of adaptations of works made available under that license under this License or a Creative Commons jurisdiction license with the same License Elements as this License. d. "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. e. "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike. f. "Licensor" means the individual, individuals, entity or entities that offer (s) the Work under the terms of this License. g. "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. h. "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. i. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. j. "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. k. "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. . 2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. . 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: . a. to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; b. to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; c. to Distribute and Publicly Perform the Work including as incorporated in Collections; and, d. to Distribute and Publicly Perform Adaptations. e. For the avoidance of doubt: . i. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; ii. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and, iii. Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License. . The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved. . 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: . a. You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested. b. You may Distribute or Publicly Perform an Adaptation only under the terms of: (i) this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible License. If you license the Adaptation under one of the licenses mentioned in (iv), you must comply with the terms of that license. If you license the Adaptation under the terms of any of the licenses mentioned in (i), (ii) or (iii) (the "Applicable License"), you must comply with the terms of the Applicable License generally and the following provisions: (I) You must include a copy of, or the URI for, the Applicable License with every copy of each Adaptation You Distribute or Publicly Perform; (II) You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License; (III) You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform; (IV) when You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License. c. If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4 (a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Ssection 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. d. Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise. . 5. Representations, Warranties and Disclaimer . UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. . 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. . 7. Termination . a. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. b. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. . 8. Miscellaneous . a. Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. b. Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. c. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. d. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. e. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. f. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. debian/control0000644000000000000000000000361012200650622010564 0ustar Source: ruby-prawn Section: ruby Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Gunnar Wolf , Cédric Boutillier Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.3.0~), coderay, ruby-rspec, ruby-pdf-inspector (>= 1.0.1~), ruby-mocha, ruby-ttfunk (>= 1.0.3), ruby-afm, fonts-dejavu-core, fonts-arphic-gkai00mp Standards-Version: 3.9.4 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-prawn.git Vcs-Browser: http://anonscm.debian.org/gitweb?p=pkg-ruby-extras/ruby-prawn.git;a=summary Homepage: http://prawn.majesticseacreature.com XS-Ruby-Versions: all Package: ruby-prawn Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter, ruby-pdf-reader (>= 0.9.0), ruby-ttfunk (>= 1.0.3), ruby-pdf-inspector (>= 1.0.1), ruby-afm Suggests: fonts-dejavu-core, fonts-arphic-gkai00mp, ruby-prawn-doc, coderay Description: Fast, nimble PDF generation library for Ruby Prawn is a PDF generation library for Ruby. Its highlights include: * Built in support for UTF-8 * Easy image embedding * Flexible table drawing * Simple content positioning, allowing for placing elements relative to their sections * Easy text flowing within and around sections Package: ruby-prawn-doc Section: doc Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: ruby-prawn, doc-base Description: Fast, nimble PDF generation library for Ruby (documentation) Prawn is a PDF generation library for Ruby. Its highlights include: * Built in support for UTF-8 * Easy image embedding * Flexible table drawing * Simple content positioning, allowing for placing elements relative to their sections * Easy text flowing within and around sections . This package contains the manual created from Prawn's source. debian/ruby-prawn.install0000644000000000000000000000021011663547360012670 0ustar # Installing data/* under /usr/share/ruby-prawn data/fonts data/images data/encodings data/shift_jis_text.txt usr/share/ruby-prawn/ debian/patches/0000755000000000000000000000000012201014053010601 5ustar debian/patches/0210_change_spec_data_to_datadir_pdfs.patch0000644000000000000000000000607512201013531020732 0ustar Description: reflect the fact that spec/data moved to data/spec The specs use some (one) pdf files stored in spec/data. In order to test the library installed in debian/ruby-prawn/, these files are moved to data/spec, so that they can be installed too (see debian/ruby-prawn.install). The code of the specs has to be modified to find correctly the files which moved away. Author: Cédric Boutillier Last-Update: 2013-08-08 --- a/spec/object_store_spec.rb +++ b/spec/object_store_spec.rb @@ -16,20 +16,20 @@ end it "should import objects from an existing PDF" do - filename = "#{Prawn::BASEDIR}/spec/data/curves.pdf" + filename = "#{Prawn::DATADIR}/spec/curves.pdf" store = Prawn::Core::ObjectStore.new(:template => filename) store.size.should == 5 end it "should point to existing roots when importing objects from an existing PDF" do - filename = "#{Prawn::BASEDIR}/spec/data/curves.pdf" + filename = "#{Prawn::DATADIR}/spec/curves.pdf" store = Prawn::Core::ObjectStore.new(:template => filename) store.info.class.should == Prawn::Core::Reference store.root.class.should == Prawn::Core::Reference end it "should initialize with pages when importing objects from an existing PDF" do - filename = "#{Prawn::BASEDIR}/spec/data/curves.pdf" + filename = "#{Prawn::DATADIR}/spec/curves.pdf" store = Prawn::Core::ObjectStore.new(:template => filename) store.pages.data[:Count].should == 1 end --- a/spec/template_spec.rb +++ b/spec/template_spec.rb @@ -2,7 +2,7 @@ describe "Document built from a template" do it "should have the same page count as the source document" do - filename = "#{Prawn::BASEDIR}/spec/data/curves.pdf" + filename = "#{Prawn::DATADIR}/spec/curves.pdf" @pdf = Prawn::Document.new(:template => filename) page_counter = PDF::Inspector::Page.analyze(@pdf.render) @@ -17,14 +17,14 @@ it "should have start with the Y cursor at the top of the document" do - filename = "#{Prawn::BASEDIR}/spec/data/curves.pdf" + filename = "#{Prawn::DATADIR}/spec/curves.pdf" @pdf = Prawn::Document.new(:template => filename) (@pdf.y == nil).should == false end it "should respect margins set by Prawn" do - filename = "#{Prawn::BASEDIR}/spec/data/curves.pdf" + filename = "#{Prawn::DATADIR}/spec/curves.pdf" @pdf = Prawn::Document.new(:template => filename, :margin => 0) @pdf.page.margins.should == { :left => 0, @@ -51,7 +51,7 @@ end it "should not add an extra restore_graphics_state operator to the end of any content stream" do - filename = "#{Prawn::BASEDIR}/spec/data/curves.pdf" + filename = "#{Prawn::DATADIR}/spec/curves.pdf" @pdf = Prawn::Document.new(:template => filename) output = StringIO.new(@pdf.render) @@ -195,7 +195,7 @@ end describe "Document#start_new_page with :template option" do - filename = "#{Prawn::BASEDIR}/spec/data/curves.pdf" + filename = "#{Prawn::DATADIR}/spec/curves.pdf" it "should set the imported page's parent to the document pages catalog" do @pdf = Prawn::Document.new() debian/patches/0205_replace_BASEDIR_data_by_DATADIR_manual.patch0000644000000000000000000002520212161274721021224 0ustar Description: define Prawn::DATADIR as the name of the directory containing data (manual) Upstream hardcoded the relative path with respect to prawn/core.rb of the directory containing data. A new constant, Prawn::DATADIR is introduced to permit using another directory, and change its name just once. The code producing the manual is patched to make use of this new constant instead of the hardcoded path Author: Cédric Boutillier Last-Update: 2011-11-15 Bug: https://github.com/sandal/prawn/pull/299 Bug: https://github.com/sandal/prawn/pull/299 --- a/manual/manual/cover.rb +++ b/manual/manual/cover.rb @@ -9,7 +9,7 @@ Prawn::Example.generate(filename) do move_down 200 - image "#{Prawn::BASEDIR}/data/images/prawn.png", + image "#{Prawn::DATADIR}/images/prawn.png", :scale => 0.9, :at => [10, cursor] --- a/manual/text/single_usage.rb +++ b/manual/text/single_usage.rb @@ -17,7 +17,7 @@ filename = File.basename(__FILE__).gsub('.rb', '.pdf') Prawn::Example.generate(filename) do # Using a TTF font file - font "#{Prawn::BASEDIR}/data/fonts/Chalkboard.ttf" do + font "#{Prawn::DATADIR}/fonts/Chalkboard.ttf" do text "Written with the Chalkboard TTF font." end move_down 20 @@ -26,7 +26,7 @@ move_down 20 # Using an DFONT font file - font "#{Prawn::BASEDIR}/data/fonts/Action Man.dfont" do + font "#{Prawn::DATADIR}/fonts/Action Man.dfont" do text "Written with the Action Man DFONT font" end move_down 20 --- a/manual/text/utf8.rb +++ b/manual/text/utf8.rb @@ -21,7 +21,7 @@ text "Let's try them with another font." move_down 20 - font("#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf") do + font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") do text "ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει." text "There you go." end --- a/manual/document_and_page_options/background.rb +++ b/manual/document_and_page_options/background.rb @@ -7,7 +7,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. example_helper])) -img = "#{Prawn::BASEDIR}/data/images/letterhead.jpg" +img = "#{Prawn::DATADIR}/images/letterhead.jpg" Prawn::Document.generate("background.pdf", :background => img, --- a/manual/example_helper.rb +++ b/manual/example_helper.rb @@ -143,11 +143,11 @@ text(extract_introduction_text(data), :inline_format => true) - kai_file = "#{Prawn::BASEDIR}/data/fonts/gkai00mp.ttf" + kai_file = "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" font_families["Kai"] = { :normal => { :file => kai_file, :font => "Kai" } } - dejavu_file = "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf" + dejavu_file = "#{Prawn::DATADIR}/fonts/DejaVuSans.ttf" font_families["DejaVu"] = { :normal => { :file => dejavu_file, :font => "DejaVu" } } --- a/manual/images/absolute_position.rb +++ b/manual/images/absolute_position.rb @@ -17,7 +17,7 @@ y_position = cursor text "The image won't go below this line of text." - image "#{Prawn::BASEDIR}/data/images/fractal.jpg", :at => [200, y_position] + image "#{Prawn::DATADIR}/images/fractal.jpg", :at => [200, y_position] text "And this line of text will go just below the previous one." end --- a/manual/images/fit.rb +++ b/manual/images/fit.rb @@ -15,7 +15,7 @@ text "Using the fit option" bounding_box([0, cursor], :width => size, :height => size) do - image "#{Prawn::BASEDIR}/data/images/pigs.jpg", :fit => [size, size] + image "#{Prawn::DATADIR}/images/pigs.jpg", :fit => [size, size] stroke_bounds end end --- a/manual/images/horizontal.rb +++ b/manual/images/horizontal.rb @@ -16,10 +16,10 @@ [:left, :center, :right].each do |position| text "Image aligned to the #{position}." - image "#{Prawn::BASEDIR}/data/images/stef.jpg", :position => position + image "#{Prawn::DATADIR}/images/stef.jpg", :position => position end text "The next image has a 50 point offset from the left boundary" - image "#{Prawn::BASEDIR}/data/images/stef.jpg", :position => 50 + image "#{Prawn::DATADIR}/images/stef.jpg", :position => 50 end end --- a/manual/images/plain_image.rb +++ b/manual/images/plain_image.rb @@ -14,5 +14,5 @@ filename = File.basename(__FILE__).gsub('.rb', '.pdf') Prawn::Example.generate(filename) do text "The image will go right below this line of text." - image "#{Prawn::BASEDIR}/data/images/pigs.jpg" + image "#{Prawn::DATADIR}/images/pigs.jpg" end --- a/manual/images/scale.rb +++ b/manual/images/scale.rb @@ -11,13 +11,13 @@ filename = File.basename(__FILE__).gsub('.rb', '.pdf') Prawn::Example.generate(filename) do text "Normal size" - image "#{Prawn::BASEDIR}/data/images/stef.jpg" + image "#{Prawn::DATADIR}/images/stef.jpg" move_down 10 text "Scaled to 50%" - image "#{Prawn::BASEDIR}/data/images/stef.jpg", :scale => 0.5 + image "#{Prawn::DATADIR}/images/stef.jpg", :scale => 0.5 move_down 10 text "Scaled to 200%" - image "#{Prawn::BASEDIR}/data/images/stef.jpg", :scale => 2 + image "#{Prawn::DATADIR}/images/stef.jpg", :scale => 2 end --- a/manual/images/vertical.rb +++ b/manual/images/vertical.rb @@ -15,13 +15,13 @@ [:top, :center, :bottom].each do |vposition| text "Image vertically aligned to the #{vposition}.", :valign => vposition - image "#{Prawn::BASEDIR}/data/images/stef.jpg", :position => 250, + image "#{Prawn::DATADIR}/images/stef.jpg", :position => 250, :vposition => vposition end text_box "The next image has a 100 point offset from the top boundary", :at => [bounds.width - 110, bounds.top - 10], :width => 100 - image "#{Prawn::BASEDIR}/data/images/stef.jpg", :position => :right, + image "#{Prawn::DATADIR}/images/stef.jpg", :position => :right, :vposition => 100 end end --- a/manual/images/width_and_height.rb +++ b/manual/images/width_and_height.rb @@ -13,13 +13,13 @@ filename = File.basename(__FILE__).gsub('.rb', '.pdf') Prawn::Example.generate(filename) do text "Scale by setting only the width" - image "#{Prawn::BASEDIR}/data/images/pigs.jpg", :width => 150 + image "#{Prawn::DATADIR}/images/pigs.jpg", :width => 150 move_down 10 text "Scale by setting only the height" - image "#{Prawn::BASEDIR}/data/images/pigs.jpg", :height => 100 + image "#{Prawn::DATADIR}/images/pigs.jpg", :height => 100 move_down 10 text "Stretch to fit the width and height provided" - image "#{Prawn::BASEDIR}/data/images/pigs.jpg", :width => 500, :height => 100 + image "#{Prawn::DATADIR}/images/pigs.jpg", :width => 500, :height => 100 end --- a/manual/table/image_cells.rb +++ b/manual/table/image_cells.rb @@ -17,7 +17,7 @@ filename = File.basename(__FILE__).gsub('.rb', '.pdf') Prawn::Example.generate(filename) do - image = "#{Prawn::BASEDIR}/data/images/prawn.png" + image = "#{Prawn::DATADIR}/images/prawn.png" table [ ["Standard image cell", {:image => image}], --- a/manual/templates/full_template.rb +++ b/manual/templates/full_template.rb @@ -11,7 +11,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. example_helper])) -filename = "#{Prawn::BASEDIR}/data/pdfs/multipage_template.pdf" +filename = "#{Prawn::DATADIR}/pdfs/multipage_template.pdf" Prawn::Example.generate("full_template.pdf", :template => filename) do go_to_page(page_count) --- a/manual/templates/page_template.rb +++ b/manual/templates/page_template.rb @@ -22,7 +22,7 @@ url = "https://github.com/sandal/prawn/raw/master/data/pdfs/form.pdf" formatted_text [{:text => url, :link => url}] - filename = "#{Prawn::BASEDIR}/data/pdfs/form.pdf" + filename = "#{Prawn::DATADIR}/pdfs/form.pdf" start_new_page(:template => filename) start_new_page(:template => filename, :template_page => 2) --- a/manual/text/fallback_fonts.rb +++ b/manual/text/fallback_fonts.rb @@ -9,11 +9,11 @@ filename = File.basename(__FILE__).gsub('.rb', '.pdf') Prawn::Example.generate(filename) do - file = "#{Prawn::BASEDIR}/data/fonts/gkai00mp.ttf" + file = "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" font_families["Kai"] = { :normal => { :file => file, :font => "Kai" } } - file = "#{Prawn::BASEDIR}/data/fonts/Action Man.dfont" + file = "#{Prawn::DATADIR}/fonts/Action Man.dfont" font_families["Action Man"] = { :normal => { :file => file, :font => "ActionMan" }, } --- a/manual/text/line_wrapping.rb +++ b/manual/text/line_wrapping.rb @@ -29,7 +29,7 @@ "nearer your destination the more you're slip#{nbsp}sliding away." move_down 20 - font("#{Prawn::BASEDIR}/data/fonts/gkai00mp.ttf", :size => 16) do + font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf", :size => 16) do long_text = "No word boundaries:\n更可怕的是,同质化竞争对手可以按照URL中后面这个ID来遍历您的DB中的内容,写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事,这样的话,你就非常被动了。更可怕的是,同质化竞争对手可以按照URL中后面这个ID来遍历您的DB中的内容,写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事,这样的话,你就非常被动了。" text long_text move_down 20 --- a/manual/text/registering_families.rb +++ b/manual/text/registering_families.rb @@ -15,7 +15,7 @@ Prawn::Example.generate(filename) do # Registering a single TTF font font_families.update("Chalkboard" => { - :normal => "#{Prawn::BASEDIR}/data/fonts/Chalkboard.ttf" + :normal => "#{Prawn::DATADIR}/fonts/Chalkboard.ttf" }) font("Chalkboard") do @@ -24,7 +24,7 @@ move_down 20 # Registering a DFONT package - font_path = "#{Prawn::BASEDIR}/data/fonts/Action Man.dfont" + font_path = "#{Prawn::DATADIR}/fonts/Action Man.dfont" font_families.update("Action Man" => { :normal => { :file => font_path, :font => "ActionMan" }, :italic => { :file => font_path, :font => "ActionMan-Italic" }, --- a/manual/text/right_to_left_text.rb +++ b/manual/text/right_to_left_text.rb @@ -16,7 +16,7 @@ # set the direction document-wide self.text_direction = :rtl - font("#{Prawn::BASEDIR}/data/fonts/gkai00mp.ttf", :size => 16) do + font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf", :size => 16) do long_text = "写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小" text long_text move_down 20 debian/patches/series0000644000000000000000000000100112161255124012021 0ustar 0100_remove_bundler_rubygems_stuff.patch 0102_simply_require_ttfunk.patch 0105_remove_rubygems_loadpath_stuff_manual.patch 0200_replace_BASEDIR_data_by_DATADIR.patch #0205_replace_BASEDIR_data_by_DATADIR_manual.patch 0210_change_spec_data_to_datadir_pdfs.patch 0300_fix_paths.patch 0400_use_system_fonts.patch 0405_use_system_fonts_manual.patch 0500_disable_tests_using_removed_files.patch #0600_add_require_date_table_cell.rb #1001_fix_encoding_in_font_spec.patch #1002_define_external_encoding_for_manual.patch debian/patches/1001_fix_encoding_in_font_spec.patch0000644000000000000000000000157012161274721017467 0ustar Description: Fix encoding of the result of a test of font_spec.rb encode_text method returns in that case a 8 bit ASCII string, not 7 bit. From: James Healy Origin: https://github.com/prawnpdf/prawn/commit/0ceab27 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676199 Bug: https: https://github.com/prawnpdf/prawn/issues/357 Last-Update: 2011-06-12 --- a/spec/font_spec.rb +++ b/spec/font_spec.rb @@ -293,8 +293,8 @@ it "should encode text without kerning by default" do @activa.encode_text("To").should == [[0, "To"]] - tele = (RUBY_VERSION < '1.9') ? "T\216l\216" : - "T\216l\216".force_encoding("US-ASCII") + tele = "T\216l\216" + tele.force_encoding("binary") if tele.respond_to?(:force_encoding) @activa.encode_text("Télé").should == [[0, tele]] @activa.encode_text("Technology").should == [[0, "Technology"]] debian/patches/0400_use_system_fonts.patch0000644000000000000000000003056712201013742015715 0ustar Description: use system fonts when possible Upstream ships embedded copies of several truetype fonts. Some of them are available in Debian. These copies have been removed from the Debian source package, and system fonts are used instead. Author: Cédric Boutillier Last-Update: 2013-08-08 --- a/spec/line_wrap_spec.rb +++ b/spec/line_wrap_spec.rb @@ -51,7 +51,7 @@ end it "should break on zero-width space" do - @pdf.font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") + @pdf.font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") array = [{ :text => "hello#{Prawn::Text::ZWSP}world" }] @arranger.format_array = array string = @line_wrap.wrap_line(:arranger => @arranger, @@ -61,7 +61,7 @@ end it "should not display zero-width space" do - @pdf.font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") + @pdf.font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") array = [{ :text => "hello#{Prawn::Text::ZWSP}world" }] @arranger.format_array = array string = @line_wrap.wrap_line(:arranger => @arranger, @@ -116,7 +116,7 @@ expected.force_encoding("utf-8") if "".respond_to?(:force_encoding) string.should == expected - @pdf.font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") + @pdf.font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") @line_wrap = Prawn::Core::Text::Formatted::LineWrap.new string = "hello#{Prawn::Text::SHY}world" @@ -137,7 +137,7 @@ :document => @pdf) string.should == "helloworld" - @pdf.font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") + @pdf.font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") @line_wrap = Prawn::Core::Text::Formatted::LineWrap.new string = "hello#{Prawn::Text::SHY}world" @@ -166,7 +166,7 @@ :document => @pdf) string.should == "hello" - @pdf.font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") + @pdf.font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") @line_wrap = Prawn::Core::Text::Formatted::LineWrap.new enough_width_for_hello_world = 68 @@ -205,7 +205,7 @@ expected.force_encoding("utf-8") if "".respond_to?(:force_encoding) string.should == expected - @pdf.font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") + @pdf.font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") @line_wrap = Prawn::Core::Text::Formatted::LineWrap.new string = "hello#{Prawn::Text::SHY}-" --- a/spec/text_spec.rb +++ b/spec/text_spec.rb @@ -261,9 +261,11 @@ lambda { @pdf.font "Pao bu" }.should raise_error(Prawn::Errors::UnknownFont) end + # replace non-free comicsans.ttf by system DejaVuSans.ttf (Debian patch) it "should_not raise_error an exception when providing Pathname instance as font" do lambda { - @pdf.font Pathname.new("#{Prawn::DATADIR}/fonts/comicsans.ttf") + # @pdf.font Pathname.new("#{Prawn::DATADIR}/fonts/comicsans.ttf") + @pdf.font Pathname.new("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") }.should_not raise_error(Prawn::Errors::UnknownFont) end @@ -278,7 +280,7 @@ it "should correctly render a utf-8 string when using a TTF font" do str = "©" # copyright symbol - @pdf.font "#{Prawn::DATADIR}/fonts/DejaVuSans.ttf" + @pdf.font "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" @pdf.text str # grab the text from the rendered PDF and ensure it matches @@ -321,7 +323,7 @@ it "should_not raise_error an exception when a shift-jis string is rendered" do datafile = "#{Prawn::DATADIR}/shift_jis_text.txt" sjis_str = File.open(datafile, "r:shift_jis") { |f| f.gets } - @pdf.font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf") + @pdf.font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf") lambda { @pdf.text sjis_str }.should_not raise_error( Prawn::Errors::IncompatibleStringEncoding) end --- a/spec/text_spacing_spec.rb +++ b/spec/text_spacing_spec.rb @@ -42,7 +42,7 @@ # it "should calculate character spacing widths by characters, not bytes" do create_pdf - @pdf.font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf") + @pdf.font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf") str = "こんにちは世界" @pdf.character_spacing(0) do --- a/spec/formatted_text_box_spec.rb +++ b/spec/formatted_text_box_spec.rb @@ -21,7 +21,7 @@ it "should_not raise_error Encoding::CompatibilityError when keeping a TTF and an " + "AFM font together" do ruby_19 do - file = "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" + file = "/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf" @pdf.font_families["Kai"] = { :normal => { :file => file, :font => "Kai" } } @@ -121,7 +121,7 @@ "a Chinese font and set of Chinese glyphs not in the current font" do it "should change the font to the Chinese font for the Chinese glyphs" do create_pdf - file = "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" + file = "/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf" @pdf.font_families["Kai"] = { :normal => { :file => file, :font => "Kai" } } @@ -149,7 +149,7 @@ "an AFM font and Win-Ansi glyph not in the current Chinese font" do it "should change the font to the AFM font for the Win-Ansi glyph" do create_pdf - file = "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" + file = "/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf" @pdf.font_families["Kai"] = { :normal => { :file => file, :font => "Kai" } } @@ -178,7 +178,7 @@ "level font" do it "should use the fragment level font except for glyphs not in that font" do create_pdf - file = "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" + file = "/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf" @pdf.font_families["Kai"] = { :normal => { :file => file, :font => "Kai" } } @@ -205,7 +205,7 @@ describe "Text::Formatted::Box" do before(:each) do create_pdf - file = "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" + file = "/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf" @pdf.font_families["Kai"] = { :normal => { :file => file, :font => "Kai" } } --- a/spec/font_spec.rb +++ b/spec/font_spec.rb @@ -24,7 +24,7 @@ it "should exclude newlines" do create_pdf # Use a TTF font that has a non-zero width for \n - @pdf.font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf") + @pdf.font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf") @pdf.width_of("\nhello world\n").should == @pdf.width_of("hello world") @@ -114,18 +114,18 @@ end it "should accept Pathname objects for font files" do - file = Pathname.new( "#{Prawn::DATADIR}/fonts/Chalkboard.ttf" ) - @pdf.font_families["Chalkboard"] = { + file = Pathname.new( "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" ) + @pdf.font_families["DejaVuSans"] = { :normal => file } - @pdf.font "Chalkboard" - @pdf.text "In Chalkboard" + @pdf.font "DejaVuSans" + @pdf.text "In DejaVuSans" text = PDF::Inspector::Text.analyze(@pdf.render) name = text.font_settings.map { |e| e[:name] }.first.to_s name = name.sub(/\w+\+/, "subset+") - name.should == "subset+Chalkboard" + name.should == "subset+DejaVuSans" end end @@ -269,15 +269,19 @@ end it "should return true when present in a TTF font" do - font = @pdf.find_font("#{Prawn::DATADIR}/fonts/Activa.ttf") + # replace non-free Activa.ttf by system DejaVuSans.ttf (Debian patch) + # font = @pdf.find_font("#{Prawn::DATADIR}/fonts/Activa.ttf") + font = @pdf.find_font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") font.glyph_present?("H").should be_true end it "should return false when absent in a TTF font" do - font = @pdf.find_font("#{Prawn::DATADIR}/fonts/Activa.ttf") + # replace non-free Activa.ttf by system DejaVuSans.ttf (Debian patch) + # font = @pdf.find_font("#{Prawn::DATADIR}/fonts/Activa.ttf") + font = @pdf.find_font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") font.glyph_present?("再").should be_false - font = @pdf.find_font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf") + font = @pdf.find_font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf") font.glyph_present?("€").should be_false end end @@ -286,7 +290,9 @@ before do create_pdf - @activa = @pdf.find_font "#{Prawn::DATADIR}/fonts/Activa.ttf" + # replace non-free Activa.ttf by system DejaVuSans.ttf (Debian patch) + # @activa = @pdf.find_font "#{Prawn::DATADIR}/fonts/Activa.ttf" + @activa = @pdf.find_font "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" end it "should calculate string width taking into account accented characters" do @@ -354,7 +360,7 @@ it "should allow TTF fonts to be used alongside document transactions" do lambda { Prawn::Document.new do - font "#{Prawn::DATADIR}/fonts/DejaVuSans.ttf" + font "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" text "Hi there" transaction { text "Nice, thank you" } end @@ -364,7 +370,7 @@ it "should allow TTF fonts to be used inside transactions" do pdf = Prawn::Document.new do transaction do - font "#{Prawn::DATADIR}/fonts/DejaVuSans.ttf" + font "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" text "Hi there" end end @@ -421,7 +427,7 @@ describe "#character_count(text)" do it "should work on TTF fonts" do create_pdf - @pdf.font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf") + @pdf.font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf") @pdf.font.character_count("こんにちは世界").should == 7 @pdf.font.character_count("Hello, world!").should == 13 end --- a/spec/text_box_spec.rb +++ b/spec/text_box_spec.rb @@ -74,7 +74,7 @@ @pdf.text_direction(:rtl) @pdf.text_direction = :rtl @pdf.text_direction = :rtl - @pdf.font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf", :size => 16) do + @pdf.font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf", :size => 16) do @pdf.text "写个小" end text = PDF::Inspector::Text.analyze(@pdf.render) @@ -831,7 +831,7 @@ :height => 162.0, :document => @pdf } - @pdf.font "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" + @pdf.font "/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf" @options[:overflow] = :truncate text_box = Prawn::Text::Box.new(@text, @options) text_box.render --- a/spec/template_spec.rb +++ b/spec/template_spec.rb @@ -148,7 +148,9 @@ it "should correctly add a TTF font to a template that has existing fonts" do filename = "#{Prawn::DATADIR}/pdfs/contains_ttf_font.pdf" @pdf = Prawn::Document.new(:template => filename) - @pdf.font "#{Prawn::DATADIR}/fonts/Chalkboard.ttf" + # replace non-free Chalkboard.ttf by system DejaVuSans.ttf (Debian patch) + # @pdf.font "#{Prawn::DATADIR}/fonts/Chalkboard.ttf" + @pdf.font "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" @pdf.move_down(40) @pdf.text "Hi There" @@ -300,7 +302,9 @@ filename = "#{Prawn::DATADIR}/pdfs/contains_ttf_font.pdf" @pdf = Prawn::Document.new() @pdf.start_new_page(:template => filename) - @pdf.font "#{Prawn::DATADIR}/fonts/Chalkboard.ttf" + # replace non-free Chalkboard.ttf by system DejaVuSans.ttf (Debian patch) + # @pdf.font "#{Prawn::DATADIR}/fonts/Chalkboard.ttf" + @pdf.font "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" @pdf.move_down(40) @pdf.text "Hi There" --- a/spec/document_spec.rb +++ b/spec/document_spec.rb @@ -235,7 +235,7 @@ doc_uncompressed = Prawn::Document.new doc_compressed = Prawn::Document.new(:compress => true) [doc_compressed, doc_uncompressed].each do |pdf| - pdf.font "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" + pdf.font "/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf" pdf.text "更可怕的是,同质化竞争对手可以按照URL中后面这个ID来遍历" * 10 end --- a/spec/text_at_spec.rb +++ b/spec/text_at_spec.rb @@ -109,7 +109,7 @@ it "should_not raise_error an exception when a shift-jis string is rendered" do datafile = "#{Prawn::DATADIR}/shift_jis_text.txt" sjis_str = File.open(datafile, "r:shift_jis") { |f| f.gets } - @pdf.font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf") + @pdf.font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf") lambda { @pdf.draw_text(sjis_str, :at => [0, 0]) }.should_not raise_error( Prawn::Errors::IncompatibleStringEncoding) end debian/patches/0100_remove_bundler_rubygems_stuff.patch0000644000000000000000000000100112161274721020425 0ustar Description: remove rubygems and bundler stuff from specs Author: Cédric Boutillier Last-Update: 2013-06-22 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,10 +2,10 @@ puts "Prawn specs: Running on Ruby Version: #{RUBY_VERSION}" -require "bundler" -Bundler.setup +#require "bundler" +#Bundler.setup -$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib') +#$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib') require "prawn" Prawn.debug = true debian/patches/0200_replace_BASEDIR_data_by_DATADIR.patch0000644000000000000000000000142312161274721017661 0ustar Description: redefine BASEDIR and DATADIR Author: Cédric Boutillier Last-Update: 2013-06-22 --- a/lib/prawn/core.rb +++ b/lib/prawn/core.rb @@ -18,8 +18,10 @@ # The base source directory for Prawn as installed on the system # # - BASEDIR = File.expand_path(File.join(dir, '..','..')) - DATADIR = File.expand_path(File.join(dir, '..', '..', 'data')) + BASEDIR = File.expand_path(File.join(dir, '..')) + # Definition of a data directory that may be not in BASEDIR/data (Debian patch) + # /usr/lib/ruby/vendor_ruby/prawn -> /usr/share/ruby-prawn/ + DATADIR = File.expand_path(File.join(dir, '..', '..', '..', '..', 'share', 'ruby-prawn')) # Whe set to true, Prawn will verify hash options to ensure only valid keys # are used. Off by default. debian/patches/0300_fix_paths.patch0000644000000000000000000000102312161274721014264 0ustar Description: fix fonts path to use only prawn's fonts directory Author: Cédric Boutillier Last-Update: 2013-06-22 --- a/lib/prawn/font/afm.rb +++ b/lib/prawn/font/afm.rb @@ -26,9 +26,7 @@ @metrics_path ||= m.split(':') else @metrics_path ||= [ - ".", "/usr/lib/afm", - "/usr/local/lib/afm", - "/usr/openwin/lib/fonts/afm", + # use Prawn's font directories (Debian patch) Prawn::DATADIR+'/fonts'] end end debian/patches/0105_remove_rubygems_loadpath_stuff_manual.patch0000644000000000000000000000071012161274721022136 0ustar Description: remove LOAD_PATH manipulation from manual sources Author: Cédric Boutillier Last-Update: 2013-06-22 --- a/manual/example_helper.rb +++ b/manual/example_helper.rb @@ -3,7 +3,7 @@ # Helper for organizing examples # -$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) +#$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'prawn' require 'prawn/security' require 'prawn/layout' debian/patches/0600_add_require_date_table_cell.rb0000644000000000000000000000075511663547360017260 0ustar Description: add missing require 'date' statement The file lib/prawn/table/cell.rb uses the test .kind_of?(Date) but the class Date is not defined. Bug: https://github.com/sandal/prawn/issues/298 Author: Cédric Boutillier Last-Update: 2011-11-22 --- a/lib/prawn/table/cell.rb +++ b/lib/prawn/table/cell.rb @@ -6,6 +6,8 @@ # # This is free software. Please see the LICENSE and COPYING files for details. +require "date" + module Prawn class Document debian/patches/1002_define_external_encoding_for_manual.patch0000644000000000000000000000110712161274721021507 0ustar Description: Set default external encoding with Ruby 1.9 for the manual This is needed to successfully build the manual on systems with non unicode locale Author: Cédric Boutillier Bug: https://github.com/prawnpdf/prawn/pull/358 Last-Update: 2012-06-12 --- a/manual/manual/manual.rb +++ b/manual/manual/manual.rb @@ -2,6 +2,8 @@ # # Generates the Prawn by example manual. # +Encoding.default_external = "UTF-8" if defined? Encoding + require File.expand_path(File.join(File.dirname(__FILE__), %w[.. example_helper])) debian/patches/0405_use_system_fonts_manual.patch0000644000000000000000000002160412200634713017255 0ustar Description: use system fonts when possible Upstream ships embedded copies of several truetype fonts. Some are available in Debian. These copies have been removed from the Debian source package, and system fonts are used instead. Author: Cédric Boutillier Last-Update: 2013-06-22 --- a/manual/text/single_usage.rb +++ b/manual/text/single_usage.rb @@ -19,19 +19,21 @@ filename = File.basename(__FILE__).gsub('.rb', '.pdf') Prawn::Example.generate(filename) do # Using a TTF font file - font("#{Prawn::DATADIR}/fonts/Chalkboard.ttf") do - text "Written with the Chalkboard TTF font." + # Debian: non-free Chalkboard replaced by system DejaVuSans" + font "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" do + text "Written with the DejaVuSans TTF font." end move_down 20 text "Written with the default font." move_down 20 - # Using an DFONT font file - font("#{Prawn::DATADIR}/fonts/Action Man.dfont") do - text "Written with the Action Man DFONT font" - end - move_down 20 +# # Using an DFONT font file +# # Debian: deactivated, because using non-free font removed from the Debian package +# font("#{Prawn::DATADIR}/fonts/Action Man.dfont") do +# text "Written with the Action Man DFONT font" +# end +# move_down 20 text "Written with the default font once more." end --- a/manual/text/utf8.rb +++ b/manual/text/utf8.rb @@ -21,7 +21,7 @@ text "Let's try them with another font." move_down 20 - font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") do + font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") do text "ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει." text "There you go." end --- a/manual/text/line_wrapping.rb +++ b/manual/text/line_wrapping.rb @@ -29,7 +29,7 @@ "nearer your destination the more you're slip#{nbsp}sliding away." move_down 20 - font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf", :size => 16) do + font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf", :size => 16) do long_text = "No word boundaries:\n更可怕的是,同质化竞争对手可以按照URL中后面这个ID来遍历您的DB中的内容,写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事,这样的话,你就非常被动了。更可怕的是,同质化竞争对手可以按照URL中后面这个ID来遍历您的DB中的内容,写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事,这样的话,你就非常被动了。" text long_text move_down 20 --- a/manual/text/right_to_left_text.rb +++ b/manual/text/right_to_left_text.rb @@ -17,7 +17,7 @@ # set the direction document-wide self.text_direction = :rtl - font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf", :size => 16) do + font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf", :size => 16) do long_text = "写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小" text long_text move_down 20 --- a/manual/example_helper.rb +++ b/manual/example_helper.rb @@ -172,12 +172,12 @@ # Register fonts used on the manual # def register_fonts - kai_file = "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" + kai_file = "/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf" font_families["Kai"] = { :normal => { :file => kai_file, :font => "Kai" } } - dejavu_file = "#{Prawn::DATADIR}/fonts/DejaVuSans.ttf" + dejavu_file = "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" font_families["DejaVu"] = { :normal => { :file => dejavu_file, :font => "DejaVu" } } --- a/manual/text/fallback_fonts.rb +++ b/manual/text/fallback_fonts.rb @@ -4,34 +4,36 @@ # be present in the desired font. Use the :fallback_fonts option # with any of the text or text box methods, or set fallback_fonts document-wide. # +# The result of this example is not included because requires non-free fonts, +# removed from the Debian package. require File.expand_path(File.join(File.dirname(__FILE__), %w[.. example_helper])) filename = File.basename(__FILE__).gsub('.rb', '.pdf') Prawn::Example.generate(filename) do - file = "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" - font_families["Kai"] = { - :normal => { :file => file, :font => "Kai" } - } - - file = "#{Prawn::DATADIR}/fonts/Action Man.dfont" - font_families["Action Man"] = { - :normal => { :file => file, :font => "ActionMan" }, - } - - font("Action Man") do - text("When fallback fonts are included, each glyph will be rendered " + - "using the first font that includes the glyph, starting with the " + - "current font and then moving through the fallback fonts from left " + - "to right." + - "\n\n" + - "hello ƒ 你好\n再见 ƒ goodbye", - :fallback_fonts => ["Times-Roman", "Kai"]) - end - move_down 20 +# file = "#{Prawn::DATADIR}/fonts/gkai00mp.ttf" +# font_families["Kai"] = { +# :normal => { :file => file, :font => "Kai" } +# } +# +# file = "#{Prawn::DATADIR}/fonts/Action Man.dfont" +# font_families["Action Man"] = { +# :normal => { :file => file, :font => "ActionMan" }, +# } +# +# font("Action Man") do +# text("When fallback fonts are included, each glyph will be rendered " + +# "using the first font that includes the glyph, starting with the " + +# "current font and then moving through the fallback fonts from left " + +# "to right." + +# "\n\n" + +# "hello ƒ 你好\n再见 ƒ goodbye", +# :fallback_fonts => ["Times-Roman", "Kai"]) +# end +# move_down 20 - formatted_text([ { :text => "Fallback fonts can even override" }, - { :text => "fragment fonts (你好)", :font => "Times-Roman" }, - ], - :fallback_fonts => ["Times-Roman", "Kai"]) +# formatted_text([ { :text => "Fallback fonts can even override" }, +# { :text => "fragment fonts (你好)", :font => "Times-Roman" }, +# ], +# :fallback_fonts => ["Times-Roman", "Kai"]) end --- a/manual/text/registering_families.rb +++ b/manual/text/registering_families.rb @@ -8,41 +8,44 @@ # To register a font family update the font_families # hash with the font path for each style you want to use. # +# The result of this example is not included because requires non-free fonts, +# removed from the Debian package. +# require File.expand_path(File.join(File.dirname(__FILE__), %w[.. example_helper])) filename = File.basename(__FILE__).gsub('.rb', '.pdf') Prawn::Example.generate(filename) do - # Registering a single TTF font - font_families.update("Chalkboard" => { - :normal => "#{Prawn::DATADIR}/fonts/Chalkboard.ttf" - }) - - font("Chalkboard") do - text "Using the Chalkboard font providing only its name to the font method" - end - move_down 20 - - # Registering a DFONT package - font_path = "#{Prawn::DATADIR}/fonts/Action Man.dfont" - font_families.update("Action Man" => { - :normal => { :file => font_path, :font => "ActionMan" }, - :italic => { :file => font_path, :font => "ActionMan-Italic" }, - :bold => { :file => font_path, :font => "ActionMan-Bold" }, - :bold_italic => { :file => font_path, :font => "ActionMan-BoldItalic" } - }) - - font "Action Man" - text "Also using the Action Man by providing only its name" - move_down 20 - - text "Taking advantage of the inline formatting", - :inline_format => true - move_down 20 - - [:bold, :bold_italic, :italic, :normal].each do |style| - text "Using the #{style} style option.", - :style => style - move_down 10 - end +# # Registering a single TTF font +# font_families.update("Chalkboard" => { +# :normal => "#{Prawn::DATADIR}/fonts/Chalkboard.ttf" +# }) +# +# font("Chalkboard") do +# text "Using the Chalkboard font providing only its name to the font method" +# end +# move_down 20 +# +# # Registering a DFONT package +# font_path = "#{Prawn::DATADIR}/fonts/Action Man.dfont" +# font_families.update("Action Man" => { +# :normal => { :file => font_path, :font => "ActionMan" }, +# :italic => { :file => font_path, :font => "ActionMan-Italic" }, +# :bold => { :file => font_path, :font => "ActionMan-Bold" }, +# :bold_italic => { :file => font_path, :font => "ActionMan-BoldItalic" } +# }) +# +# font "Action Man" +# text "Also using the Action Man by providing only its name" +# move_down 20 +# +# text "Taking advantage of the inline formatting", +# :inline_format => true +# move_down 20 +# +# [:bold, :bold_italic, :italic, :normal].each do |style| +# text "Using the #{style} style option.", +# :style => style +# move_down 10 +# end end debian/patches/0102_simply_require_ttfunk.patch0000644000000000000000000000140512161274721016747 0ustar Description: replace complicated statements by a simple require 'ttfunk' ttfunk is available as a Debian package. We do not need $LOAD_PATH manipulations and rescues to load this library. Author: Cédric Boutillier Last-Update: 2011-11-24 --- a/lib/prawn/core.rb +++ b/lib/prawn/core.rb @@ -6,19 +6,7 @@ # This is free software. Please see the LICENSE and COPYING files for details. require "set" - -%w[ttfunk/lib].each do |dep| - $LOAD_PATH.unshift(File.dirname(__FILE__) + "/../../vendor/#{dep}") -end - -begin - require 'ttfunk' -rescue LoadError - puts "Failed to load ttfunk. If you are running Prawn from git:" - puts " git submodule init" - puts " git submodule update" - exit -end +require 'ttfunk' module Prawn extend self debian/patches/0500_disable_tests_using_removed_files.patch0000644000000000000000000003202512201014053021225 0ustar Description: disable some specs after removal of some files from the source package Some specs are using for the moment images with unclear license and/or non-free fonts. These are disabled because they cannot be run since these files have been removed from the Debian source package. Author: Cédric Boutillier Last-Update: 2013-08-08 --- a/spec/font_spec.rb +++ b/spec/font_spec.rb @@ -95,7 +95,8 @@ :Courier, :Helvetica] end - it "should allow font familes to be defined in a single dfont" do + # spec disabled because Action Man.dfont is non free and cannot be distributed in Debian's package (Debian patch) + xit "should allow font familes to be defined in a single dfont" do file = "#{Prawn::DATADIR}/fonts/Action Man.dfont" @pdf.font_families["Action Man"] = { :normal => { :file => file, :font => "ActionMan" }, @@ -299,7 +300,8 @@ @activa.compute_width_of("é", :size => 12).should == @activa.compute_width_of("e", :size => 12) end - it "should calculate string width taking into account kerning pairs" do + # spec disabled since relies on numeric values for a particular font, which has been removed (Debian patch) + xit "should calculate string width taking into account kerning pairs" do @activa.compute_width_of("To", :size => 12).should == 15.228 @activa.compute_width_of("To", :size => 12, :kerning => true).should == 12.996 end @@ -318,7 +320,8 @@ @activa.encode_text("Teχnology...").should == [[0, "Te"], [1, "!"], [0, "nology..."]] end - it "should encode text with kerning if requested" do + # spec disabled since relies on numeric values for a particular font, which has been removed (Debian patch) + xit "should encode text with kerning if requested" do @activa.encode_text("To", :kerning => true).should == [[0, ["T", 186.0, "o"]]] @activa.encode_text("To", :kerning => true).should == [[0, ["T", 186.0, "o"]]] @activa.encode_text("Technology", :kerning => true).should == [[0, ["T", 186.0, "echnology"]]] @@ -326,7 +329,8 @@ @activa.encode_text("Teχnology...", :kerning => true).should == [[0, ["T", 186.0, "e"]], [1, "!"], [0, ["nology", 88.0, "..."]]] end - it "should use the ascender, descender, and cap height from the TTF verbatim" do + # spec disabled since relies on numeric values for a particular font, which has been removed (Debian patch) + xit "should use the ascender, descender, and cap height from the TTF verbatim" do # These metrics are relative to the font's own bbox. They should not be # scaled with font size. ref = @pdf.ref!({}) @@ -391,31 +395,37 @@ @file = "#{Prawn::DATADIR}/fonts/Action Man.dfont" end - it "should list all named fonts" do + # spec disabled because Action Man.dfont is non free and cannot be distributed in Debian's package (Debian patch) + xit "should list all named fonts" do list = Prawn::Font::DFont.named_fonts(@file) list.sort.should == %w(ActionMan ActionMan-Italic ActionMan-Bold ActionMan-BoldItalic).sort end - it "should count the number of fonts in the file" do + # spec disabled because Action Man.dfont is non free and cannot be distributed in Debian's package (Debian patch) + xit "should count the number of fonts in the file" do Prawn::Font::DFont.font_count(@file).should == 4 end - it "should default selected font to the first one if not specified" do + # spec disabled because Action Man.dfont is non free and cannot be distributed in Debian's package (Debian patch) + xit "should default selected font to the first one if not specified" do font = @pdf.find_font(@file) font.basename.should == "ActionMan" end - it "should allow font to be selected by index" do + # spec disabled because Action Man.dfont is non free and cannot be distributed in Debian's package (Debian patch) + xit "should allow font to be selected by index" do font = @pdf.find_font(@file, :font => 2) font.basename.should == "ActionMan-Italic" end - it "should allow font to be selected by name" do + # spec disabled because Action Man.dfont is non free and cannot be distributed in Debian's package (Debian patch) + xit "should allow font to be selected by name" do font = @pdf.find_font(@file, :font => "ActionMan-BoldItalic") font.basename.should == "ActionMan-BoldItalic" end - it "should cache font object based on selected font" do + # spec disabled because Action Man.dfont is non free and cannot be distributed in Debian's package (Debian patch) + xit "should cache font object based on selected font" do f1 = @pdf.find_font(@file, :font => "ActionMan") f2 = @pdf.find_font(@file, :font => "ActionMan-Bold") f2.object_id.should_not == f1.object_id --- a/spec/text_box_spec.rb +++ b/spec/text_box_spec.rb @@ -658,12 +658,12 @@ @text_box = Prawn::Text::Box.new(@text, options) end describe "when using a TTF font" do - it "unprinted text should be in UTF-8 encoding" do + xit "unprinted text should be in UTF-8 encoding" do @pdf.font("Action Man") remaining_text = @text_box.render remaining_text.should == @text end - it "subsequent calls to Text::Box need not include the" + + xit "subsequent calls to Text::Box need not include the" + " :skip_encoding => true option" do @pdf.font("Action Man") remaining_text = @text_box.render --- a/spec/jpg_spec.rb +++ b/spec/jpg_spec.rb @@ -12,7 +12,7 @@ @filename = "#{Prawn::DATADIR}/images/pigs.jpg" @img_data = File.open(@filename, "rb") { |f| f.read } end - + it "should read the basic attributes correctly" do jpg = Prawn::Images::JPG.new(@img_data) --- a/spec/images_spec.rb +++ b/spec/images_spec.rb @@ -52,16 +52,19 @@ end it "should raise_error an UnsupportedImageType if passed a BMP" do + pending "spec disabled since tru256.bmp removed from source package (Debian patch)" filename = "#{Prawn::DATADIR}/images/tru256.bmp" lambda { @pdf.image filename, :at => [100,100] }.should raise_error(Prawn::Errors::UnsupportedImageType) end it "should raise_error an UnsupportedImageType if passed an interlaced PNG" do + pending "spec disabled since dice_interlaced.png removed from source package (Debian patch)" filename = "#{Prawn::DATADIR}/images/dice_interlaced.png" lambda { @pdf.image filename, :at => [100,100] }.should raise_error(Prawn::Errors::UnsupportedImageType) end it "should bump PDF version to 1.5 or greater on embedding 16-bit PNGs" do + pending "spec disabled since 16bit.png removed from source package (Debian patch)" @pdf.image "#{Prawn::DATADIR}/images/16bit.png" @pdf.state.version.should >= 1.5 end @@ -70,7 +73,8 @@ # channels. Verified experimentally [BE] but not confirmed in documentation # or anything. OS X Preview handles those files just fine. # - it "should embed 8-bit alpha channels for 16-bit PNGs" do + # spec disabled since 16bit.png removed from source package (Debian patch) + xit "should embed 8-bit alpha channels for 16-bit PNGs" do @pdf.image "#{Prawn::DATADIR}/images/16bit.png" output = @pdf.render --- a/spec/object_store_spec.rb +++ b/spec/object_store_spec.rb @@ -46,8 +46,9 @@ lambda { Prawn::Core::ObjectStore.new(:template => filename) }.should raise_error(ArgumentError) end + # replace dice.png by pigs.jpg as dice.png has been removed from the source package. (Debian patch) it "should raise_error Prawn::Errors::TemplateError when given a non PDF as a template" do - filename = "#{Prawn::DATADIR}/images/dice.png" + filename = "#{Prawn::DATADIR}/images/pigs.jpg" lambda { Prawn::Core::ObjectStore.new(:template => filename) }.should raise_error(Prawn::Errors::TemplateError) end --- a/spec/png_spec.rb +++ b/spec/png_spec.rb @@ -17,7 +17,7 @@ @img_data = File.binread(@filename) end - it "should read the attributes from the header chunk correctly" do + xit "should read the attributes from the header chunk correctly" do png = Prawn::Images::PNG.new(@img_data) png.width.should == 21 @@ -29,7 +29,7 @@ png.interlace_method.should == 0 end - it "should read the image data chunk correctly" do + xit "should read the image data chunk correctly" do png = Prawn::Images::PNG.new(@img_data) data = File.binread(@data_filename) png.img_data.should == data @@ -47,7 +47,7 @@ # that indicates the color that should be interpreted as transparent. # # http://www.w3.org/TR/PNG/#11tRNS - it "should read the tRNS chunk correctly" do + xit "should read the tRNS chunk correctly" do png = Prawn::Images::PNG.new(@img_data) png.transparency[:grayscale].should == 255 end @@ -61,7 +61,7 @@ @img_data = File.binread(@filename) end - it "should read the attributes from the header chunk correctly" do + xit "should read the attributes from the header chunk correctly" do png = Prawn::Images::PNG.new(@img_data) png.width.should == 258 @@ -73,7 +73,7 @@ png.interlace_method.should == 0 end - it "should read the image data chunk correctly" do + xit "should read the image data chunk correctly" do png = Prawn::Images::PNG.new(@img_data) data = File.binread(@data_filename) png.img_data.should == data @@ -92,7 +92,7 @@ # case it's green. # # http://www.w3.org/TR/PNG/#11tRNS - it "should read the tRNS chunk correctly" do + xit "should read the tRNS chunk correctly" do png = Prawn::Images::PNG.new(@img_data) png.transparency[:rgb].should == [0, 255, 0] end @@ -108,7 +108,7 @@ @img_data = File.binread(@filename) end - it "should read the attributes from the header chunk correctly" do + xit "should read the attributes from the header chunk correctly" do png = Prawn::Images::PNG.new(@img_data) png.width.should == 50 @@ -120,7 +120,7 @@ png.interlace_method.should == 0 end - it "should read the image data chunk correctly" do + xit "should read the image data chunk correctly" do png = Prawn::Images::PNG.new(@img_data) data = File.binread(@data_filename) png.img_data.should == data @@ -136,7 +136,7 @@ @img_data = File.binread(@filename) end - it "should read the attributes from the header chunk correctly" do + xit "should read the attributes from the header chunk correctly" do png = Prawn::Images::PNG.new(@img_data) png.width.should == 16 @@ -148,14 +148,14 @@ png.interlace_method.should == 0 end - it "should correctly return the raw image data (with no alpha channel) from the image data chunk" do + xit "should correctly return the raw image data (with no alpha channel) from the image data chunk" do png = Prawn::Images::PNG.new(@img_data) png.split_alpha_channel! data = File.binread(@data_filename) png.img_data.should == data end - it "should correctly extract the alpha channel data from the image data chunk" do + xit "should correctly extract the alpha channel data from the image data chunk" do png = Prawn::Images::PNG.new(@img_data) png.split_alpha_channel! data = File.binread(@alpha_data_filename) @@ -172,7 +172,7 @@ @img_data = File.binread(@filename) end - it "should read the attributes from the header chunk correctly" do + xit "should read the attributes from the header chunk correctly" do png = Prawn::Images::PNG.new(@img_data) png.width.should == 320 @@ -184,7 +184,7 @@ png.interlace_method.should == 0 end - it "should correctly return the raw image data (with no alpha channel) from the image data chunk" do + xit "should correctly return the raw image data (with no alpha channel) from the image data chunk" do png = Prawn::Images::PNG.new(@img_data) png.split_alpha_channel! data = File.binread(@data_filename) @@ -194,7 +194,7 @@ Zlib::Inflate.inflate(png.img_data).should == Zlib::Inflate.inflate(data) end - it "should correctly extract the alpha channel data from the image data chunk" do + xit "should correctly extract the alpha channel data from the image data chunk" do png = Prawn::Images::PNG.new(@img_data) png.split_alpha_channel! data = File.binread(@alpha_data_filename) @@ -212,7 +212,7 @@ @img_data = File.binread(@filename) end - it "should read the attributes from the header chunk correctly" do + xit "should read the attributes from the header chunk correctly" do png = Prawn::Images::PNG.new(@img_data) png.width.should == 32 @@ -224,14 +224,14 @@ png.interlace_method.should == 0 end - it "should correctly return the raw image data (with no alpha channel) from the image data chunk" do + xit "should correctly return the raw image data (with no alpha channel) from the image data chunk" do png = Prawn::Images::PNG.new(@img_data) png.split_alpha_channel! data = File.binread(@data_filename) png.img_data.should == data end - it "should correctly extract the alpha channel data from the image data chunk" do + xit "should correctly extract the alpha channel data from the image data chunk" do png = Prawn::Images::PNG.new(@img_data) png.split_alpha_channel! data = File.binread(@alpha_data_filename) debian/compat0000644000000000000000000000000211663547305010376 0ustar 7 debian/README.source0000644000000000000000000000321011663547360011354 0ustar This package uses the Debian 3.0 (quilt) source package format. The source has been repacked to comply to Debian Free Software Guidelines: - files removed because they are non-free fonts: data/fonts/Activa.ttf data/fonts/Action Man.dfont data/fonts/Chalkboard.ttf data/fonts/comicsans.ttf - files removed because they are available in Debian packages: data/fonts/DejaVuSans.ttf (ttf-dejavu-core) data/fonts/Dustismo_Roman.ttf (fonts-dustin) data/fonts/gkai00mp.ttf (fonts-arphic-gkai00mp) - image and data files removed because their license is not specified, or they are non-free data/images/16bit.alpha data/images/16bit.dat data/images/16bit.png data/images/arrow2.png data/images/arrow.png data/images/barcode_issue.png data/images/dice.alpha data/images/dice.dat data/images/dice_interlaced.png data/images/dice.png data/images/letterhead.jpg data/images/page_white_text.alpha data/images/page_white_text.dat data/images/page_white_text.png data/images/prawn.png data/images/rails.dat data/images/rails.png data/images/ruport_data.dat data/images/ruport.png data/images/ruport_transparent.png data/images/ruport_type0.png data/images/tru256.bmp data/images/web-links.dat data/images/web-links.png - image files with content removed and replaced because their license is not specified, but are needed for testing the library and building the manual data/images/fractal.jpg data/images/pigs.jpg data/images/stef.jpg These operations are done automatically by the script debian/repack.sh, called in the get-orig-source: target in debian/rules Cédric Boutillier Last update: 2011-11-24 debian/ruby-prawn.docs0000644000000000000000000000003711663547360012161 0ustar README.md debian/README.source debian/changelog0000644000000000000000000001034012201016472011031 0ustar ruby-prawn (1.0.0~rc2+dfsg-1) unstable; urgency=low * Imported Upstream version 1.0.0~rc2+dfsg * debian/control: + remove obsolete DM-Upload-Allowed flag + use canonical URI in Vcs-* fields + update my email address + bump Standards-Version to 3.9.4 (no changes needed) + drop transitional packages + build-depend on coderay, rename ttf-dejavu-core dependency to fonts-dejavu-core * debian/copyright: use DEP5 copyright-format/1.0 official URL for Format field * debian/repack: base directory of the tarball renamed; use simply +dfsg suffix * debian/patches: + refresh patches + update dejavu font path in 040* patches * Update debian/watch. Thanks Bart Martens * Use ruby-tests.rb to run tests * Remove lintian-overrides, about transitional packages -- Cédric Boutillier Fri, 09 Aug 2013 00:19:56 +0200 ruby-prawn (1.0.0~rc1+dfsg1-3) unstable; urgency=low * Bump build dependency on gem2deb to >= 0.3.0~ -- Cédric Boutillier Tue, 26 Jun 2012 14:50:27 +0200 ruby-prawn (1.0.0~rc1+dfsg1-2) unstable; urgency=low * debian/patches: + add 1001_fix_encoding_in_font_spec.patch Change the encoding with Ruby 1.9 of a string used for comparison in font_spec.rb (Closes: #676199) + add 1002_define_external_encoding_for_manual.patch Set external encoding to successfully build the manual on systems with non Unicode locale * Move debian/source.lintian-overrides to d/source/lintian-overrides * Bump Standards-version to 3.9.3 (no changes needed) -- Cédric Boutillier Tue, 12 Jun 2012 22:54:27 +0200 ruby-prawn (1.0.0~rc1+dfsg1-1) unstable; urgency=low * Packaging with gem2deb + renaming source and binary packages * Bump Standards-version to 3.9.2 * Add debian/repack.sh script to remove unwanted fonts and images (Closes: #631276) * Disable several specs requiring removed data files * Build Prawn's manual and register in doc-base (ruby-prawn-doc package) * Add lintian overrides for duplicate descriptions of transition packages * Add myself as an uploader -- Cédric Boutillier Mon, 24 Oct 2011 18:47:19 +0200 libprawn-ruby (0.9.1+dfsg2-1) unstable; urgency=low * New +dfsg version, no longer including non-free fonts (Closes: #592915) * Standards-version: 3.8.4 → 3.9.1.0 (No changes needed) -- Gunnar Wolf Fri, 13 Aug 2010 16:16:36 -0500 libprawn-ruby (0.9.1+dfsg-1) unstable; urgency=low [ Paul van Tilburg ] * debian/watch: small fix to keep PET happy. [ Gunnar Wolf ] * New upstream release * Standards-version 3.8.3→3.8.4 (no changes) * Dropped the generated ruby1.9 binary package in favor of the ruby1.9.1 one; bumping up the build-dependency on ruby-pkg-tools accordingly (Closes: #569880) -- Gunnar Wolf Fri, 09 Apr 2010 18:21:04 -0500 libprawn-ruby (0.7.1+dfsg-1) unstable; urgency=low * New upstream release -- Gunnar Wolf Mon, 04 Jan 2010 11:17:49 -0600 libprawn-ruby (0.6.3+dfsg-2) unstable; urgency=low * Added a (very!) simple redirection allowing for API stability, requiring "prawn/core" when only "prawn" is requested -- Gunnar Wolf Fri, 27 Nov 2009 13:28:26 -0600 libprawn-ruby (0.6.3+dfsg-1) unstable; urgency=low [ Ryan Niebur ] * fixed long description (Closes: #542457) [ Gunnar Wolf ] * Pointing debian/watch to githubredir instead of rubyforge, as new upstream versions have not been noticed :-/ * New upstream release * Switched to 3.0 (quilt) source format; documenting the origin of the three orig.tar.gz files in README.source * The (so far only) patch is documented following the DEP3 guidelines -- Gunnar Wolf Tue, 24 Nov 2009 17:06:18 -0600 libprawn-ruby (0.4.1+dfsg-2) unstable; urgency=low * add build dep on ruby 1.9 (Closes: #543035) * Add myself to Uploaders * Debian Policy 3.8.3 * add README.source -- Ryan Niebur Sun, 23 Aug 2009 11:25:23 -0700 libprawn-ruby (0.4.1+dfsg-1) unstable; urgency=low * Initial upload (Closes: #532796) -- Gunnar Wolf Tue, 30 Jun 2009 17:35:16 -0500 debian/ruby-tests.rb0000644000000000000000000000020012201005627011617 0ustar require "rspec/autorun" $LOAD_PATH.delete(File.expand_path("../../lib",__FILE__)) Dir['spec/*_spec.rb'].each { |f| require f }