Method: PSD::TypeTool#text_value

Defined in:
lib/psd/layer_info/typetool.rb

#text_valueObject Also known as: to_s

Extracts the text within the text area. In the event that psd-enginedata fails for some reason, we attempt to extract the text using some rough regex.



44
45
46
47
48
49
50
51
# File 'lib/psd/layer_info/typetool.rb', line 44

def text_value
  if engine_data.nil?
    # Something went wrong, lets hack our way through.
    /\/Text \(˛ˇ(.*)\)$/.match(@data[:text]['EngineData'])[1].gsub /\r/, "\n"
  else
    engine_data.EngineDict.Editor.Text
  end
end