diff --git a/lib/prawn/font.rb b/lib/prawn/font.rb index f4d694891..f4c001a8f 100644 --- a/lib/prawn/font.rb +++ b/lib/prawn/font.rb @@ -362,6 +362,10 @@ class Font # @return [Hash] attr_reader :options + # Whether the font is a full embedding. + # @return [Boolean] + attr_reader :full_font_embedding + # Shortcut interface for constructing a font object. Filenames of the form # `*.ttf` will call {Fonts::TTF#initialize TTF.new}, `*.otf` calls # {Fonts::OTF#initialize OTF.new}, `*.dfont` calls {Fonts::DFont#initialize @@ -536,8 +540,6 @@ def eql?(other) private - attr_reader :full_font_embedding - # generate a font identifier that hasn't been used on the current page yet # def generate_unique_id diff --git a/lib/prawn/fonts/ttf.rb b/lib/prawn/fonts/ttf.rb index 0abf5b742..21f541955 100644 --- a/lib/prawn/fonts/ttf.rb +++ b/lib/prawn/fonts/ttf.rb @@ -522,7 +522,7 @@ def embed_full_font(reference) def embed_composite_font(reference, font) if font_type(font) == :unknown - raise Error, %(Composite font embedding is not uspported for font "#{font.name}.") + raise Error, %(Composite font embedding is not supported for font "#{font.name}.") end true_type = font_type(font) == :true_type @@ -565,7 +565,7 @@ def embed_composite_font(reference, font) to_unicode.stream.compress! if @document.compression_enabled? widths = - font.horizontal_metrics.widths.map { |w| (w * scale_factor).round } + font.horizontal_metrics.widths.map { |w| Integer(w * scale_factor) } child_font = @document.ref!( Type: :Font,