0

fonts.xml

<family name="sans-serif">
    <font weight="100" style="normal">Roboto-Thin.ttf</font>
    <font weight="100" style="italic">Roboto-ThinItalic.ttf</font>
    <font weight="300" style="normal">Roboto-Light.ttf</font>
    <font weight="300" style="italic">Roboto-LightItalic.ttf</font>
    <font weight="400" style="normal">Roboto-Regular.ttf</font>
    <font weight="400" style="italic">Roboto-Italic.ttf</font>
    <font weight="500" style="normal">Roboto-Medium.ttf</font>
    <font weight="500" style="italic">Roboto-MediumItalic.ttf</font>
    <font weight="900" style="normal">Roboto-Black.ttf</font>
    <font weight="900" style="italic">Roboto-BlackItalic.ttf</font>
    <font weight="700" style="normal">Roboto-Bold.ttf</font>
    <font weight="700" style="italic">Roboto-BoldItalic.ttf</font>
</family>

<!-- Note that aliases must come after the fonts they reference. -->
<alias name="sans-serif-thin" to="sans-serif" weight="100" />
<alias name="sans-serif-light" to="sans-serif" weight="300" />
<alias name="sans-serif-medium" to="sans-serif" weight="500" />
<alias name="sans-serif-black" to="sans-serif" weight="900" />
<alias name="arial" to="sans-serif" />
<alias name="helvetica" to="sans-serif" />
<alias name="tahoma" to="sans-serif" />
<alias name="verdana" to="sans-serif" />

How these mappings work? is the hypen in family name e.g. "sans-serif-thin" is intentional? Is there any documentation available for understanding fonts.xml behaviour?

Cœur
  • 37,241
  • 25
  • 195
  • 267
shri
  • 61
  • 1
  • 1
  • 4
  • http://stackoverflow.com/questions/12128331/how-to-change-fontfamily-of-textview-in-android has a lot of the answer your looking for – Dwight Spencer Aug 19 '15 at 19:48
  • Thank you @DwightSpencer. I would like to know more about how minikin source code accesses fonts.xml and how exactly it processes?. It would be helpful if you have any information to share on the same line. – shri Aug 20 '15 at 18:12
  • Then I suggest reviewing the android.widget.TextView source code at https://source.android.com/source/index.html as that is going to be best way to learn. – Dwight Spencer Aug 20 '15 at 19:24
  • can we add two different mappings for the same family name? e.g. if case 1 happens map arial to sans-serif else map arial to serif or another possibility is only if case 3 happens map arial to sans-serif – shri Aug 28 '15 at 18:45
  • I doubt that but it would be better if you asked that as a new question. I would suggest to try under [Android:SE](http://android.stackexchange.com) for better results. – Dwight Spencer Aug 28 '15 at 18:47

0 Answers0