mirror of
https://github.com/googlefonts/noto-emoji.git
synced 2025-07-08 13:36:40 +00:00
Update README.md
This commit is contained in:
parent
52abbd5844
commit
a58c693eda
1 changed files with 3 additions and 2 deletions
|
@ -17,7 +17,8 @@ There are two different methods included in this library:
|
||||||
```java
|
```java
|
||||||
EmojiCompat.Config config = new AssetEmojiCompatConfig(getContext(), "Blobmoji.ttf");
|
EmojiCompat.Config config = new AssetEmojiCompatConfig(getContext(), "Blobmoji.ttf");
|
||||||
```
|
```
|
||||||
This will create a new EmojiCompat configuration using the file provided in `assets/Blobmoji.ttf`.
|
This will create a new EmojiCompat configuration using the file provided in `assets/Blobmoji.ttf`.
|
||||||
|
Anyhow, I don't recommend using `AssetEmojiCompatConfig` anymore as [this](#i-want-to-let-my-users-only-choose-another-font-if-they-dont-like-my-current-one) approach is more flexible and just as easy to use. There will be a feature to rename the fallback font in the next release.
|
||||||
2. ### [`FileEmojiCompatConfig`](https://github.com/C1710/blobmoji/blob/filemojicompat/emojicompat/FileMojiCompat/filemojicompat/src/main/java/de/c1710/filemojicompat/FileEmojiCompatConfig.java)
|
2. ### [`FileEmojiCompatConfig`](https://github.com/C1710/blobmoji/blob/filemojicompat/emojicompat/FileMojiCompat/filemojicompat/src/main/java/de/c1710/filemojicompat/FileEmojiCompatConfig.java)
|
||||||
This is the more complex and interesting option.
|
This is the more complex and interesting option.
|
||||||
Instead of providing a short String containing the font's name, you can provide a [`File`](https://developer.android.com/reference/java/io/File)
|
Instead of providing a short String containing the font's name, you can provide a [`File`](https://developer.android.com/reference/java/io/File)
|
||||||
|
@ -51,7 +52,7 @@ Yes, they will. But only if their device either doesn't support these flags (whi
|
||||||
these assets as their default emojis. They won't replace any existing emojis.
|
these assets as their default emojis. They won't replace any existing emojis.
|
||||||
#### But I did `setReplaceAll(true)`?!
|
#### But I did `setReplaceAll(true)`?!
|
||||||
This won't change anything as `FileEmojiCompatConfig` will detect if the font file is not valid and it will simply ignore `setReplaceAll(true)`.
|
This won't change anything as `FileEmojiCompatConfig` will detect if the font file is not valid and it will simply ignore `setReplaceAll(true)`.
|
||||||
### I want to let my users only choose another font if they don't like my current one
|
## I want to let my users only choose another font if they don't like my current one
|
||||||
This is easily possible with the introduction of `FileMojiCompat 1.0.6`.
|
This is easily possible with the introduction of `FileMojiCompat 1.0.6`.
|
||||||
In this case you override the fallback font by putting your font into the `assets` folder of your app using the name `NoEmojiCompat.ttf`.
|
In this case you override the fallback font by putting your font into the `assets` folder of your app using the name `NoEmojiCompat.ttf`.
|
||||||
Whenever the fallback font is needed (which is the case if the user doesn't specify another one), this font is being used.
|
Whenever the fallback font is needed (which is the case if the user doesn't specify another one), this font is being used.
|
||||||
|
|
Loading…
Add table
Reference in a new issue