0.1.19 • Published 3 years ago

react-native-mo-fontlink v0.1.19

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-native-mo-fontlink

Provide font-autolinking for react-native / metro (ios and android)

Instead of fiddling with Info.plist and adding resources and checking if the font filenames are correct, simply require() or import them.

IOS

On IOS, this works by adding a custom build phase (via react-native.config.js, which requires this module to have a podspec and xcodeproj) that moves the font files in the build dir (${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}) from assets/something/.../font.ttf to /.

All found fonts are added to Info.plist (also in the build dir).

Additionally the postscript font names are compared to the filenames. For a font to work, the filename must match the postscript name.

For IOS Simulator builds where the bundling process is skipped the bundler server is called at http://localhost:8081/index.bundle?platform=ios&dev=true and the registerAsset() calls are parsed from the bundle. The referenced fonts are then downloaded to the build dir.

Android

Android works out of the box as it seems.

0.1.17

3 years ago

0.1.18

3 years ago

0.1.19

3 years ago

0.1.15

3 years ago

0.1.14

3 years ago

0.1.13

3 years ago

0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago