Class: Prune::Fonts::BaseEn

Inherits:
Base
  • Object
show all
Defined in:
lib/prune/fonts/base_en.rb

Overview

Base class for English fonts.

Direct Known Subclasses

Courier, Helvetica, Symbol, TimesRoman, ZapfDingbats

Instance Attribute Summary

Attributes inherited from Base

#font_name

Instance Method Summary collapse

Methods inherited from Base

bold?, #encoding, font_name, #font_sym, italic?, #name, #reference

Methods included from PObjects

pa, pd, ph, pl, pn, ps

Constructor Details

#initialize(document) ⇒ BaseEn

Initialize.



9
10
11
12
13
14
15
16
# File 'lib/prune/fonts/base_en.rb', line 9

def initialize(document)
  super(document)
  @main_element = Font.new(
    document,
    pd(
      pn(:Subtype) => pn(:Type1),
      pn(:Encoding) => pn(:StandardEncoding)))
end

Instance Method Details

#decode(string) ⇒ Object

Decode string.



19
20
21
22
23
# File 'lib/prune/fonts/base_en.rb', line 19

def decode(string)
  raise NonAsciiStringError unless
    Kconv.guess(string) == Kconv::ASCII
  pl(string)
end