Class: PDF::Reader::WidthCalculator::TypeZero

### Home Classes Methods

### In Files

- lib/pdf/reader/width_calculator/type_zero.rb

### Parent

Object

### Methods

- ::new
- #glyph_width

### Files

- MIT-LICENSE
- README.rdoc
- TODO
- mac_expert.txt
- mac_roman.txt
- pdf_doc.txt
- standard.txt
- symbol.txt
- win_ansi.txt
- zapf_dingbats.txt
- glyphlist.txt

### Class/Module Index

Quicksearch

- PDF
- PDF::Reader
- PDF::Reader::Buffer
- PDF::Reader::CidWidths
- PDF::Reader::EncryptedPDFError
- PDF::Reader::Filter
- PDF::Reader::Filter::Ascii85
- PDF::Reader::Filter::AsciiHex
- PDF::Reader::Filter::Depredict
- PDF::Reader::Filter::Flate
- PDF::Reader::Filter::Lzw
- PDF::Reader::Filter::Null
- PDF::Reader::Filter::RunLength
- PDF::Reader::Font
- PDF::Reader::FontDescriptor
- PDF::Reader::FormXObject
- PDF::Reader::InvalidObjectError
- PDF::Reader::MalformedPDFError
- PDF::Reader::ObjectCache
- PDF::Reader::ObjectHash
- PDF::Reader::PageLayout
- PDF::Reader::PageState
- PDF::Reader::PageTextReceiver
- PDF::Reader::Parser
- PDF::Reader::PrintReceiver
- PDF::Reader::Reference
- PDF::Reader::RegisterReceiver
- PDF::Reader::ResourceMethods
- PDF::Reader::StandardSecurityHandler
- PDF::Reader::Stream
- PDF::Reader::SynchronizedCache
- PDF::Reader::TextReceiver
- PDF::Reader::TextRun
- PDF::Reader::TransformationMatrix
- PDF::Reader::UnsupportedFeatureError
- PDF::Reader::WidthCalculator
- PDF::Reader::WidthCalculator::BuiltIn
- PDF::Reader::WidthCalculator::Composite
- PDF::Reader::WidthCalculator::TrueType
- PDF::Reader::WidthCalculator::TypeOneOrThree
- PDF::Reader::WidthCalculator::TypeZero
- PDF::Reader::XRef
- AFM
- AFM::Font

No matching classes.

# PDF::Reader::WidthCalculator::TypeZero

Type0 (or Composite) fonts are a "root font" that rely on a "descendant font" to do the heavy lifting. The "descendant font" is a CID-Keyed font. see Section 9.7.1, PDF 32000-1:2008, pp 267 so if we are calculating a Type0 font width, we just pass off to the descendant font

### Public Class Methods

new(font) click to toggle source

    # File lib/pdf/reader/width_calculator/type_zero.rb, line 11
    def initialize(font)
      @font = font
      @descendant_font = @font.descendantfonts.first
    end

### Public Instance Methods

glyph_width(code_point) click to toggle source

    # File lib/pdf/reader/width_calculator/type_zero.rb, line 16
    def glyph_width(code_point)
      return 0 if code_point.nil? || code_point < 0

      @descendant_font.glyph_width(code_point).to_f
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.