{"id":28559877,"url":"https://github.com/99ff00/react-native-dynamic-fonts","last_synced_at":"2025-06-10T09:06:24.983Z","repository":{"id":283169184,"uuid":"90038892","full_name":"99ff00/react-native-dynamic-fonts","owner":"99ff00","description":"React-Native module for loading fonts dynamically","archived":false,"fork":false,"pushed_at":"2017-03-31T06:04:51.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":17,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T05:05:59.357Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":false,"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/99ff00.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-05-02T13:51:12.000Z","updated_at":"2024-05-17T13:50:39.000Z","dependencies_parsed_at":"2025-03-18T22:44:25.642Z","dependency_job_id":null,"html_url":"https://github.com/99ff00/react-native-dynamic-fonts","commit_stats":null,"previous_names":["99ff00/react-native-dynamic-fonts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99ff00%2Freact-native-dynamic-fonts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99ff00%2Freact-native-dynamic-fonts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99ff00%2Freact-native-dynamic-fonts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99ff00%2Freact-native-dynamic-fonts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/99ff00","download_url":"https://codeload.github.com/99ff00/react-native-dynamic-fonts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99ff00%2Freact-native-dynamic-fonts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259043764,"owners_count":22797161,"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":[],"created_at":"2025-06-10T09:06:24.248Z","updated_at":"2025-06-10T09:06:24.968Z","avatar_url":"https://github.com/99ff00.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# React Native Dynamic Font Loader [![npm version](https://badge.fury.io/js/react-native-dynamic-fonts.svg)](https://badge.fury.io/js/react-native-dynamic-fonts) [![npm](https://img.shields.io/npm/dt/react-native-dynamic-fonts.svg)](https://www.npmjs.org/package/react-native-dynamic-fonts) ![MIT](https://img.shields.io/dub/l/vibe-d.svg) ![Platform - Android and iOS](https://img.shields.io/badge/platform-Android%20%7C%20iOS-yellow.svg)\n\nA React Native module that allows you to load fonts dynamically at runtime via base64 encoded TTF or OTF, like so:\n\n## Table of contents\n- [Install](#install)\n- [Usage](#usage)\n- [Options](#options)\n- [Response object](#the-response-object)\n\n## Install\n\n`npm install react-native-dynamic-fonts@latest --save`\n\n### Automatic Installation\n\n`react-native link`\n\n### Manual Installation\n\n#### iOS\n\n1. In the XCode's \"Project navigator\", right click on your project's Libraries folder ➜ `Add Files to \u003c...\u003e`\n2. Go to `node_modules` ➜ `react-native-dynamic-fonts` ➜ `ios` ➜ select `RCTDynamicFonts.xcodeproj`\n3. Add `libRCTDynamicFonts.a` to `Build Phases -\u003e Link Binary With Libraries`\n4. Compile and have fun\n\n#### Android\n1. Add the following lines to `android/settings.gradle`:\n    ```gradle\n    include ':react-native-dynamic-fonts'\n    project(':react-native-dynamic-fonts').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-dynamic-fonts/android')\n    ```\n    \n2. Add the compile line to the dependencies in `android/app/build.gradle`:\n    ```gradle\n    dependencies {\n        compile project(':react-native-dynamic-fonts')\n    }\n    ```\n    \n3. Add the import and link the package in `MainApplication.java`:\n    ```java\n    import org.th317erd.react.DynamicFontsPackage; // \u003c-- add this import\n\n    public class MainApplication extends Application implements ReactApplication {\n        @Override\n        protected List\u003cReactPackage\u003e getPackages() {\n            return Arrays.\u003cReactPackage\u003easList(\n                new MainReactPackage(),\n                new DynamicFontsPackage() // \u003c-- add this line\n            );\n        }\n    }\n    ```\n\n### Example of how to use\n\nTo load a font dynamically, you must first have a base64 string of your font file (TTF or OTF):\n```javascript\nimport { loadFont } from 'react-native-dynamic-fonts';\n\n...\n\nloadFonts('nameOfFont', base64FontString, 'ttf').then(function(name) {\n\tconsole.log('Loaded font successfully. Font name is: ', name);\n});\n\n...\n\n```\n\n\n#### Note\n\nOn iOS, it isn't possible to specify the font name. For this reason BOTH Android and iOS return the ACTUAL registered font name. For Android this is whatever you pass in, for iOS it is whatever is embedded in the font. I suggest you always use the full name embedded in the font to avoid issues.\n\n### Options\n\noption | iOS  | Android | Info\n------ | ---- | ------- | ----\nname | Not used | Used | Specify registered font name (doesn't work for iOS)\ndata | Used | Used | This can be a data URI or raw base64... if it is raw base64 type must be specified, but defaults to TTF (data URI mime: font/ttf or font/otf)\ntype | Used | Used | (optional) Specify the type of font in the encoded data (ttf or otf). Defaults to \"ttf\"\n\n### The Response\n\nThe ACTUAL name the font was registered with. Use this for your fontFamily.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F99ff00%2Freact-native-dynamic-fonts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F99ff00%2Freact-native-dynamic-fonts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F99ff00%2Freact-native-dynamic-fonts/lists"}