From ca55c81a37cb93dcc668f1547e632fd4b955cc0e Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Thu, 2 Feb 2012 11:45:29 +0100 Subject: [PATCH] add support for custom fonts --- lib/motion/project/config.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index 76f95168..fc55eb32 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -28,7 +28,7 @@ module Motion; module Project :frameworks, :libs, :delegate_class, :name, :build_dir, :resources_dir, :specs_dir, :identifier, :codesign_certificate, :provisioning_profile, :device_family, :interface_orientations, :version, :icons, - :prerendered_icon, :seed_id, :entitlements + :prerendered_icon, :seed_id, :entitlements, :fonts def initialize(project_dir) @project_dir = project_dir @@ -308,6 +308,7 @@ module Motion; module Project 'UIPrerenderedIcon' => prerendered_icon, } }, + 'UIAppFonts' => fonts, 'UIDeviceFamily' => device_family_ints.map { |x| x.to_s }, 'UISupportedInterfaceOrientations' => interface_orientations_consts } @@ -386,5 +387,13 @@ module Motion; module Project def entitlements_data Motion::PropertyList.to_s(entitlements) end + + def fonts + @fonts ||= begin + Dir.chdir(resources_dir) do + Dir.glob('*.{otf,ttf}') + end + end + end end end; end