Free Xamarin Subscriptions for Windows Phone Developers Joseph Hill, from Xamarin Inc., made all Windows Phone developers day. Accessing Azure AD information from .Net Azure Mobile Services and the Xamarin Client Kevin Ford digs deep into Azure AD and comes up with a winner. Xamarin Helps Launch AWS APN Mobile Competency Program Lacey Butler, from […]
This post is about a specific issue and that issue is how the naming of the font isn’t all that matters.
Start off here for the longer version
To get a grip of how to use custom fonts, please check out the Xamarin documentation at http://developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/fonts/ and also a post from Mike James that can be found here: https://blog.xamarin.com/custom-fonts-in-ios/
So what’s the problem?
To summarize the usage of custom fonts loaded from a ttf-file on iOS, all described in the links above.
- Add the ttf-file to the Resource folder – make it a Bundled Resource and Copy Always
- Edit the info.plist to include the font
To find out the FontFamily name to use, you open up the ttf-file in Windows by simply double clicking it and you’ll find it. Since my client is a client, they wanted to use a different typeface for the bold text. No problem, I shouted and downloaded the bolder typeface perfectly named Roboto Condensed Bold.
I then opened the ttf file in windows to check out the name and it was named exactly the same. Wait what? How do I then distinguish between them?
It turns out that the Bold font has the same name and will be used if you set FontAttributes=”Bold”.
<Label FontFamily=“Roboto Condensed“ Text=“Very custom“ FontAttributes=“Bold“ />
And if you use the above without importing the “Roboto Condensed Bold” font it will Bold the regular font.
Still, what’s the problem?
In 1911, Frank C. Mars made the first Mars candies, establishing Mars’ roots as a confectionery company. The company, based in McLean, Virginia, now has a presence in 74 countries, generating net sales of more than $33 billion a year. Mars Petcare, one of the company’s six lines of business, is headquartered in Brussels, Belgium, […]
I don’t freelance! Well, almost never. Sometimes I do when things are slow. Ok, when it came to styling a Xamarin.Forms app for some good folks in Brazil, I had to say yes. Just one catch. The UI had to be in Xaml. I know, it’s like a Xaml conspiracy to get me to actually […]
When I am not traveling around presenting at conferences, dev days, user groups, and code camps you will probably find me doing one of three things: Riding my bike, drinking coffee, and most likely coding. The elusive Motz can be found coding usually from home or in a coffee shop drinking said coffe, but I have finally decided to unleash my coding to the world in a new web series I am calling “Motz Codes Live”.
Each week I will be covering a topic of mobile development and for about 30-60 mintues I will be coding live, answer questions, and showing you exactly how I code on a daily basis.
Last week I kicked things off by covering how to create your very first Xamarin.UITest test and ship your app to Xamarin Test Cloud all in under 60 minutes. If you weren’t able to see it live the best part is all Motz Codes Live episodes are recorded! Here is the first one:
This Friday I will be covering the topic of using local storage with SQLite-net PCL in your apps. You can subsribe to my Youtube station for the latest updates. Be sure to register here on google hangouts.