pdffonts 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +1 -0
- data/bin/pdffonts +33 -0
- data/pdffonts.gemspec +21 -0
- metadata +92 -0
    
        data/.gitignore
    ADDED
    
    
    
        data/Gemfile
    ADDED
    
    
    
        data/LICENSE.txt
    ADDED
    
    | @@ -0,0 +1,22 @@ | |
| 1 | 
            +
            Copyright (c) 2013 Pete Nicholls
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            MIT License
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            Permission is hereby granted, free of charge, to any person obtaining
         | 
| 6 | 
            +
            a copy of this software and associated documentation files (the
         | 
| 7 | 
            +
            "Software"), to deal in the Software without restriction, including
         | 
| 8 | 
            +
            without limitation the rights to use, copy, modify, merge, publish,
         | 
| 9 | 
            +
            distribute, sublicense, and/or sell copies of the Software, and to
         | 
| 10 | 
            +
            permit persons to whom the Software is furnished to do so, subject to
         | 
| 11 | 
            +
            the following conditions:
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            The above copyright notice and this permission notice shall be
         | 
| 14 | 
            +
            included in all copies or substantial portions of the Software.
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
         | 
| 17 | 
            +
            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
         | 
| 18 | 
            +
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
         | 
| 19 | 
            +
            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
         | 
| 20 | 
            +
            LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
         | 
| 21 | 
            +
            OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
         | 
| 22 | 
            +
            WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         | 
    
        data/README.md
    ADDED
    
    | @@ -0,0 +1,31 @@ | |
| 1 | 
            +
            # pdffonts
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            A command-line tool to display fonts embedded inside PDF documents.
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            ## Installation
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                $ gem install pdffonts
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            ## Usage
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                $ pdffonts beautiful_type.pdf
         | 
| 12 | 
            +
                Avenir-Black
         | 
| 13 | 
            +
                Avenir-Medium
         | 
| 14 | 
            +
                Avenir-Roman
         | 
| 15 | 
            +
                AvenirNext-DemiBold
         | 
| 16 | 
            +
                GearedSlab-Extrabold
         | 
| 17 | 
            +
                Impact
         | 
| 18 | 
            +
                Lavanderia-Sturdy
         | 
| 19 | 
            +
                LucidaGrande
         | 
| 20 | 
            +
                LucidaGrande-Bold
         | 
| 21 | 
            +
                Mission-Script
         | 
| 22 | 
            +
                ZapfDingbatsITC
         | 
| 23 | 
            +
             | 
| 24 | 
            +
             | 
| 25 | 
            +
            ## Contributing
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            1. Fork it
         | 
| 28 | 
            +
            2. Create your feature branch (`git checkout -b my-new-feature`)
         | 
| 29 | 
            +
            3. Commit your changes (`git commit -am 'Add some feature'`)
         | 
| 30 | 
            +
            4. Push to the branch (`git push origin my-new-feature`)
         | 
| 31 | 
            +
            5. Create new Pull Request
         | 
    
        data/Rakefile
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            require "bundler/gem_tasks"
         | 
    
        data/bin/pdffonts
    ADDED
    
    | @@ -0,0 +1,33 @@ | |
| 1 | 
            +
            #!/usr/bin/env ruby
         | 
| 2 | 
            +
            require 'bundler/setup'
         | 
| 3 | 
            +
            require 'term/ansicolor'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            include Term::ANSIColor
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            def usage
         | 
| 8 | 
            +
              puts "Usage: #{__FILE__} PDF_FILE [PDF_FILE ...]"
         | 
| 9 | 
            +
            end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            files = ARGV.select { |f| File.file?(f) }
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            abort usage if files.empty?
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            multiple_files = files.length > 1
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            files.each do |file|
         | 
| 18 | 
            +
              puts bold(file) if multiple_files
         | 
| 19 | 
            +
              
         | 
| 20 | 
            +
              # Find the strings in the PDF, look for a FontName descriptor
         | 
| 21 | 
            +
              raw_list = `strings #{file} | grep FontName`
         | 
| 22 | 
            +
              
         | 
| 23 | 
            +
              # Extract the font names from each line
         | 
| 24 | 
            +
              font_names = raw_list.lines.map do |raw_line|
         | 
