class Object

Public Instance Methods

ascender=(val) click to toggle source

Modify the built-in ascender write method to allow an override value to be specified using the format_state hash.

# File lib/asciidoctor/pdf/ext/prawn/formatted_text/fragment.rb, line 12
def ascender= val
  @ascender = (format_state.key? :ascender) ? format_state[:ascender] : val
end
conceal() click to toggle source

Prevent fragment from being written by discarding the text.

# File lib/asciidoctor/pdf/ext/prawn/formatted_text/fragment.rb, line 6
def conceal
  @text = ''
end
descender=(val) click to toggle source

Modify the built-in ascender write method to allow an override value to be specified using the format_state hash.

# File lib/asciidoctor/pdf/ext/prawn/formatted_text/fragment.rb, line 18
def descender= val
  @descender = (format_state.key? :descender) ? format_state[:descender] : val
end
to_pdf() click to toggle source

Convert the object to a serialized PDF object.

# File lib/asciidoctor/pdf/ext/core/object.rb, line 4
def to_pdf
  ::PDF::Core.pdf_object self
end
truncate(*args) click to toggle source
Calls superclass method
# File lib/asciidoctor/pdf/ext/core/numeric.rb, line 4
def truncate *args
  if args.length == 1
    if (precision = Integer args.shift) == 0
      super
    elsif precision > 0
      precision_factor = 10.0 ** precision
      (self * precision_factor).to_i / precision_factor
    else
      precision_factor = 10 ** precision.abs
      (self / precision_factor).to_i * precision_factor
    end
  else
    super
  end
end
warning(*args;) click to toggle source
# File lib/asciidoctor/pdf/ext/prawn/extensions.rb, line 6
def warning *args; end
width() click to toggle source
Calls superclass method
# File lib/asciidoctor/pdf/ext/prawn/formatted_text/fragment.rb, line 22
def width
  if (val = format_state[:width])
    (val.end_with? 'em') ? val.to_f * @document.font_size : val
  else
    super
  end
end