Module: Zebra::Zpl::FontSize

Defined in:
lib/zebra/zpl/font.rb

Defined Under Namespace

Classes: InvalidFontSizeError

Constant Summary collapse

SIZE_0 =

tiny

12
SIZE_1 =

6pt

17
SIZE_2 =

8pt

22
SIZE_3 =

10pt

28
SIZE_4 =

12pt

33
SIZE_5 =

16pt

44
SIZE_6 =

24pt

67
SIZE_7 =

32pt

100
SIZE_8 =

40pt

111
SIZE_9 =

48pt

133

Class Method Summary collapse

Class Method Details

.valid_font_size?(font_size) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/zebra/zpl/font.rb', line 17

def self.valid_font_size?(font_size)
  [12, 17, 22, 28, 33, 44, 67, 100, 111, 133].include?(font_size.to_i)
end

.validate_font_size(font_size) ⇒ Object



21
22
23
# File 'lib/zebra/zpl/font.rb', line 21

def self.validate_font_size(font_size)
  raise InvalidFontSizeError unless valid_font_size?(font_size)
end