Sha256: 2fcbf9d1d28499934d546e70e338ecef80f23245719940612c2fe26e32427086

Contents?: true

Size: 965 Bytes

Versions: 37

Compression:

Stored size: 965 Bytes

Contents

require 'cairo/paper'

module Cairo
  class Paper
    [
     [841, 1189, "A0"],
     [594, 841, "A1"],
     [420, 594, "A2"],
     [297, 420, "A3"],
     [210, 297, "A4"],
     [148, 210, "A5"],
     [105, 148, "A6"],
     [74, 105, "A7"],
     [52, 74, "A8"],
     [37, 52, "A9"],
     [26, 37, "A10"],

     [1030, 1456, "B0"],
     [728, 1030, "B1"],
     [515, 728, "B2"],
     [364, 515, "B3"],
     [257, 364, "B4"],
     [182, 257, "B5"],
     [128, 182, "B6"],
     [91, 128, "B7"],
     [64, 91, "B8"],
     [45, 64, "B9"],
     [32, 45, "B10"],

     [215.9, 279.4, "letter"],
     [215.9, 355.6, "legal"],
     [279.9, 431.8, "tabloid"],
     [100, 148, "Japanese postcard"],
    ].each do |width, height, name|
      constant_name = name.upcase.gsub(/ +/, '_')
      const_set(constant_name, new(width, height, "mm", name))
      const_set("#{constant_name}_LANDSCAPE",
                new(height, width, "mm", "#{name} (landscape)"))
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
cairo-1.12.6-x86-mingw32 lib/cairo/papers.rb
cairo-1.12.6 lib/cairo/papers.rb
cairo-1.12.5-x86-mingw32 lib/cairo/papers.rb
cairo-1.12.5 lib/cairo/papers.rb
cairo-1.12.4-x86-mingw32 lib/cairo/papers.rb
cairo-1.12.4 lib/cairo/papers.rb
cairo-1.12.3-x86-mingw32 lib/cairo/papers.rb
cairo-1.12.3 lib/cairo/papers.rb
cairo-1.12.2-x86-mingw32 lib/cairo/papers.rb
cairo-1.12.2 lib/cairo/papers.rb
cairo-1.12.1-x86-mingw32 lib/cairo/papers.rb
cairo-1.12.1 lib/cairo/papers.rb
cairo-1.12.0-x86-mingw32 lib/cairo/papers.rb
cairo-1.12.0 lib/cairo/papers.rb
cairo-1.10.2-x86-mingw32 lib/cairo/papers.rb
cairo-1.10.2 lib/cairo/papers.rb
cairo-1.10.1-x86-mingw32 lib/cairo/papers.rb
cairo-1.10.1 lib/cairo/papers.rb
cairo-1.10.0-x86-mingw32 lib/cairo/papers.rb
cairo-1.10.0 lib/cairo/papers.rb