1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00
joplin/packages/app-mobile/web/rnVectorIconsSetup.js
2024-08-02 14:51:49 +01:00

48 lines
1.5 KiB
JavaScript

import fontAwesomeFont from 'react-native-vector-icons/Fonts/FontAwesome.ttf';
import fontAwesomeSolidFont from 'react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf';
import fontAwesomeRegularFont from 'react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf';
import fontAwesomeBrandsFont from 'react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf';
import ioniconFont from 'react-native-vector-icons/Fonts/Ionicons.ttf';
import materialCommunityIconsFont from 'react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf';
import antDesignFont from 'react-native-vector-icons/Fonts/AntDesign.ttf';
// See https://www.npmjs.com/package/react-native-vector-icons
const setUpRnVectorIcons = () => {
const iconFontStyles = `
@font-face {
src: url(${fontAwesomeFont});
font-family: FontAwesome;
}
@font-face {
src: url(${fontAwesomeSolidFont});
font-family: FontAwesome5_Solid;
}
@font-face {
src: url(${fontAwesomeRegularFont});
font-family: FontAwesome5_Regular;
}
@font-face {
src: url(${fontAwesomeBrandsFont});
font-family: FontAwesome5_Brands;
}
@font-face {
src: url(${ioniconFont});
font-family: Ionicons;
}
@font-face {
src: url(${materialCommunityIconsFont});
font-family: MaterialCommunityIcons;
}
@font-face {
src: url(${antDesignFont});
font-family: AntDesign;
}
`;
const style = document.createElement('style');
style.appendChild(document.createTextNode(iconFontStyles));
document.head.appendChild(style);
};
setUpRnVectorIcons();