Fatima
Fatima

Reputation: 869

Xamarin does not recognize the installed fonts

I am trying to start building an app for ios using Xamarin and I have a localization problem.

I have installed some custom fonts in my mac which the Notes application recognizes and has no problem with.

But the font don't appear in Properties panel of the controls in Xamarin.

Thanks before.

Upvotes: 0

Views: 1399

Answers (2)

netonjm
netonjm

Reputation: 21

Alan solves the question.

A solution to do it in code:

Xamarin iOS:

(ILabel).Font = UIFont.FromName ("font name", 30f);

Your font needs to be built like a "Content" in any directory

Xamarin Android:

(TextView).SetTypeface(Typeface.CreateFromAsset(Application.Context.Assets, DISPLAY_FONT), TypefaceStyle.Normal);

(TextView).TextSize = 32;

Needs to be copied to your /Assets/(FONT).TTF and needs to be built like AndroidAsset

;-)

Upvotes: 2

Alan McGovern
Alan McGovern

Reputation: 81

Custom fonts should show up in the property panel in Xamarin Studio 5.7 and higher.

Upvotes: 1

Related Questions