{"id":27787967,"url":"https://github.com/shashkiranr/multifontview-android","last_synced_at":"2026-03-03T09:31:18.490Z","repository":{"id":144143204,"uuid":"101682870","full_name":"shashkiranr/MultiFontView-Android","owner":"shashkiranr","description":"MultiFontView library can be used to select custom fonts for the view dynamically in your XML","archived":false,"fork":false,"pushed_at":"2017-09-04T04:39:52.000Z","size":1451,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T16:52:48.743Z","etag":null,"topics":["custom-fonts","font","fontchooser","fonts","multifont","multiple","typeface","xml"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shashkiranr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-28T20:04:17.000Z","updated_at":"2024-12-04T18:16:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"df29236c-a414-4cf4-945f-5cfbf83ac4c7","html_url":"https://github.com/shashkiranr/MultiFontView-Android","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashkiranr%2FMultiFontView-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashkiranr%2FMultiFontView-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashkiranr%2FMultiFontView-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashkiranr%2FMultiFontView-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shashkiranr","download_url":"https://codeload.github.com/shashkiranr/MultiFontView-Android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251748924,"owners_count":21637412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-fonts","font","fontchooser","fonts","multifont","multiple","typeface","xml"],"created_at":"2025-04-30T16:53:03.095Z","updated_at":"2026-03-03T09:31:18.135Z","avatar_url":"https://github.com/shashkiranr.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## **MultiFontView**\n\n[![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=16)\n[![](https://jitpack.io/v/shashkiranr/MultiFontView-Android.svg)](https://jitpack.io/#shashkiranr/MultiFontView-Android)\n\n**`MultiFontView`** library can be used to select custom fonts for the view dynamically in your XML. The library loads the custom fonts using a font cache. \n\n**Views Available**\n\n`MultiFontTextView`\n`MultiFontEditText`\n`MultiFontButton`\n`MultiFontSwitch`\n`MultiFontRadioButton`\n`MultiFontCheckBox`\n`MultiFontTextClock[API 17+]`\n\n![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot.png?raw=true)\n\n## **How to Use**\n\n#### *STEP 1 - Declare dependencies in your project*\n\nTo add any `MultiFontView` to your project, first make sure in root `build.gradle` you have specified the following repository:\n```groovy\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n\nTo Use MultiFont Textview, add the below dependency\n \n```groovy\n\tdependencies {\n\t        compile 'com.github.shashkiranr.MultiFontView-Android:multifonttextview:1.7'\n\t}\n```\n\nTo Use MultiFont Button, add the below dependency\n \n```groovy\n\tdependencies {\n\t        compile 'com.github.shashkiranr.MultiFontView-Android:multifontbutton:1.7'\n\t}\n```\n\nTo Use MultiFont EditText, add the below dependency\n \n```groovy\n\tdependencies {\n\t       compile 'com.github.shashkiranr.MultiFontView-Android:multifontedittext:1.7'\n\t}\n```\nTo Use MultiFont Switch, add the below dependency\n \n```groovy\n\tdependencies {\n\t       compile 'com.github.shashkiranr.MultiFontView-Android:multifontswitch:1.7'\n\t}\n```\n\nTo Use MultiFont CheckBox, add the below dependency\n \n```groovy\n\tdependencies {\n\t       compile 'com.github.shashkiranr.MultiFontView-Android:multifontcheckbox:1.7'\n\t}\n```\n\nTo Use MultiFont RadioButton, add the below dependency\n \n```groovy\n\tdependencies {\n\t       compile 'com.github.shashkiranr.MultiFontView-Android:multifontradiobutton:1.7'\n\t}\n```\n\nTo Use MultiFont TextClock, add the below dependency\n \n```groovy\n\tdependencies {\n\t       compile 'com.github.shashkiranr.MultiFontView-Android:multifonttextclock:1.7'\n\t}\n```\n\n#### *STEP 2 - copy the fonts to assets folder under fonts subfolder*\n\n![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20-%20assets.png?raw=true)\n \n \n#### *STEP 3 - create an attrs.xml file (if already present then add) a declare-stylable and attribute name typeface_from_list which contains the custom fonts in form of enums -  as shown below*\n\nFor `MultiFontTextView` the declare-styleable should be named `MultiFontTextView` and attribute should be named `typeface_from_list`\n\n```groovy\n\u003cattr name=\"typeface_from_list\"\u003e\n        \u003cenum name=\"BLESSED.otf\" value=\"0\" /\u003e\n        \u003cenum name=\"Respective.ttf\" value=\"1\" /\u003e\n        \u003cenum name=\"Respective_Slanted.ttf\" value=\"2\" /\u003e\n        \u003cenum name=\"Shine.ttf\" value=\"3\" /\u003e\n        \u003cenum name=\"SweetSensations.ttf\" value=\"4\" /\u003e\n    \u003c/attr\u003e\n    \u003cdeclare-styleable name=\"MultiFontTextView\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n```\n\nFor `MultiFontButton` the declare-styleable should be named `MultiFontButton` and attribute should be named `typeface_from_list`\n\n```groovy\n\u003cattr name=\"typeface_from_list\"\u003e\n        \u003cenum name=\"BLESSED.otf\" value=\"0\" /\u003e\n        \u003cenum name=\"Respective.ttf\" value=\"1\" /\u003e\n        \u003cenum name=\"Respective_Slanted.ttf\" value=\"2\" /\u003e\n        \u003cenum name=\"Shine.ttf\" value=\"3\" /\u003e\n        \u003cenum name=\"SweetSensations.ttf\" value=\"4\" /\u003e\n    \u003c/attr\u003e\n    \u003cdeclare-styleable name=\"MultiFontButton\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n```\n\nFor `MultiFontEditText` the declare-styleable should be named `MultiFontEditText` and attribute should be named `typeface_from_list`\n\n```groovy\n\u003cattr name=\"typeface_from_list\"\u003e\n        \u003cenum name=\"BLESSED.otf\" value=\"0\" /\u003e\n        \u003cenum name=\"Respective.ttf\" value=\"1\" /\u003e\n        \u003cenum name=\"Respective_Slanted.ttf\" value=\"2\" /\u003e\n        \u003cenum name=\"Shine.ttf\" value=\"3\" /\u003e\n        \u003cenum name=\"SweetSensations.ttf\" value=\"4\" /\u003e\n    \u003c/attr\u003e\n    \u003cdeclare-styleable name=\"MultiFontEditText\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n```\n\nFor `MultiFontSwitch` the declare-styleable should be named `MultiFontSwitch` and attribute should be named `typeface_from_list`\n\n```groovy\n\u003cattr name=\"typeface_from_list\"\u003e\n        \u003cenum name=\"BLESSED.otf\" value=\"0\" /\u003e\n        \u003cenum name=\"Respective.ttf\" value=\"1\" /\u003e\n        \u003cenum name=\"Respective_Slanted.ttf\" value=\"2\" /\u003e\n        \u003cenum name=\"Shine.ttf\" value=\"3\" /\u003e\n        \u003cenum name=\"SweetSensations.ttf\" value=\"4\" /\u003e\n    \u003c/attr\u003e\n    \u003cdeclare-styleable name=\"MultiFontSwitch\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n```\n\nFor `MultiFontRadioButton` the declare-styleable should be named `MultiFontRadioButton` and attribute should be named `typeface_from_list`\n\n```groovy\n\u003cattr name=\"typeface_from_list\"\u003e\n        \u003cenum name=\"BLESSED.otf\" value=\"0\" /\u003e\n        \u003cenum name=\"Respective.ttf\" value=\"1\" /\u003e\n        \u003cenum name=\"Respective_Slanted.ttf\" value=\"2\" /\u003e\n        \u003cenum name=\"Shine.ttf\" value=\"3\" /\u003e\n        \u003cenum name=\"SweetSensations.ttf\" value=\"4\" /\u003e\n    \u003c/attr\u003e\n    \u003cdeclare-styleable name=\"MultiFontRadioButton\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n```\n\nFor `MultiFontCheckBox` the declare-styleable should be named `MultiFontCheckBox` and attribute should be named `typeface_from_list`\n\n```groovy\n\u003cattr name=\"typeface_from_list\"\u003e\n        \u003cenum name=\"BLESSED.otf\" value=\"0\" /\u003e\n        \u003cenum name=\"Respective.ttf\" value=\"1\" /\u003e\n        \u003cenum name=\"Respective_Slanted.ttf\" value=\"2\" /\u003e\n        \u003cenum name=\"Shine.ttf\" value=\"3\" /\u003e\n        \u003cenum name=\"SweetSensations.ttf\" value=\"4\" /\u003e\n    \u003c/attr\u003e\n    \u003cdeclare-styleable name=\"MultiFontCheckBox\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n```\n\nFor `MultiFontTextClock` the declare-styleable should be named `MultiFontCheckBox` and attribute should be named `typeface_from_list`\n\n```groovy\n\u003cattr name=\"typeface_from_list\"\u003e\n        \u003cenum name=\"BLESSED.otf\" value=\"0\" /\u003e\n        \u003cenum name=\"Respective.ttf\" value=\"1\" /\u003e\n        \u003cenum name=\"Respective_Slanted.ttf\" value=\"2\" /\u003e\n        \u003cenum name=\"Shine.ttf\" value=\"3\" /\u003e\n        \u003cenum name=\"SweetSensations.ttf\" value=\"4\" /\u003e\n    \u003c/attr\u003e\n    \u003cdeclare-styleable name=\"MultiFontTextClock\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n```\n\nIf you are using `all the views` or `any two views` just one typeface_from_list is enough as shown below\n```groovy\n   \u003cattr name=\"typeface_from_list\"\u003e\n        \u003cenum name=\"BLESSED.otf\" value=\"0\" /\u003e\n        \u003cenum name=\"Respective.ttf\" value=\"1\" /\u003e\n        \u003cenum name=\"Respective_Slanted.ttf\" value=\"2\" /\u003e\n        \u003cenum name=\"Shine.ttf\" value=\"3\" /\u003e\n        \u003cenum name=\"SweetSensations.ttf\" value=\"4\" /\u003e\n    \u003c/attr\u003e\n    \u003cdeclare-styleable name=\"MultiFontTextView\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n\n    \u003cdeclare-styleable name=\"MultiFontButton\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n\n    \u003cdeclare-styleable name=\"MultiFontEditText\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n    \n    \u003cdeclare-styleable name=\"MultiFontSwitch\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n\n    \u003cdeclare-styleable name=\"MultiFontRadioButton\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n\n    \u003cdeclare-styleable name=\"MultiFontCheckBox\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n    \n    \u003cdeclare-styleable name=\"MultiFontTextClock\"\u003e\n        \u003cattr name=\"typeface_from_list\" /\u003e\n    \u003c/declare-styleable\u003e\n    \n```\n\n#### *STEP 4 - create a string array with name `customFonts` and declare all the name of the custom fonts with file extension in the `same order` as `typeface_from_list` enum-  as shown below*\n\n```groovy\n    \u003cstring-array name=\"customFonts\"\u003e\n        \u003citem\u003eBLESSED.otf\u003c/item\u003e\n        \u003citem\u003eRespective.ttf\u003c/item\u003e\n        \u003citem\u003eRespective_Slanted.ttf\u003c/item\u003e\n        \u003citem\u003eShine.ttf\u003c/item\u003e\n        \u003citem\u003eSweetSensations.ttf\u003c/item\u003e\n    \u003c/string-array\u003e\n```\n\n#### *STEP 5 - Add the custom view in your layout. The property `typeface_from_list` should apper and the font names should display as values as shown below*\n\n![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontTextview.png?raw=true)\n\n![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontButton.png?raw=true)\n\n![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultifontEditText.png?raw=true)\n\n![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontSwitch.png?raw=true)\n\n![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontRadioButton.png?raw=true)\n\n![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontCheckBox.png?raw=true)\n\n![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontTextClock.png?raw=true)\n\n\n\n## ***Thats it !!***\n\n## **License**\n\n    MIT License\n\n    Copyright (c) 2017 shashkiranr\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshashkiranr%2Fmultifontview-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshashkiranr%2Fmultifontview-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshashkiranr%2Fmultifontview-android/lists"}