{"action":"created","issue":{"url":"https://api.github.com/repos/chrisjenx/Calligraphy/issues/282","repository_url":"https://api.github.com/repos/chrisjenx/Calligraphy","labels_url":"https://api.github.com/repos/chrisjenx/Calligraphy/issues/282/labels{/name}","comments_url":"https://api.github.com/repos/chrisjenx/Calligraphy/issues/282/comments","events_url":"https://api.github.com/repos/chrisjenx/Calligraphy/issues/282/events","html_url":"https://github.com/chrisjenx/Calligraphy/issues/282","id":151089215,"number":282,"title":"I can use Calligraphy in alert dialogs, but fontPath attribute in xml does not have any effect","user":{"login":"neywen","id":378543,"avatar_url":"https://avatars.githubusercontent.com/u/378543?v=3","gravatar_id":"","url":"https://api.github.com/users/neywen","html_url":"https://github.com/neywen","followers_url":"https://api.github.com/users/neywen/followers","following_url":"https://api.github.com/users/neywen/following{/other_user}","gists_url":"https://api.github.com/users/neywen/gists{/gist_id}","starred_url":"https://api.github.com/users/neywen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neywen/subscriptions","organizations_url":"https://api.github.com/users/neywen/orgs","repos_url":"https://api.github.com/users/neywen/repos","events_url":"https://api.github.com/users/neywen/events{/privacy}","received_events_url":"https://api.github.com/users/neywen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-26T09:43:47Z","updated_at":"2016-04-30T05:28:49Z","closed_at":null,"body":"Hello,\r\nI have a general knowledge and some experience in programming, particularly in iOS. I'm a bit new with Android, but I'm going forward.\r\n\r\nin a Android Studio project,\r\nI have a main activity declared as \r\n`\r\npublic class ProductsActivity extends AppCompatActivity  implements NavigationView.OnNavigationItemSelectedListener\r\n\r\n`\r\nCalligraphy is inited in the OnCreate callback, with a ttf font I added to the assets/fonts folder, and I override attachBaseContext, as explained in the documentation.\r\n\r\nWhen I open an alert dialog box, I can see it uses the custom default font, that's ok.\r\n\r\nBut if I use the fontPath attribute in a xml, for a ListView row for instance, it does not apply:\r\n```\r\n            <TextView\r\n                android:id=\"@+id/price\"\r\n                android:layout_width=\"match_parent\"\r\n                android:layout_height=\"22dp\"\r\n                android:layout_alignBottom=\"@+id/imageView\"\r\n                android:text=\"price\"\r\n                android:textColor=\"@color/white\"\r\n                android:paddingLeft=\"10dp\"\r\n                fontPath=\"fonts/euclidFlex_regular.ttf\"/>\r\n```\r\n\r\nI had to go the row Adapter code, and apply the typeface programmatically to make it work, waiting for me to understand what's wrong with the fontPath thing.\r\n\r\n```\r\nTypeface typeface = Typeface.createFromAsset(mContext.getAssets(), \"fonts/euclidFlex_regular.ttf\");\r\n holder.price.setTypeface(typeface);\r\n```\r\n\r\nIs there anything I could check to help me understand the problem ?\r\nthanks,\r\nloïc b.\r\n"},"comment":{"url":"https://api.github.com/repos/chrisjenx/Calligraphy/issues/comments/215939753","html_url":"https://github.com/chrisjenx/Calligraphy/issues/282#issuecomment-215939753","issue_url":"https://api.github.com/repos/chrisjenx/Calligraphy/issues/282","id":215939753,"user":{"login":"neywen","id":378543,"avatar_url":"https://avatars.githubusercontent.com/u/378543?v=3","gravatar_id":"","url":"https://api.github.com/users/neywen","html_url":"https://github.com/neywen","followers_url":"https://api.github.com/users/neywen/followers","following_url":"https://api.github.com/users/neywen/following{/other_user}","gists_url":"https://api.github.com/users/neywen/gists{/gist_id}","starred_url":"https://api.github.com/users/neywen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neywen/subscriptions","organizations_url":"https://api.github.com/users/neywen/orgs","repos_url":"https://api.github.com/users/neywen/repos","events_url":"https://api.github.com/users/neywen/events{/privacy}","received_events_url":"https://api.github.com/users/neywen/received_events","type":"User","site_admin":false},"created_at":"2016-04-30T05:28:49Z","updated_at":"2016-04-30T05:28:49Z","body":"The Adapter is created using the activity as a context:\r\n```\r\nnew ProductAdapter((Context)ProductsActivity.this, [...]\r\n```\r\n\r\nIn the Adapter, I get the view this way : \r\n\r\n```\r\nLayoutInflater inflater = LayoutInflater.from(mContext);\r\nrow = inflater.inflate(mLayoutResourceId, parent, false);\r\n```"}}