Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/prawn/font.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/prawn/fonts/ttf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Loading