A few months ago I had a client with trouble deciding on a font for the title of his website. The problem he was having is that he knew what he didn’t want but not how to express exactly what he wanted, nor did he have any examples of fonts he liked. After many attempts to find the perfect fit for his site and learning much of what he didn’t want and little of what he did I decided to make the process a little easier for both of us.
- bckgrnd() alternates the background color based on if i is even.
- postText() writes the appropriate text.
- fontStyle() determines the weight of the font, if multiple weights are available from Google.
This turned out to be a very popular form of choosing the font as he was able to decide very quickly. He then asked that I do the same for his subtitle and posts as he wanted similar but different fonts for each. To save time I added the details in directly and used Hipster Ipsum for a sample blog post. Using a switch statement I was able to allow him to choose which text in the associated fonts.
Since he had different preferences for each of the areas he would be using a font I went back and added in specific fonts from Google and allowed for each fontView (title, subtitle, post) to have it’s own set of Google Fonts.