Use gradle to integrate custom icon font

Per
https://github.com/oblador/react-native-vector-icons#option-with-gradle-recommended.
This should theoretically keep the font up to date in Android when we update
the font file.
This commit is contained in:
Ken-ichi Ueda
2023-02-07 21:12:41 -05:00
parent dc53c47a2a
commit 44f6410097
5 changed files with 14 additions and 8 deletions

View File

@@ -96,7 +96,12 @@ apply from: "../../node_modules/react-native/react.gradle"
// add vector icons to project
project.ext.vectoricons = [
iconFontNames: [ 'MaterialCommunityIcons.ttf', 'MaterialIcons.ttf' ]
iconFontsDir: "../../assets/fonts/",
iconFontNames: [
'MaterialCommunityIcons.ttf',
'MaterialIcons.ttf',
'inaturalisticons.ttf'
]
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

View File

Binary file not shown.

View File

Binary file not shown.

View File

Binary file not shown.

View File

@@ -3,20 +3,21 @@
* Usage: <INatIcon name="icon-name" size={20} color="#4F8EF7" />
*/
import createIconSet from 'react-native-vector-icons/lib/create-icon-set';
import createIconSet from "react-native-vector-icons/lib/create-icon-set";
export const glyphMap = {
"notifications-bell": 57344,
"hamburger-menu": 57345,
"plus-sign": 57346,
"compass-rose": 57347,
"pen-and-paper": 57348,
"microphone": 57350,
"camera": 57355,
microphone: 57350,
camera: 57355,
"triple-dots": 57352,
"close-button-x": 57351,
"comments-filled-in": 57353,
"checkmark": 57354,
"pencil": 57356,
checkmark: 57354,
pencil: 57356,
"ios-people-updated-2": 57357,
"cv-sparklylabel": 57358,
"close-button-circle": 57349,
@@ -30,11 +31,11 @@ export const glyphMap = {
"identification-solid": 57366
};
const iconSet = createIconSet(glyphMap, 'inaturalisticons', 'inaturalisticons.ttf');
const iconSet = createIconSet( glyphMap, "inaturalisticons", "inaturalisticons.ttf" );
export default iconSet;
export const {
Button,
getImageSource,
getImageSourceSync,
getImageSourceSync
} = iconSet;