Skip to content

Commit

Permalink
Merge pull request #6 from bbulpett/font_modifications
Browse files Browse the repository at this point in the history
Font modifications
  • Loading branch information
bbulpett authored Jun 30, 2016
2 parents 6e585ce + bd4d7fc commit e2c8b36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/zebra/zpl/font.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module Zpl
module FontSize
class InvalidFontSizeError < StandardError; end

SIZE_0 = 12 # tiny
SIZE_1 = 17 # 6pt
SIZE_2 = 22 # 8pt
SIZE_3 = 28 # 10pt
Expand All @@ -14,7 +15,7 @@ class InvalidFontSizeError < StandardError; end
SIZE_9 = 133 # 48pt

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

def self.validate_font_size(font_size)
Expand Down
2 changes: 1 addition & 1 deletion lib/zebra/zpl/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def to_zpl
# ["A#{x}", y, rotation, font_size, h_multiplier, v_multiplier, print_mode, "\"#{data}\""].join(",")
# "^FO25,25^FB600,100,0,C,0^FDFoo^FS"

"^CF#{font_type},#{font_size}^FO#{x},#{y}^FB800,4,0,#{justification},0^FD#{data}^FS"
"^CF#{font_type},#{font_size}^FO#{x},#{y}^FB609,4,0,#{justification},0^FD#{data}^FS"
end

private
Expand Down

0 comments on commit e2c8b36

Please sign in to comment.