prawn-ruby/pdf-core-0.6.0/lib/pdf/core/text.rb
# Call with no argument to retrieve the current text rendering mode.
#
# Call with a symbol and block to temporarily change the current
# text rendering mode.
#
#   pdf.text_rendering_mode(:stroke) do
#     pdf.text("Outlined Text")
#   end
#
# Valid modes are:
#
# * :fill             - fill text (default)
# * :stroke           - stroke text
# * :fill_stroke      - fill, then stroke text
# * :invisible        - invisible text
# * :fill_clip        - fill text then add to path for clipping
# * :stroke_clip      - stroke text then add to path for clipping
# * :fill_stroke_clip - fill then stroke text, then add to path for clipping
# * :clip             - add text to path for clipping
Call with no argument to retrieve the current text rendering mode.
Call with a symbol and block to temporarily change the current
text rendering mode.



Valid modes are.


Call with no argument to retrieve the current text rendering mode . Call with a symbol and block to temporarily change the current text rendering mode . Valid modes are .
def text_rendering_mode(mode=nil)
        return (defined?(@text_rendering_mode) && @text_rendering_mode || :fill) if mode.nil?
        unless MODES.key?(mode)
          raise ArgumentError, "mode must be between one of #{MODES.keys.join(', ')} (#{mode})"
        end
        original_mode = self.text_rendering_mode
        if original_mode == mode
          yield
        else
          @text_rendering_mode = mode
          add_content "\n#{MODES[mode]} Tr"
          yield
          add_content "\n#{MODES[original_mode]} Tr"
          @text_rendering_mode = original_mode
        end
      end
def text_rendering_mode ( mode = nil ) return ( defined? ( @text_rendering_mode ) && @text_rendering_mode || :fill ) if mode . nil? unless MODES . key? ( mode ) raise ArgumentError , "mode must be between one of #{MODES.keys.join(', ')} (#{mode})" end original_mode = self . text_rendering_mode if original_mode == mode yield else @text_rendering_mode = mode add_content "\n#{MODES[mode]} Tr" yield add_content "\n#{MODES[original_mode]} Tr" @text_rendering_mode = original_mode end end
Call with no argument to retrieve the current text rendering mode.
Call with no argument to retrieve the current text rendering mode .
mode
<not_specific>