| 25 | 
            +
                raw_line.match(/\/FontName \/[A-Z]{6}\+([^\/]*)\//)[1].strip
         | 
| 26 | 
            +
              end.uniq
         | 
| 27 | 
            +
              
         | 
| 28 | 
            +
              font_names.sort.each do |font|
         | 
| 29 | 
            +
                puts blue(font)
         | 
| 30 | 
            +
              end
         | 
| 31 | 
            +
              
         | 
| 32 | 
            +
              puts if multiple_files
         | 
| 33 | 
            +
            end
         | 
    
        data/pdffonts.gemspec
    ADDED
    
    | @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            # -*- encoding: utf-8 -*-
         | 
| 2 | 
            +
            lib = File.expand_path('../lib', __FILE__)
         | 
| 3 | 
            +
            $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            Gem::Specification.new do |gem|
         | 
| 6 | 
            +
              gem.name          = "pdffonts"
         | 
| 7 | 
            +
              gem.version       = "1.0.0"
         | 
| 8 | 
            +
              gem.authors       = ["Pete Nicholls"]
         | 
| 9 | 
            +
              gem.email         = ["pete@metanation.com"]
         | 
| 10 | 
            +
              gem.summary       = %q{A command-line tool to display fonts embedded inside PDF documents.}
         | 
| 11 | 
            +
              gem.homepage      = "http://github.com/Aupajo/pdffonts"
         | 
| 12 | 
            +
              gem.license       = "MIT"
         | 
| 13 | 
            +
             | 
| 14 | 
            +
              gem.files         = `git ls-files`.split($/)
         | 
| 15 | 
            +
              gem.executables   = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
         | 
| 16 | 
            +
              gem.test_files    = gem.files.grep(%r{^(test|spec|features)/})
         | 
| 17 | 
            +
              gem.require_paths = ["lib"]
         | 
| 18 | 
            +
             | 
| 19 | 
            +
              gem.add_dependency "term-ansicolor"
         | 
| 20 | 
            +
              gem.add_development_dependency "rake"
         | 
| 21 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,92 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: pdffonts
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 1.0.0
         | 
| 5 | 
            +
              prerelease: 
         | 
| 6 | 
            +
            platform: ruby
         | 
| 7 | 
            +
            authors:
         | 
| 8 | 
            +
            - Pete Nicholls
         | 
| 9 | 
            +
            autorequire: 
         | 
| 10 | 
            +
            bindir: bin
         | 
| 11 | 
            +
            cert_chain: []
         | 
| 12 | 
            +
            date: 2013-01-20 00:00:00.000000000 Z
         | 
| 13 | 
            +
            dependencies:
         | 
| 14 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 15 | 
            +
              name: term-ansicolor
         | 
| 16 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 17 | 
            +
                none: false
         | 
| 18 | 
            +
                requirements:
         | 
| 19 | 
            +
                - - ! '>='
         | 
| 20 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 21 | 
            +
                    version: '0'
         | 
| 22 | 
            +
              type: :runtime
         | 
| 23 | 
            +
              prerelease: false
         | 
| 24 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 25 | 
            +
                none: false
         | 
| 26 | 
            +
                requirements:
         | 
| 27 | 
            +
                - - ! '>='
         | 
| 28 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 29 | 
            +
                    version: '0'
         | 
| 30 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 31 | 
            +
              name: rake
         | 
| 32 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 33 | 
            +
                none: false
         | 
| 34 | 
            +
                requirements:
         | 
| 35 | 
            +
                - - ! '>='
         | 
| 36 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 37 | 
            +
                    version: '0'
         | 
| 38 | 
            +
              type: :development
         | 
| 39 | 
            +
              prerelease: false
         | 
| 40 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 41 | 
            +
                none: false
         | 
| 42 | 
            +
                requirements:
         | 
| 43 | 
            +
                - - ! '>='
         | 
| 44 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 45 | 
            +
                    version: '0'
         | 
| 46 | 
            +
            description: 
         | 
| 47 | 
            +
            email:
         | 
| 48 | 
            +
            - pete@metanation.com
         | 
| 49 | 
            +
            executables:
         | 
| 50 | 
            +
            - pdffonts
         | 
| 51 | 
            +
            extensions: []
         | 
| 52 | 
            +
            extra_rdoc_files: []
         | 
| 53 | 
            +
            files:
         | 
| 54 | 
            +
            - .gitignore
         | 
| 55 | 
            +
            - Gemfile
         | 
| 56 | 
            +
            - LICENSE.txt
         | 
| 57 | 
            +
            - README.md
         | 
| 58 | 
            +
            - Rakefile
         | 
| 59 | 
            +
            - bin/pdffonts
         | 
| 60 | 
            +
            - pdffonts.gemspec
         | 
| 61 | 
            +
            homepage: http://github.com/Aupajo/pdffonts
         | 
| 62 | 
            +
            licenses:
         | 
| 63 | 
            +
            - MIT
         | 
| 64 | 
            +
            post_install_message: 
         | 
| 65 | 
            +
            rdoc_options: []
         | 
| 66 | 
            +
            require_paths:
         | 
| 67 | 
            +
            - lib
         | 
| 68 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 69 | 
            +
              none: false
         | 
| 70 | 
            +
              requirements:
         | 
| 71 | 
            +
              - - ! '>='
         | 
| 72 | 
            +
                - !ruby/object:Gem::Version
         | 
| 73 | 
            +
                  version: '0'
         | 
| 74 | 
            +
                  segments:
         | 
| 75 | 
            +
                  - 0
         | 
| 76 | 
            +
                  hash: 1180686645932647891
         | 
| 77 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 78 | 
            +
              none: false
         | 
| 79 | 
            +
              requirements:
         | 
| 80 | 
            +
              - - ! '>='
         | 
| 81 | 
            +
                - !ruby/object:Gem::Version
         | 
| 82 | 
            +
                  version: '0'
         | 
| 83 | 
            +
                  segments:
         | 
| 84 | 
            +
                  - 0
         | 
| 85 | 
            +
                  hash: 1180686645932647891
         | 
| 86 | 
            +
            requirements: []
         | 
| 87 | 
            +
            rubyforge_project: 
         | 
| 88 | 
            +
            rubygems_version: 1.8.24
         | 
| 89 | 
            +
            signing_key: 
         | 
| 90 | 
            +
            specification_version: 3
         | 
| 91 | 
            +
            summary: A command-line tool to display fonts embedded inside PDF documents.
         | 
| 92 | 
            +
            test_files: []
         |