bbulpett / zebra-zpl

Gem for using Ruby to print Zebra labels
MIT License
73 stars 32 forks source link

Un-restrict Font Size #61

Closed mtking2 closed 4 years ago

mtking2 commented 4 years ago

The ZPL II spec for the ^CF command allows font sizes (in dots) between 0 and 32000. Right now these are being restricted to 10 different sizes in font.rb:

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

When setting the font_size attribute for Zebra::Zpl::Text, we should allow any number between 0 and 32000 as well as the 10 preset Zebra::Zpl::FontSize::SIZE_X we already have defined.

References

ZPL II Programming guide, page 139