Sha256: 9fc033bee7843e3f974500777864bbf1c01c19192fe4243d747432fffc54e04a

Contents?: true

Size: 944 Bytes

Versions: 8

Compression:

Stored size: 944 Bytes

Contents

module Asciidoctor
module Prawn
module FormattedText
module Fragment
  attr_reader :document
  
  # Prevent fragment from being written by discarding the text.
  def conceal
    @text = ''
  end

  # Modify the built-in ascender write method to allow an override value to be
  # specified using the format_state hash.
  def ascender= val
    @ascender = (format_state.key? :ascender) ? format_state[:ascender] : val
  end

  # Modify the built-in ascender write method to allow an override value to be
  # specified using the format_state hash.
  def descender= val
    @descender = (format_state.key? :descender) ? format_state[:descender] : val
  end
end

class ::Prawn::Text::Formatted::Fragment
  if respond_to? :prepend
    prepend Fragment
  else
    # NOTE it's necessary to remove the accessor methods or else they won't get replaced
    remove_method :ascender=
    remove_method :descender=
    include Fragment
  end
end
end
end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
asciidoctor-pdf-1.5.0.alpha.16 lib/asciidoctor-pdf/prawn_ext/formatted_text/fragment.rb
asciidoctor-pdf-1.5.0.alpha.15 lib/asciidoctor-pdf/prawn_ext/formatted_text/fragment.rb
asciidoctor-pdf-1.5.0.alpha.14 lib/asciidoctor-pdf/prawn_ext/formatted_text/fragment.rb
asciidoctor-pdf-1.5.0.alpha.13 lib/asciidoctor-pdf/prawn_ext/formatted_text/fragment.rb
asciidoctor-pdf-1.5.0.alpha.12 lib/asciidoctor-pdf/prawn_ext/formatted_text/fragment.rb
asciidoctor-pdf-1.5.0.alpha.11 lib/asciidoctor-pdf/prawn_ext/formatted_text/fragment.rb
asciidoctor-pdf-1.5.0.alpha.10 lib/asciidoctor-pdf/prawn_ext/formatted_text/fragment.rb
asciidoctor-pdf-1.5.0.alpha.9 lib/asciidoctor-pdf/prawn_ext/formatted_text/fragment.rb