From fa57c7eb5e6de6334e7a563bbc9053c80adbc883 Mon Sep 17 00:00:00 2001 From: Constantin A <10349490+C1710@users.noreply.github.com> Date: Tue, 3 Jul 2018 13:37:59 +0200 Subject: [PATCH 1/5] Updated font file From 633f21f777865eb0fddaebf7424c3c2dbafb1106 Mon Sep 17 00:00:00 2001 From: Constantin A <10349490+C1710@users.noreply.github.com> Date: Tue, 3 Jul 2018 13:45:19 +0200 Subject: [PATCH 2/5] New fallback font which should work on more devices --- .../filemojicompat/build.gradle | 7 +- .../src/main/AndroidManifest.xml | 3 +- .../src/main/assets/NoEmojiCompat.ttf | Bin 6304 -> 6224 bytes .../AssetEmojiCompatConfig.java | 10 +- .../filemojicompat/FileEmojiCompatConfig.java | 202 +++++++++--------- emojicompat/FileMojiCompat/gradle.properties | 4 - 6 files changed, 113 insertions(+), 113 deletions(-) diff --git a/emojicompat/FileMojiCompat/filemojicompat/build.gradle b/emojicompat/FileMojiCompat/filemojicompat/build.gradle index e53adb7b1..e93659300 100644 --- a/emojicompat/FileMojiCompat/filemojicompat/build.gradle +++ b/emojicompat/FileMojiCompat/filemojicompat/build.gradle @@ -18,7 +18,7 @@ ext { libraryDescription = 'An EmojiCompat implementation using files from a local file or a file inside your assets directory' siteUrl = 'https://github.com/c1710/blobmoji' gitUrl = 'https://github.com/c1710/blobmoji.git' - libraryVersion = '1.0.11' + libraryVersion = '1.0.13' developerId = 'c1710' developerName = 'Constantin A.' developerEmail = 'c1710.apps@outlook.com' @@ -33,8 +33,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 27 - versionCode 12 - versionName "1.0.12" + versionCode 13 + versionName "1.0.13" } @@ -49,6 +49,7 @@ dependencies { implementation 'com.android.support:support-emoji:27.1.1' } + apply from: 'https://raw.githubusercontent.com/numetriclabz/jcenter/master/installv.gradle' apply from: 'https://raw.githubusercontent.com/numetriclabz/jcenter/master/bintrayv.gradle' diff --git a/emojicompat/FileMojiCompat/filemojicompat/src/main/AndroidManifest.xml b/emojicompat/FileMojiCompat/filemojicompat/src/main/AndroidManifest.xml index 51b79a617..f47514943 100644 --- a/emojicompat/FileMojiCompat/filemojicompat/src/main/AndroidManifest.xml +++ b/emojicompat/FileMojiCompat/filemojicompat/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/emojicompat/FileMojiCompat/filemojicompat/src/main/assets/NoEmojiCompat.ttf b/emojicompat/FileMojiCompat/filemojicompat/src/main/assets/NoEmojiCompat.ttf index 72c9e7160fe4ed71cf1df6895d7a271fcd426ba3..8d974104a08be1ad90adb9b112bd1e116b926f1e 100644 GIT binary patch delta 169 zcmZ2rc)>u4fsuiMfsdhqftew}*~ukD)cxpQ1_q8b3=BNF&Q3ngmd7V5*)v=I_nw$y z!^05l^__u1Tmz`3VB#8W%Nan1N?C46g>VOu#UQ>1NK65n$i&DteHGWScz&C&4BQ+b zNrtnBu4IGg>k0Q$Hw!S%WoKmCypBVk2T0u$No5iX;Q>l=Fz_(207;M*CLm^+yi)u- E07l*>DgXcg delta 249 zcmca$u)t7>fsuiMfsdhqftew}*~ukD)Z^%01_q8b3=BNF&Q3ngmM11E*)tobWlT)5 z;gR&0)MQ`~*8plcFma8xvn?GBL8H?w)TE&u{aUftv#) z$#C}2m241wJ<6?VvjF2p1jzfYd#aRHn2g0w7riE(QSx76uLm9w3W>feDBM zfS3h{9e~(8HOVwBH8sh?Jk`|DB-zj`H8my4$SgTI(ICkrHO= Build.VERSION_CODES.KITKAT) { + new Thread(() -> { + try { + MetadataRepo.create(typeface, new FileInputStream(fontFile)); + } catch (Throwable t) { + fallback = true; + setReplaceAll(false); + Log.w(TAG, "FileEmojiCompatConfig: No valid EmojiCompat font provided. Fallback enabled", t); + } + }).start(); + } + } catch (RuntimeException ex) { + fallback = true; + Log.e(TAG, "FileEmojiCompatConfig: Font file corrupt. Fallback enabled", ex); + } + } else { + // The heck, this is not even an actual _file_! + fallback = true; + } + + } /** * Creates a new FileEmojiCompatConfig based on an asset. - *

+ *

* This means that you can have the flexibility of {@link AssetEmojiCompatConfig} * while giving your users the choice to optionally override the font. - *

+ *

* The default location for a substituting font is * {@code /sdcard/Android/data/your.apps.package/files/EmojiCompat.ttf}. * @@ -83,13 +170,13 @@ public class FileEmojiCompatConfig extends EmojiCompat.Config { /** * Creates a new FileEmojiCompatConfig based on an asset. - *

+ *

* This means that you can have the flexibility of {@link AssetEmojiCompatConfig} * while giving your users the choice to optionally override the font. - *

+ *

* The default location for a substituting font is * {@code /sdcard/Android/data/your.apps.package/files/EmojiCompat.ttf}. - *

+ *

* The default name for the Assets font is {@code NoEmojiCompat.ttf}. * If you wish to use a different name for this font, please use * {@link #createFromAsset(Context, String)}. @@ -101,90 +188,6 @@ public class FileEmojiCompatConfig extends EmojiCompat.Config { return createFromAsset(context, FONT_FALLBACK); } - /** - * Create a new configuration for this EmojiCompat - * @param path The file name/path of the requested font - * @param context Context instance - */ - public FileEmojiCompatConfig(@NonNull Context context, - // NEW - @NonNull String path) { - // This one is obviously new - this(context, path, FONT_FALLBACK); - } - - /** - * Create a new configuration for this EmojiCompat - * @param path The file name/path of the requested font - * @param context Context instance - * @param fallbackFont The asset path of the fallback font - */ - public FileEmojiCompatConfig(@NonNull Context context, - // NEW - @NonNull String path, - @Nullable String fallbackFont) { - // This one is obviously new - this(context, new File(path), fallbackFont); - } - - /** - * Create a new configuration for this EmojiCompat based on a file - * @param context Context instance - * @param fontFile The file containing the EmojiCompat font - */ - public FileEmojiCompatConfig(@NonNull Context context, - // NEW - @Nullable File fontFile) { - this(context, fontFile, FONT_FALLBACK); - } - - /** - * Create a new configuration for this EmojiCompat based on a file - * @param context Context instance - * @param fontFile The file containing the EmojiCompat font - * @param fallbackFont The asset path of the fallback font - */ - public FileEmojiCompatConfig(@NonNull Context context, - // NEW - @Nullable File fontFile, - @Nullable String fallbackFont) { - super(new FileMetadataLoader(context, - fontFile, - fallbackFont != null ? fallbackFont : FONT_FALLBACK)); - if(fontFile != null && fontFile.exists() && fontFile.canRead()) { - try { - // Is it a font? - Typeface typeface = Typeface.createFromFile(fontFile); - // Is it an EmojiCompat font? - /* - Please note that this will possibly cause a race condition. But all in all it's - better to have a chance of detecting such a non-valid font than either having to - wait for a long time or not being able to detect it at all. - However, since this Thread is started immediately, it should be faster than - the initialization process of EmojiCompat itself... - */ - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { - new Thread(() -> { - try { - MetadataRepo.create(typeface, new FileInputStream(fontFile)); - } catch (Throwable t) { - fallback = true; - setReplaceAll(false); - Log.w(TAG, "FileEmojiCompatConfig: No valid EmojiCompat font provided. Fallback enabled", t); - } - }).start(); - } - } catch (RuntimeException ex) { - fallback = true; - Log.e(TAG, "FileEmojiCompatConfig: Font file corrupt. Fallback enabled", ex); - } - } else { - // The heck, this is not even an actual _file_! - fallback = true; - } - - } - @Override public FileEmojiCompatConfig setReplaceAll(boolean replaceAll) { return setReplaceAll(replaceAll, replaceAllOnFallback); @@ -192,19 +195,19 @@ public class FileEmojiCompatConfig extends EmojiCompat.Config { /** * Replace all emojis - * @param replaceAll Whether all emojis should be replaced + * + * @param replaceAll Whether all emojis should be replaced * @param replaceAllOnFallback true if this is supposed to be the case even when using the fallback font. * Useful if the NoEmojiCompat.ttf is overridden by a "real" EmojiCompat font. * @return This EmojiCompat.Config */ public FileEmojiCompatConfig setReplaceAll(boolean replaceAll, boolean replaceAllOnFallback) { this.replaceAllOnFallback = replaceAllOnFallback; - if(!fallback || replaceAllOnFallback) { + if (!fallback || replaceAllOnFallback) { super.setReplaceAll(replaceAll); - } - else { + } else { super.setReplaceAll(false); - if(replaceAll) { + if (replaceAll) { // If replaceAll would have been set to false anyway, there's no need for apologizing. Log.w(TAG, "setReplaceAll: Cannot replace all emojis. Fallback font is active"); } @@ -216,7 +219,7 @@ public class FileEmojiCompatConfig extends EmojiCompat.Config { * This is the MetadataLoader. Derived from BundledMetadataLoader but with * the addition of a custom file name. */ - private static class FileMetadataLoader implements EmojiCompat.MetadataRepoLoader{ + private static class FileMetadataLoader implements EmojiCompat.MetadataRepoLoader { private final Context mContext; // NEW private final File fontFile; @@ -274,8 +277,7 @@ public class FileEmojiCompatConfig extends EmojiCompat.Config { final InputStream stream = new FileInputStream(FONT_FILE); MetadataRepo resourceIndex = MetadataRepo.create(typeface, stream); loaderCallback.onLoaded(resourceIndex); - } - catch (Throwable t) { + } catch (Throwable t) { // Instead of crashing, this one will first try to load the fallback font try { android.util.Log.w(TAG, "Error while loading the font file.", t); diff --git a/emojicompat/FileMojiCompat/gradle.properties b/emojicompat/FileMojiCompat/gradle.properties index 9fdc93c10..5cbd0ac77 100644 --- a/emojicompat/FileMojiCompat/gradle.properties +++ b/emojicompat/FileMojiCompat/gradle.properties @@ -1,16 +1,12 @@ # Project-wide Gradle settings. - # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. - # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html - # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx1024m - # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects From d058dbc0dd7937c080212233485aa04c2d2806cc Mon Sep 17 00:00:00 2001 From: Constantin A <10349490+C1710@users.noreply.github.com> Date: Fri, 19 Oct 2018 19:01:31 +0200 Subject: [PATCH 3/5] Update CHANGES.md --- CHANGES.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3d3f41030..b35fa4ee3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,8 @@ Due to the fact that I didn't worked with git in mind, ALL emojis have been reup Any other modifications that have been made can be seen in the Git history as these modifications have been made _after_ uploading this repository to Github. +It's totally possible that this list is not complete and it might be broken in some parts since it's in many parts semi-automatically created. + There are currently four types of changes: - `new`: Completely new emojis which do not have to do anything with the original Noto Emoji project. @@ -185,7 +187,6 @@ The entries are currently not in order | ![🥌](https://rawgit.com/googlei18n/noto-emoji/png/128/emoji_u1f94c.png) | ![🥌](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f94c.png) | U+1f94c | goo | | | ![🧥](https://rawgit.com/googlei18n/noto-emoji/png/128/emoji_u1f9e5.png) | ![🧥](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f9e5.png) | U+1f9e5 | goo | | | ![🤫](https://rawgit.com/googlei18n/noto-emoji/e456654119cc3a5f9bebb7bbd00512456f983d2d/png/128/emoji_u1f92b.png) | ![🤫](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f92b.png) | U+1f92b | new* | | -| ![🏳](https://rawgit.com/googlei18n/noto-emoji/e456654119cc3a5f9bebb7bbd00512456f983d2d/png/128/emoji_u1f3f3.png) | ![🏳](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f3f3.png) | U+1f3f3 | new | | | ![🧐](https://rawgit.com/googlei18n/noto-emoji/e456654119cc3a5f9bebb7bbd00512456f983d2d/png/128/emoji_u1f9d0.png) | ![🧐](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f9d0.png) | U+1f9d0 | new* | | | ![🥺](https://rawgit.com/googlei18n/noto-emoji/e456654119cc3a5f9bebb7bbd00512456f983d2d/png/128/emoji_u1f97a.png) | ![🥺](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f97a.png) | U+1f97a | new* | | | ![🥶](https://rawgit.com/googlei18n/noto-emoji/e456654119cc3a5f9bebb7bbd00512456f983d2d/png/128/emoji_u1f976.png) | ![🥶](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f976.png) | U+1f976 | new* | | @@ -327,4 +328,4 @@ The entries are currently not in order | ![🦳](https://rawgit.com/googlei18n/noto-emoji/e456654119cc3a5f9bebb7bbd00512456f983d2d/png/128/emoji_u1f9b3.png) | ![🦳](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f9b3.png) | U+1f9b3 | new | Mostly for Emoji-Compat | | ![🦲](https://rawgit.com/googlei18n/noto-emoji/e456654119cc3a5f9bebb7bbd00512456f983d2d/png/128/emoji_u1f9b2.png) | ![🦲](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f9b2.png) | U+1f9b2 | new | Mostly for Emoji-Compat | | ![🦸](https://rawgit.com/googlei18n/noto-emoji/e456654119cc3a5f9bebb7bbd00512456f983d2d/png/128/emoji_u1f9b8.png) | ![🦸](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f9b8.png) | U+1f9b8 | new* | | -| ![🦹](https://rawgit.com/googlei18n/noto-emoji/e456654119cc3a5f9bebb7bbd00512456f983d2d/png/128/emoji_u1f9b9.png) | ![🦹](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f9b9.png) | U+1f9b9 | new* | | \ No newline at end of file +| ![🦹](https://rawgit.com/googlei18n/noto-emoji/e456654119cc3a5f9bebb7bbd00512456f983d2d/png/128/emoji_u1f9b9.png) | ![🦹](http://rawgit.com/C1710/blobmoji/master/png/128/emoji_u1f9b9.png) | U+1f9b9 | new* | | From 1237f1bf5d83b0a9c785a2b9cad43a85b9934d4e Mon Sep 17 00:00:00 2001 From: Constantin A <10349490+C1710@users.noreply.github.com> Date: Fri, 19 Oct 2018 21:57:48 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e80885db4..03b547a4f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ use 'python setup.py develop' ('install' currently won't fully install all the data used by nototools). You will also need fontTools, get it from https://github.com/behdad/fonttools.git. -Then run make. NotoColorEmoji is the default target. It's suggested to use -j, +Then run `make`. NotoColorEmoji is the default target. It's suggested to use `-j`, especially if you are using zopflipng for compression. Intermediate products (compressed image files, for example) will be put into a build subdirectory; the font will be at the top level. From 0ae2eea35d9f1b8635058536872c020debaa4dba Mon Sep 17 00:00:00 2001 From: Constantin A <10349490+C1710@users.noreply.github.com> Date: Sat, 11 May 2019 22:24:20 +0200 Subject: [PATCH 5/5] Update README.md --- emojicompat/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emojicompat/README.md b/emojicompat/README.md index 374bb974e..608fef867 100644 --- a/emojicompat/README.md +++ b/emojicompat/README.md @@ -1,4 +1,4 @@ -# Please note that all these features (except for the Blobmoji EmojiCompat font itself) are now included in their own library which you can find at [FileMojiCompat](FileMojiCompat). This page (and folder) will be updated soon :sweat_smile: +# Please note that all these features (except for the Blobmoji EmojiCompat font itself) are now included in their own library which you can find at [FileMojiCompat](https://github.com/C1710/FilemojiCompat). This page (and folder) will be updated soon :sweat_smile: ## You can use this font in [EmojiCompat](https://developer.android.com/guide/topics/ui/look-and-feel/emoji-compat.html)! The most important file for this is `NotoEmojiCompat.ttf`. This is the font you'll need. There are three different ways to use this font in EmojiCompat: