Yes, Marrius is right. In Xcode 6, you neither need to use extra software nor to set Font in Code files. Just add your font files in your project along with other files. And Interface builder will display the added fonts in the Custom Font List.
And the most amazing thing is, xcode 6 shows the applied font instantly in IB. This is the great addition by Apple.
Also make sure to add this key "Fonts provided by application" in your project's info.plist and provide your font file names to see the effect in devices.
If what you really want to do is generating the vector of all possibles solutions and then test them, you will have to use the preprocessor to generate them all for you.
However, another solution would consist into using a generator: a wrapper class which will instantiate all your solutions and test them. You might want to consult the Hierarchy Generators of Loki (detailed in the book).
// never remember where they put boost::same_type :x
#include <boost/mpl/if.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/begin.hpp>
#include <boost/mpl/end.hpp>
#include <boost/mpl/next.hpp>
using namespace boost::mpl;
struct None
{
static void test() {}
};
template <class UIterator, class UTypes,
class VIterator, class VTypes,
class WIterator, class WTypes>
class Generator;
template <class UIterator, class UTypes,
class VIterator, class VTypes,
class WIterator, class WTypes>
struct Next
{
// u_begin is not necessary ;)
// it would be cheaper not to pre-declare all of them since we force evaluation
// however this dramatically increase the readability
typedef typename begin<VIterator>::type v_begin;
typedef typename begin<WIterator>::type w_begin;
typedef typename next<UIterator>::type u_next;
typedef typename next<VIterator>::type v_next;
typedef typename next<WIterator>::type w_next;
typedef typename end<UIterator>::type u_end;
typedef typename end<VIterator>::type v_end;
typedef typename end<WIterator>::type w_end;
typedef if_< boost::same_type<w_next, w_end>,
if_< boost::same_type<v_next, v_end>,
if_< boost::same_type<u_next, u_end>,
None,
Generator< u_next, UTypes,
v_begin, VTypes,
w_begin, WTypes >
>,
Generator< UIterator, UTypes,
v_next, VTypes,
w_begin, WTypes >
>,
Generator< UIterator, UTypes,
VIterator, VTypes,
w_next, WTypes>
>::type type;
};
template <class UIterator, class UTypes,
class VIterator, class VTypes,
class WIterator, class WTypes>
struct Generator
{
typedef S< deref<UIterator>::type,
deref<VIterator>::type,
deref<WIterator>::type > S_type;
typedef Next<UIterator, UTypes,
VIterator, VTypes,
WIterator, WTypes>::type next_type;
static void test()
{
// test my variation of S
S_Type my_S;
test_func(my_S);
// test the variations of my next and its next and... you get the idea :)
next_type::test();
}
};
// And finally
int main(int argc, char* argv[])
{
typedef Generator< begin<u_types>::type, u_types,
begin<v_types>::type, v_types,
begin<w_types>::type, w_types > base_generator_type;
base_generator_type::test();
}
Disclaimer: this code has not been compiled and may lack some include / typename / use directives... nevertheless I hope you get my point.
If you have any idea of what the Design Patterns are, it is highly similar to a 'decorator' or a 'composite' design in its way of adding another round of tests at each step layer.
I would also like to note that this takes more that 50 lines of code... but at least it will grow nicely with the vectors :)
Best Answer
Did you actually added it to the plist File?
Here's a short introduction how to do this: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/
Greetings, Alex
EDIT: Actually I tried to add my own fonts to my with the interface Builder and it doesn't work. Seems to be a bug... This bug only appears, when I use an attributed String