def layout_properties(args, is_text = false)
      return unless ptrue?(args)

      properties = is_text ? [:x, :y] : [:x, :y, :width, :height]

      # Check for valid properties.
      args.keys.each do |key|
        unless properties.include?(key.to_sym)
            raise "Property '#{key}' not allowed in layout options\n"
        end
      end

      # Set the layout properties
      layout = Hash.new
      properties.each do |property|
        value = args[property]
        # Convert to the format used by Excel for easier testing.
        layout[property] = sprintf("%.17g", value)
      end

      layout
    end
def layout_properties(args, is_text = false)
      return unless ptrue?(args)

      properties = is_text ? [:x, :y] : [:x, :y, :width, :height]

      # Check for valid properties.
      args.keys.each do |key|
        unless properties.include?(key.to_sym)
            raise "Property '#{key}' not allowed in layout options\n"
        end
      end

      # Set the layout properties
      layout = Hash.new
      properties.each do |property|
        value = args[property]
        # Convert to the format used by Excel for easier testing.
        layout[property] = sprintf("%.17g", value)
      end

      layout
    end
Convert user defined layout properties to the format required internally.