@expo-google-fonts/noto-color-emoji 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.prettierrc ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "printWidth": 100,
3
+ "tabWidth": 2,
4
+ "singleQuote": true,
5
+ "jsxBracketSameLine": true,
6
+ "trailingComma": "es5",
7
+ "arrowParens": "always"
8
+ }
Binary file
package/README.md ADDED
@@ -0,0 +1,100 @@
1
+ # @expo-google-fonts/noto-color-emoji
2
+
3
+ ![npm version](https://flat.badgen.net/npm/v/@expo-google-fonts/noto-color-emoji)
4
+ ![license](https://flat.badgen.net/github/license/expo/google-fonts)
5
+ ![publish size](https://flat.badgen.net/packagephobia/install/@expo-google-fonts/noto-color-emoji)
6
+ ![publish size](https://flat.badgen.net/packagephobia/publish/@expo-google-fonts/noto-color-emoji)
7
+
8
+ This package lets you use the [**Noto Color Emoji**](https://fonts.google.com/specimen/Noto+Color+Emoji) font family from [Google Fonts](https://fonts.google.com/) in your Expo app.
9
+
10
+ ## Noto Color Emoji
11
+
12
+ ![Noto Color Emoji](./font-family.png)
13
+
14
+ This font family contains [1 style](#-gallery).
15
+
16
+ - `NotoColorEmoji_400Regular`
17
+
18
+ ## Usage
19
+
20
+ Run this command from the shell in the root directory of your Expo project to add the font family package to your project
21
+ ```sh
22
+ expo install @expo-google-fonts/noto-color-emoji expo-font expo-app-loading
23
+ ```
24
+
25
+ Now add code like this to your project
26
+ ```js
27
+ import React, { useState, useEffect } from 'react';
28
+
29
+ import { Text, View, StyleSheet } from 'react-native';
30
+ import AppLoading from 'expo-app-loading';
31
+ import { useFonts, NotoColorEmoji_400Regular } from '@expo-google-fonts/noto-color-emoji';
32
+
33
+ export default () => {
34
+ let [fontsLoaded] = useFonts({
35
+ NotoColorEmoji_400Regular,
36
+ });
37
+
38
+ let fontSize = 24;
39
+ let paddingVertical = 6;
40
+
41
+ if (!fontsLoaded) {
42
+ return <AppLoading />;
43
+ } else {
44
+ return (
45
+ <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
46
+ <Text
47
+ style={{
48
+ fontSize,
49
+ paddingVertical,
50
+ // Note the quoting of the value for `fontFamily` here; it expects a string!
51
+ fontFamily: 'NotoColorEmoji_400Regular',
52
+ }}>
53
+ Noto Color Emoji Regular
54
+ </Text>
55
+ </View>
56
+ );
57
+ }
58
+ };
59
+
60
+ ```
61
+
62
+ ## 🔡 Gallery
63
+
64
+
65
+ ||||
66
+ |-|-|-|
67
+ |![NotoColorEmoji_400Regular](./NotoColorEmoji_400Regular.ttf.png)||||
68
+
69
+
70
+ ## 👩‍💻 Use During Development
71
+
72
+ If you are trying out lots of different fonts, you can try using the [`@expo-google-fonts/dev` package](https://github.com/expo/google-fonts/tree/master/font-packages/dev#readme).
73
+
74
+ You can import *any* font style from any Expo Google Fonts package from it. It will load the fonts
75
+ over the network at runtime instead of adding the asset as a file to your project, so it may take longer
76
+ for your app to get to interactivity at startup, but it is extremely convenient
77
+ for playing around with any style that you want.
78
+
79
+ ## 📖 License
80
+
81
+ The `@expo-google-fonts/noto-color-emoji` package and its code are released under the MIT license.
82
+
83
+ All the fonts in the Google Fonts catalog are free and open source.
84
+
85
+ Check the [Noto Color Emoji page on Google Fonts](https://fonts.google.com/specimen/Noto+Color+Emoji) for the specific license of this font family.
86
+
87
+ You can use these fonts freely in your products & projects - print or digital, commercial or otherwise. However, you can't sell the fonts on their own. This isn't legal advice, please consider consulting a lawyer and see the full license for all details.
88
+
89
+ ## 🔗 Links
90
+
91
+ - [Noto Color Emoji on Google Fonts](https://fonts.google.com/specimen/Noto+Color+Emoji)
92
+ - [Google Fonts](https://fonts.google.com/)
93
+ - [This package on npm](https://www.npmjs.com/package/@expo-google-fonts/noto-color-emoji)
94
+ - [This package on GitHub](https://github.com/expo/google-fonts/tree/master/font-packages/noto-color-emoji)
95
+ - [The Expo Google Fonts project on GitHub](https://github.com/expo/google-fonts)
96
+ - [`@expo-google-fonts/dev` Devlopment Package](https://github.com/expo/google-fonts/tree/master/font-packages/dev)
97
+
98
+ ## 🤝 Contributing
99
+
100
+ Contributions are very welcome! This entire directory, including what you are reading now, was generated from code. Instead of submitting PRs to this directly, please make contributions to [the generator](https://github.com/expo/google-fonts/tree/master/packages/generator) instead.
Binary file
package/index.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ /// Generated by expo-google-fonts/generator
2
+ /// Do not edit by hand unless you know what you are doing
3
+ ///
4
+
5
+
6
+ export { useFonts } from './useFonts';
7
+
8
+ export const __metadata__: Any;
9
+ export const NotoColorEmoji_400Regular: number;
package/index.js ADDED
@@ -0,0 +1,8 @@
1
+ /// Generated by expo-google-fonts/generator
2
+ /// Do not edit by hand unless you know what you are doing
3
+ ///
4
+
5
+ export { useFonts } from './useFonts';
6
+
7
+ export { default as __metadata__ } from './metadata.json';
8
+ export const NotoColorEmoji_400Regular = require('./NotoColorEmoji_400Regular.ttf');
package/metadata.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "family": "Noto Color Emoji",
3
+ "variants": ["regular"],
4
+ "subsets": ["emoji"],
5
+ "version": "v24",
6
+ "lastModified": "2022-09-26",
7
+ "files": {
8
+ "regular": "http://fonts.gstatic.com/s/notocoloremoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFab5s79iz64w.ttf"
9
+ },
10
+ "category": "sans-serif",
11
+ "kind": "webfonts#webfont"
12
+ }
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@expo-google-fonts/noto-color-emoji",
3
+ "version": "0.2.3",
4
+ "description": "Use the Noto Color Emoji font family from Google Fonts in your Expo app",
5
+ "main": "index.js",
6
+ "repository": "https://github.com/expo/google-fonts.git",
7
+ "homepage": "https://github.com/expo/google-fonts/tree/master/font-packages/noto-color-emoji#readme",
8
+ "author": "Expo Team <team@expo.io>",
9
+ "license": "MIT",
10
+ "publishConfig": { "access": "public" }
11
+ }
package/useFonts.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ export type FontSource = string | number | Asset | FontResource;
2
+
3
+ /**
4
+ * Load a map of custom fonts to use in textual elements.
5
+ * The map keys are used as font names, and can be used with `fontFamily: <name>;`.
6
+ * It returns a boolean describing if all fonts are loaded.
7
+ *
8
+ * Note, the fonts are not "reloaded" when you dynamically change the font map.
9
+ *
10
+ * @see https://docs.expo.io/versions/latest/sdk/font/
11
+ * @example const [loaded, error] = useFonts(...);
12
+ */
13
+ export function useFonts(
14
+ map: string | { [fontFamily: string]: FontSource }
15
+ ): [boolean, Error | null];
package/useFonts.js ADDED
@@ -0,0 +1,26 @@
1
+ import { useEffect, useState } from 'react';
2
+
3
+ import { loadAsync } from 'expo-font';
4
+
5
+ /**
6
+ * Load a map of custom fonts to use in textual elements.
7
+ * The map keys are used as font names, and can be used with `fontFamily: <name>;`.
8
+ * It returns a boolean describing if all fonts are loaded.
9
+ *
10
+ * Note, the fonts are not "reloaded" when you dynamically change the font map.
11
+ *
12
+ * @see https://docs.expo.io/versions/latest/sdk/font/
13
+ * @example const [loaded, error] = useFonts(...);
14
+ */
15
+ export function useFonts(map) {
16
+ let [loaded, setLoaded] = useState(false);
17
+ let [error, setError] = useState(null);
18
+
19
+ useEffect(() => {
20
+ loadAsync(map)
21
+ .then(() => setLoaded(true))
22
+ .catch(setError);
23
+ }, []);
24
+
25
+ return [loaded, error];
26
+ }