lib/sugarcube/symbol.rb in sugarcube-0.16.9 vs lib/sugarcube/symbol.rb in sugarcube-0.18.0

- old
+ new

@@ -205,10 +205,11 @@ @system_fonts = { system: :"systemFontOfSize:", bold: :"boldSystemFontOfSize:", italic: :"italicSystemFontOfSize:", + monospace: 'Monaco', } @font_sizes = { label: :labelFontSize, button: :buttonFontSize, @@ -652,17 +653,22 @@ def uigesturerecognizerstate look_in(Symbol.gesture_recognizer_states) end alias uigesturestate uigesturerecognizerstate - def uifont(size=UIFont.systemFontSize) + def uifont(size=nil) + size ||= UIFont.systemFontSize # system fonts if Symbol.system_fonts.has_key? self font = look_in(Symbol.system_fonts) if size.is_a? Symbol size = Symbol.font_sizes.fetch(size).uifontsize end - font = UIFont.send(font, size) + if font.is_a?(Symbol) + font = UIFont.send(font, size) + else + font.uifont(size) + end else size = look_in(font_sizes).uifontsize font = UIFont.systemFontOfSize(size) end font