2

i have folder called mydata in My project in that i have fonts/Myfont.ttf files which are linked and not copied, Now how can i get the source of this ttf file and pass it to Typeface ?

I have tried this:

Typeface font = Typeface.createFromFile("data/fonts/myfont.ttf");

But i get this error "native typeface cannot be made android error"

But not working can any one help me on this?

Goofy
  • 6,098
  • 17
  • 90
  • 156
  • what do you want? to use this custom font? or anything else with it? – stinepike Mar 14 '13 at 16:59
  • @StinePike yes i know how to use this custom fonts bu i have some fonts in the local folder and not in assests folder but these files are linked and not copied now how to get this files? – Goofy Mar 14 '13 at 17:00
  • 3
    Move the font file into `assets/`, then use `createFromAsset()`. – CommonsWare Mar 14 '13 at 17:03
  • @CommonsWare but the files are linked ? and not copied , i mean the files are shortcuts or alias not directly copied? will it work even its shortcut? – Goofy Mar 14 '13 at 17:06
  • Symlinks or hardlinks at the OS level into `assets/` may work, though I have never tried this. I would recommend simply copying the file into `assets/`. – CommonsWare Mar 14 '13 at 17:07
  • @Goofy have you got solution? – Ajay Pandya Apr 22 '15 at 06:45
  • http://stackoverflow.com/questions/25404145/register-font-is-corrupting-ttf-file – Ajay Pandya Apr 22 '15 at 10:24

0 Answers0