Skip to content
This repository
Browse code

allow size-less system fonts

  • Loading branch information...
commit 514b46d460e8d9cf6917b193b1e271750e8502a4 1 parent 74a7f4e
Clay Allsopp clayallsopp authored

Showing 2 changed files with 8 additions and 5 deletions. Show diff stats Hide diff stats

  1. +3 3 motion/font/font.rb
  2. +5 2 spec/motion/font/font_spec.rb
6 motion/font/font.rb
@@ -2,15 +2,15 @@ module BubbleWrap
2 2 module Font
3 3 module_function
4 4
5   - def bold(size)
  5 + def bold(size = nil)
6 6 Font.new(:bold, size)
7 7 end
8 8
9   - def system(size)
  9 + def system(size = nil)
10 10 Font.new(:system, size)
11 11 end
12 12
13   - def italic(size)
  13 + def italic(size = nil)
14 14 Font.new(:italic, size)
15 15 end
16 16
7 spec/motion/font/font_spec.rb
@@ -2,8 +2,11 @@
2 2 [[:system, "systemFontOfSize:"], [:bold, "boldSystemFontOfSize:"], [:italic, "italicSystemFontOfSize:"]].each do |font, method|
3 3 describe ".#{font}" do
4 4 it "should work" do
5   - f = BubbleWrap::Font.send(font, 12)
6   - f.should == UIFont.send(method, 12)
  5 + f = BubbleWrap::Font.send(font, 16)
  6 + f.should == UIFont.send(method, 16)
  7 +
  8 + f = BubbleWrap::Font.send(font)
  9 + f.should == UIFont.send(method, UIFont.systemFontSize)
7 10 end
8 11 end
9 12 end

0 comments on commit 514b46d

Please sign in to comment.
Something went wrong with that request. Please try again.