0

How to Add custom font to xamarin android?

I add : Assets/fonts/Geogrotesque Medium Italic.otf create attrs.xml

<resources>
  <declare-styleable name="TextView" >
    <attr name="fontFamily" format="string"/>
  </declare-styleable>
</resources>

create fonts.xml

 <familyset>
  <family>
    <nameset>
      <name>Geogrotesque</name>
    </nameset>
    <fileset>
      <file>Geogrotesque Medium Italic.otf</file>
    </fileset>
  </family>
</familyset>

and try to call with in style

@android:style/Theme.Holo
@android:style/Widget.Holo.ActionBar.TabView
@android:style/Widget.Holo.ActionBar.TabText
@android:style/Widget.Holo.Light.TextView


<item name="fontFamily">Geogrotesque</item>

and does not work :/

Chris
  • 3,329
  • 1
  • 30
  • 44
Maury
  • 604
  • 2
  • 8
  • 25

1 Answers1

0

Take a look at few tutorials explaining how to do it in android if you really want to adjust it by modifying the styles property. Here and its (github project) is a good one explaining on how.

Here is an article in stackoverflow asking the same question and it is the same in eclipse as in xamarin studio so there shoudln't be an issue there. In this post you will also find a workaround on how to modify it using code instead of the xml styles wich might be the easiest way of the two.

GabLeRoux
  • 16,715
  • 16
  • 63
  • 81
Chris
  • 3,329
  • 1
  • 30
  • 44