{"id":17284244,"url":"https://github.com/johnkil/print","last_synced_at":"2025-04-10T02:25:41.327Z","repository":{"id":21279598,"uuid":"24595532","full_name":"johnkil/Print","owner":"johnkil","description":"A lightweight Android library for use iconic fonts.","archived":false,"fork":false,"pushed_at":"2018-02-28T06:13:42.000Z","size":514,"stargazers_count":209,"open_issues_count":3,"forks_count":40,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-03T00:06:23.041Z","etag":null,"topics":["android","iconic-fonts","imageview","typeface"],"latest_commit_sha":null,"homepage":"http://johnkil.github.io/Print","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnkil.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-29T13:07:23.000Z","updated_at":"2025-03-23T00:52:25.000Z","dependencies_parsed_at":"2022-09-02T18:01:10.482Z","dependency_job_id":null,"html_url":"https://github.com/johnkil/Print","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnkil%2FPrint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnkil%2FPrint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnkil%2FPrint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnkil%2FPrint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnkil","download_url":"https://codeload.github.com/johnkil/Print/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143645,"owners_count":21054813,"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":["android","iconic-fonts","imageview","typeface"],"created_at":"2024-10-15T09:53:35.030Z","updated_at":"2025-04-10T02:25:41.296Z","avatar_url":"https://github.com/johnkil.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Print\n=====\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Print-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1016)\n\nA lightweight Android library for use iconic fonts.\n\n![image](https://raw.githubusercontent.com/johnkil/Print/master/art/print.jpg)\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.github.johnkil.print.sample\"\u003e\n  \u003cimg alt=\"Get it on Google Play\"\n       src=\"http://www.android.com/images/brand/get_it_on_play_logo_small.png\" /\u003e\n\u003c/a\u003e\n\n\nDownload\n--------\n\nGradle:\n\n```groovy\ncompile 'com.github.johnkil.print:print:1.3.1'\n```\n\nMaven:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.johnkil.print\u003c/groupId\u003e\n    \u003cartifactId\u003eprint\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.1\u003c/version\u003e\n    \u003ctype\u003eaar\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\n\nGetting started\n---------------\n\n#### Add fonts\n\nAdd your custom iconic fonts to `assets/`.\n\n\n#### Setup default font\n\nDefine your default iconic font using `PrintConfig` in [Application.onCreate()][1] method. This font will be used in cases when the value of a font is not specified.\n\n```java\npublic class MyApplication extends Application {\n\n    @Override\n    public void onCreate() {\n        super.onCreate();                \n        PrintConfig.initDefault(getAssets(), \"fonts/iconic-font.ttf\");\n    }\n\n}\n```\n\n_Note: The definition of the default font is not necessary, in this case, you must specify the value of the font all the time._\n\n\nUsage\n-----\n\n#### PrintDrawable\n\nIf you need an icon in `ImageView` or in `ActionBar`, then you should use `PrintDrawable`. To create the drawable using `PrintDrawable.Builder`.\n\n```java\n@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n    getMenuInflater().inflate(R.menu.main, menu);\n    // Set an icon in the ActionBar\n    menu.findItem(R.id.action_info).setIcon(\n            new PrintDrawable.Builder(context)\n                    .iconTextRes(R.string.ic_info)\n                    .iconColorRes(R.color.ab_icon_color)\n                    .iconSizeRes(R.dimen.ab_icon_size)\n                    .build()\n    );\n    return true;\n}\n```\n\n\n#### Custom views\n\nUse `PrintView` as single icon in your layout.\n\n```xml\n\u003ccom.github.johnkil.print.PrintView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        app:print_iconText=\"@string/ic_android\"\n        app:print_iconColor=\"@color/icon_color\"\n        app:print_iconSize=\"@dimen/icon_size\"/\u003e\n```\n\nOr use `PrintButton` to create a button with an icon. Using a view similar to `PrintView`.\n\n```xml\n\u003ccom.github.johnkil.print.PrintButton\n        ... /\u003e\n```\n\n#### XML Attributes\n\n| _Attribute Name_       | _Related Method_                    |\n| :--------------------- | :---------------------------------- |\n| __print_iconText__     | setIconTextRes(int resId)           |\n|                        | setIconText(CharSequence text)      |\n| __print_iconCode__     | setIconCodeRes(int resId)           |\n|                        | setIconCode(int code)               |\n| __print_iconColor__    | setIconColorRes(int resId)          |\n|                        | setIconColor(int color)             |\n|                        | setIconColor(ColorStateList colors) |\n| __print_iconSize__     | setIconSizeRes(int resId)           |\n|                        | setIconSizeDp(float size)           |\n|                        | setIconSize(int unit, float size)   |\n| __print_iconFont__     | setIconFont(String path)            |\n|                        | setIconFont(Typeface font)          |\n\n\nLinks\n-----\n\n* [Android-Icon-Fonts][2] - Material and Holo iconic fonts.\n\n\nLicense\n-------\n\n    Copyright 2014 Evgeny Shishkin\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n       http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n    \n\n[1]: http://developer.android.com/reference/android/app/Application.html#onCreate%28%29\n[2]: https://github.com/johnkil/Android-Icon-Fonts\n\n[0]: https://github.com/shamanland/fonticon\n[0]: https://github.com/atermenji/IconicDroid\n[0]: https://github.com/JoanZapata/android-iconify\n[0]: https://github.com/chrisjenx/Calligraphy\n[0]: https://github.com/theDazzler/droidicon\n[0]: https://github.com/mikepenz/Android-Iconics\n[0]: https://github.com/Malinskiy/android-material-icons\n[0]: https://github.com/kazy1991/FontDrawable\n\n[0]: https://github.com/svendvd/Fontinator\n[0]: https://github.com/code-mc/material-icon-lib\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnkil%2Fprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnkil%2Fprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnkil%2Fprint/lists"}