Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Derek Sollenberger | 5368eda | 2019-10-25 11:20:03 -0400 | [diff] [blame] | 17 | #undef LOG_TAG |
Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 18 | #define LOG_TAG "Minikin" |
| 19 | |
Ben Wagner | f462c24 | 2015-01-12 14:26:14 -0500 | [diff] [blame] | 20 | #include "SkData.h" |
Ben Wagner | b8e367f | 2015-11-06 11:57:09 -0500 | [diff] [blame] | 21 | #include "SkFontMgr.h" |
Ben Wagner | f462c24 | 2015-01-12 14:26:14 -0500 | [diff] [blame] | 22 | #include "SkRefCnt.h" |
Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 23 | #include "SkTypeface.h" |
| 24 | #include "GraphicsJNI.h" |
Steven Moreland | 2279b25 | 2017-07-19 09:50:45 -0700 | [diff] [blame] | 25 | #include <nativehelper/ScopedPrimitiveArray.h> |
| 26 | #include <nativehelper/ScopedUtfChars.h> |
Raph Levien | d573794 | 2014-06-01 22:52:12 -0700 | [diff] [blame] | 27 | #include "Utils.h" |
Seigo Nonaka | 9ff994d | 2016-11-30 14:04:21 -0800 | [diff] [blame] | 28 | #include "FontUtils.h" |
Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 29 | |
sergeyv | dccca44 | 2016-03-21 15:38:21 -0700 | [diff] [blame] | 30 | #include <hwui/MinikinSkia.h> |
sergeyv | bad9918 | 2016-03-17 11:24:22 -0700 | [diff] [blame] | 31 | #include <hwui/Typeface.h> |
Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 32 | #include <minikin/FontFamily.h> |
Seigo Nonaka | 20866c1 | 2017-10-26 16:02:01 -0700 | [diff] [blame] | 33 | #include <minikin/LocaleList.h> |
Jagadeesh Pakaravoor | b624af3 | 2020-05-01 00:01:40 +0000 | [diff] [blame] | 34 | #include <ui/FatVector.h> |
Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 35 | |
Ben Wagner | b8e367f | 2015-11-06 11:57:09 -0500 | [diff] [blame] | 36 | #include <memory> |
| 37 | |
Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 38 | namespace android { |
| 39 | |
Seigo Nonaka | 8b48e62 | 2017-01-07 15:33:38 +0900 | [diff] [blame] | 40 | struct NativeFamilyBuilder { |
Seigo Nonaka | 5b6347a | 2017-03-31 14:30:05 -0700 | [diff] [blame] | 41 | NativeFamilyBuilder(uint32_t langId, int variant) |
Seigo Nonaka | 0ca492f | 2018-05-25 14:52:22 -0700 | [diff] [blame] | 42 | : langId(langId), variant(static_cast<minikin::FamilyVariant>(variant)) {} |
Seigo Nonaka | 8b48e62 | 2017-01-07 15:33:38 +0900 | [diff] [blame] | 43 | uint32_t langId; |
Seigo Nonaka | 0ca492f | 2018-05-25 14:52:22 -0700 | [diff] [blame] | 44 | minikin::FamilyVariant variant; |
Seigo Nonaka | 8b48e62 | 2017-01-07 15:33:38 +0900 | [diff] [blame] | 45 | std::vector<minikin::Font> fonts; |
Seigo Nonaka | ac873c9 | 2017-03-07 15:34:53 -0800 | [diff] [blame] | 46 | std::vector<minikin::FontVariation> axes; |
Seigo Nonaka | 8b48e62 | 2017-01-07 15:33:38 +0900 | [diff] [blame] | 47 | }; |
| 48 | |
Seigo Nonaka | abe5031 | 2018-02-20 14:49:59 -0800 | [diff] [blame] | 49 | static inline NativeFamilyBuilder* toNativeBuilder(jlong ptr) { |
| 50 | return reinterpret_cast<NativeFamilyBuilder*>(ptr); |
| 51 | } |
| 52 | |
| 53 | static inline FontFamilyWrapper* toFamily(jlong ptr) { |
| 54 | return reinterpret_cast<FontFamilyWrapper*>(ptr); |
| 55 | } |
| 56 | |
| 57 | template<typename Ptr> static inline jlong toJLong(Ptr ptr) { |
| 58 | return reinterpret_cast<jlong>(ptr); |
| 59 | } |
| 60 | |
Roozbeh Pournader | 99975a3 | 2017-08-09 09:42:20 -0700 | [diff] [blame] | 61 | static jlong FontFamily_initBuilder(JNIEnv* env, jobject clazz, jstring langs, jint variant) { |
Seigo Nonaka | 5b6347a | 2017-03-31 14:30:05 -0700 | [diff] [blame] | 62 | NativeFamilyBuilder* builder; |
Roozbeh Pournader | 99975a3 | 2017-08-09 09:42:20 -0700 | [diff] [blame] | 63 | if (langs != nullptr) { |
| 64 | ScopedUtfChars str(env, langs); |
Seigo Nonaka | 20866c1 | 2017-10-26 16:02:01 -0700 | [diff] [blame] | 65 | builder = new NativeFamilyBuilder(minikin::registerLocaleList(str.c_str()), variant); |
Seigo Nonaka | 8b48e62 | 2017-01-07 15:33:38 +0900 | [diff] [blame] | 66 | } else { |
Seigo Nonaka | 20866c1 | 2017-10-26 16:02:01 -0700 | [diff] [blame] | 67 | builder = new NativeFamilyBuilder(minikin::registerLocaleList(""), variant); |
Raph Levien | f9e3d31 | 2014-05-27 16:33:11 -0700 | [diff] [blame] | 68 | } |
Seigo Nonaka | abe5031 | 2018-02-20 14:49:59 -0800 | [diff] [blame] | 69 | return toJLong(builder); |
Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 70 | } |
| 71 | |
Jerome Gaillard | 21e7e2d | 2019-05-14 14:34:46 +0100 | [diff] [blame] | 72 | static jlong FontFamily_create(CRITICAL_JNI_PARAMS_COMMA jlong builderPtr) { |
Seigo Nonaka | 8b48e62 | 2017-01-07 15:33:38 +0900 | [diff] [blame] | 73 | if (builderPtr == 0) { |
| 74 | return 0; |
| 75 | } |
Seigo Nonaka | abe5031 | 2018-02-20 14:49:59 -0800 | [diff] [blame] | 76 | NativeFamilyBuilder* builder = toNativeBuilder(builderPtr); |
Seigo Nonaka | fcd2af9 | 2018-01-30 19:09:28 -0800 | [diff] [blame] | 77 | if (builder->fonts.empty()) { |
| 78 | return 0; |
| 79 | } |
Seigo Nonaka | 5b6347a | 2017-03-31 14:30:05 -0700 | [diff] [blame] | 80 | std::shared_ptr<minikin::FontFamily> family = std::make_shared<minikin::FontFamily>( |
Seigo Nonaka | f69e703 | 2018-11-01 14:30:18 -0700 | [diff] [blame] | 81 | builder->langId, builder->variant, std::move(builder->fonts), |
| 82 | true /* isCustomFallback */); |
Seigo Nonaka | fcd2af9 | 2018-01-30 19:09:28 -0800 | [diff] [blame] | 83 | if (family->getCoverage().length() == 0) { |
Seigo Nonaka | 5b6347a | 2017-03-31 14:30:05 -0700 | [diff] [blame] | 84 | return 0; |
| 85 | } |
Seigo Nonaka | abe5031 | 2018-02-20 14:49:59 -0800 | [diff] [blame] | 86 | return toJLong(new FontFamilyWrapper(std::move(family))); |
Seigo Nonaka | 5b6347a | 2017-03-31 14:30:05 -0700 | [diff] [blame] | 87 | } |
| 88 | |
Seigo Nonaka | abe5031 | 2018-02-20 14:49:59 -0800 | [diff] [blame] | 89 | static void releaseBuilder(jlong builderPtr) { |
| 90 | delete toNativeBuilder(builderPtr); |
Seigo Nonaka | 8b48e62 | 2017-01-07 15:33:38 +0900 | [diff] [blame] | 91 | } |
| 92 | |
Jerome Gaillard | 21e7e2d | 2019-05-14 14:34:46 +0100 | [diff] [blame] | 93 | static jlong FontFamily_getBuilderReleaseFunc(CRITICAL_JNI_PARAMS) { |
Seigo Nonaka | abe5031 | 2018-02-20 14:49:59 -0800 | [diff] [blame] | 94 | return toJLong(&releaseBuilder); |
| 95 | } |
| 96 | |
| 97 | static void releaseFamily(jlong familyPtr) { |
| 98 | delete toFamily(familyPtr); |
| 99 | } |
| 100 | |
Jerome Gaillard | 21e7e2d | 2019-05-14 14:34:46 +0100 | [diff] [blame] | 101 | static jlong FontFamily_getFamilyReleaseFunc(CRITICAL_JNI_PARAMS) { |
Seigo Nonaka | abe5031 | 2018-02-20 14:49:59 -0800 | [diff] [blame] | 102 | return toJLong(&releaseFamily); |
Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 103 | } |
| 104 | |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 105 | static bool addSkTypeface(NativeFamilyBuilder* builder, sk_sp<SkData>&& data, int ttcIndex, |
Seigo Nonaka | 0606a88 | 2018-01-31 19:29:40 -0800 | [diff] [blame] | 106 | jint weight, jint italic) { |
Ben Wagner | 78d58fd | 2020-07-14 16:52:13 +0000 | [diff] [blame] | 107 | FatVector<SkFontArguments::VariationPosition::Coordinate, 2> skVariation; |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 108 | for (const auto& axis : builder->axes) { |
Ben Wagner | 78d58fd | 2020-07-14 16:52:13 +0000 | [diff] [blame] | 109 | skVariation.push_back({axis.axisTag, axis.value}); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | const size_t fontSize = data->size(); |
| 113 | const void* fontPtr = data->data(); |
| 114 | std::unique_ptr<SkStreamAsset> fontData(new SkMemoryStream(std::move(data))); |
| 115 | |
Ben Wagner | 78d58fd | 2020-07-14 16:52:13 +0000 | [diff] [blame] | 116 | SkFontArguments args; |
| 117 | args.setCollectionIndex(ttcIndex); |
| 118 | args.setVariationDesignPosition({skVariation.data(), static_cast<int>(skVariation.size())}); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 119 | |
| 120 | sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); |
Ben Wagner | 78d58fd | 2020-07-14 16:52:13 +0000 | [diff] [blame] | 121 | sk_sp<SkTypeface> face(fm->makeFromStream(std::move(fontData), args)); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 122 | if (face == NULL) { |
| 123 | ALOGE("addFont failed to create font, invalid request"); |
| 124 | builder->axes.clear(); |
| 125 | return false; |
| 126 | } |
Seigo Nonaka | c706414 | 2017-02-10 16:53:31 +0900 | [diff] [blame] | 127 | std::shared_ptr<minikin::MinikinFont> minikinFont = |
Seigo Nonaka | 54c6a27 | 2018-10-25 15:44:32 -0700 | [diff] [blame] | 128 | std::make_shared<MinikinFontSkia>(std::move(face), fontPtr, fontSize, "", ttcIndex, |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 129 | builder->axes); |
Seigo Nonaka | 0606a88 | 2018-01-31 19:29:40 -0800 | [diff] [blame] | 130 | minikin::Font::Builder fontBuilder(minikinFont); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 131 | |
Seigo Nonaka | 0606a88 | 2018-01-31 19:29:40 -0800 | [diff] [blame] | 132 | if (weight != RESOLVE_BY_FONT_TABLE) { |
| 133 | fontBuilder.setWeight(weight); |
Seigo Nonaka | 8b48e62 | 2017-01-07 15:33:38 +0900 | [diff] [blame] | 134 | } |
Seigo Nonaka | 0606a88 | 2018-01-31 19:29:40 -0800 | [diff] [blame] | 135 | if (italic != RESOLVE_BY_FONT_TABLE) { |
| 136 | fontBuilder.setSlant(static_cast<minikin::FontStyle::Slant>(italic != 0)); |
| 137 | } |
| 138 | builder->fonts.push_back(fontBuilder.build()); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 139 | builder->axes.clear(); |
| 140 | return true; |
Raph Levien | d573794 | 2014-06-01 22:52:12 -0700 | [diff] [blame] | 141 | } |
Raph Levien | d573794 | 2014-06-01 22:52:12 -0700 | [diff] [blame] | 142 | |
Ben Wagner | fffcf0a | 2016-01-28 16:05:33 -0500 | [diff] [blame] | 143 | static void release_global_ref(const void* /*data*/, void* context) { |
Derek Sollenberger | c5882c4 | 2019-10-25 11:11:32 -0400 | [diff] [blame] | 144 | JNIEnv* env = GraphicsJNI::getJNIEnv(); |
Ben Wagner | fffcf0a | 2016-01-28 16:05:33 -0500 | [diff] [blame] | 145 | bool needToAttach = (env == NULL); |
| 146 | if (needToAttach) { |
Derek Sollenberger | c5882c4 | 2019-10-25 11:11:32 -0400 | [diff] [blame] | 147 | env = GraphicsJNI::attachJNIEnv("release_font_data"); |
| 148 | if (env == nullptr) { |
Ben Wagner | fffcf0a | 2016-01-28 16:05:33 -0500 | [diff] [blame] | 149 | ALOGE("failed to attach to thread to release global ref."); |
| 150 | return; |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | jobject obj = reinterpret_cast<jobject>(context); |
| 155 | env->DeleteGlobalRef(obj); |
| 156 | |
| 157 | if (needToAttach) { |
Derek Sollenberger | c5882c4 | 2019-10-25 11:11:32 -0400 | [diff] [blame] | 158 | GraphicsJNI::detachJNIEnv(); |
Ben Wagner | fffcf0a | 2016-01-28 16:05:33 -0500 | [diff] [blame] | 159 | } |
| 160 | } |
| 161 | |
Seigo Nonaka | 8b48e62 | 2017-01-07 15:33:38 +0900 | [diff] [blame] | 162 | static jboolean FontFamily_addFont(JNIEnv* env, jobject clazz, jlong builderPtr, jobject bytebuf, |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 163 | jint ttcIndex, jint weight, jint isItalic) { |
Raph Levien | 296bf8c | 2016-04-06 15:23:57 -0700 | [diff] [blame] | 164 | NPE_CHECK_RETURN_ZERO(env, bytebuf); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 165 | NativeFamilyBuilder* builder = reinterpret_cast<NativeFamilyBuilder*>(builderPtr); |
Raph Levien | 296bf8c | 2016-04-06 15:23:57 -0700 | [diff] [blame] | 166 | const void* fontPtr = env->GetDirectBufferAddress(bytebuf); |
| 167 | if (fontPtr == NULL) { |
| 168 | ALOGE("addFont failed to create font, buffer invalid"); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 169 | builder->axes.clear(); |
Raph Levien | 296bf8c | 2016-04-06 15:23:57 -0700 | [diff] [blame] | 170 | return false; |
| 171 | } |
| 172 | jlong fontSize = env->GetDirectBufferCapacity(bytebuf); |
| 173 | if (fontSize < 0) { |
| 174 | ALOGE("addFont failed to create font, buffer size invalid"); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 175 | builder->axes.clear(); |
Raph Levien | 296bf8c | 2016-04-06 15:23:57 -0700 | [diff] [blame] | 176 | return false; |
| 177 | } |
| 178 | jobject fontRef = MakeGlobalRefOrDie(env, bytebuf); |
Ben Wagner | d8b5c31 | 2016-08-03 15:55:25 -0400 | [diff] [blame] | 179 | sk_sp<SkData> data(SkData::MakeWithProc(fontPtr, fontSize, |
Raph Levien | 296bf8c | 2016-04-06 15:23:57 -0700 | [diff] [blame] | 180 | release_global_ref, reinterpret_cast<void*>(fontRef))); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 181 | return addSkTypeface(builder, std::move(data), ttcIndex, weight, isItalic); |
Raph Levien | 296bf8c | 2016-04-06 15:23:57 -0700 | [diff] [blame] | 182 | } |
| 183 | |
Seigo Nonaka | 8b48e62 | 2017-01-07 15:33:38 +0900 | [diff] [blame] | 184 | static jboolean FontFamily_addFontWeightStyle(JNIEnv* env, jobject clazz, jlong builderPtr, |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 185 | jobject font, jint ttcIndex, jint weight, jint isItalic) { |
Ben Wagner | fffcf0a | 2016-01-28 16:05:33 -0500 | [diff] [blame] | 186 | NPE_CHECK_RETURN_ZERO(env, font); |
Seigo Nonaka | abe5031 | 2018-02-20 14:49:59 -0800 | [diff] [blame] | 187 | NativeFamilyBuilder* builder = toNativeBuilder(builderPtr); |
Raph Levien | 296bf8c | 2016-04-06 15:23:57 -0700 | [diff] [blame] | 188 | const void* fontPtr = env->GetDirectBufferAddress(font); |
Ben Wagner | fffcf0a | 2016-01-28 16:05:33 -0500 | [diff] [blame] | 189 | if (fontPtr == NULL) { |
| 190 | ALOGE("addFont failed to create font, buffer invalid"); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 191 | builder->axes.clear(); |
Ben Wagner | b8e367f | 2015-11-06 11:57:09 -0500 | [diff] [blame] | 192 | return false; |
| 193 | } |
Ben Wagner | fffcf0a | 2016-01-28 16:05:33 -0500 | [diff] [blame] | 194 | jlong fontSize = env->GetDirectBufferCapacity(font); |
| 195 | if (fontSize < 0) { |
| 196 | ALOGE("addFont failed to create font, buffer size invalid"); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 197 | builder->axes.clear(); |
Ben Wagner | fffcf0a | 2016-01-28 16:05:33 -0500 | [diff] [blame] | 198 | return false; |
| 199 | } |
| 200 | jobject fontRef = MakeGlobalRefOrDie(env, font); |
Ben Wagner | d8b5c31 | 2016-08-03 15:55:25 -0400 | [diff] [blame] | 201 | sk_sp<SkData> data(SkData::MakeWithProc(fontPtr, fontSize, |
Ben Wagner | fffcf0a | 2016-01-28 16:05:33 -0500 | [diff] [blame] | 202 | release_global_ref, reinterpret_cast<void*>(fontRef))); |
Seigo Nonaka | 20e5d91 | 2017-01-18 20:31:27 +0900 | [diff] [blame] | 203 | return addSkTypeface(builder, std::move(data), ttcIndex, weight, isItalic); |
Raph Levien | 117cbeb | 2014-08-25 13:47:16 -0700 | [diff] [blame] | 204 | } |
| 205 | |
Jerome Gaillard | 21e7e2d | 2019-05-14 14:34:46 +0100 | [diff] [blame] | 206 | static void FontFamily_addAxisValue(CRITICAL_JNI_PARAMS_COMMA jlong builderPtr, jint tag, jfloat value) { |
Seigo Nonaka | abe5031 | 2018-02-20 14:49:59 -0800 | [diff] [blame] | 207 | NativeFamilyBuilder* builder = toNativeBuilder(builderPtr); |
Seigo Nonaka | ac873c9 | 2017-03-07 15:34:53 -0800 | [diff] [blame] | 208 | builder->axes.push_back({static_cast<minikin::AxisTag>(tag), value}); |
| 209 | } |
| 210 | |
Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 211 | /////////////////////////////////////////////////////////////////////////////// |
| 212 | |
Daniel Micay | 76f6a86 | 2015-09-19 17:31:01 -0400 | [diff] [blame] | 213 | static const JNINativeMethod gFontFamilyMethods[] = { |
Seigo Nonaka | abe5031 | 2018-02-20 14:49:59 -0800 | [diff] [blame] | 214 | { "nInitBuilder", "(Ljava/lang/String;I)J", (void*)FontFamily_initBuilder }, |
| 215 | { "nCreateFamily", "(J)J", (void*)FontFamily_create }, |
| 216 | { "nGetBuilderReleaseFunc", "()J", (void*)FontFamily_getBuilderReleaseFunc }, |
| 217 | { "nGetFamilyReleaseFunc", "()J", (void*)FontFamily_getFamilyReleaseFunc }, |
| 218 | { "nAddFont", "(JLjava/nio/ByteBuffer;III)Z", (void*)FontFamily_addFont }, |
| 219 | { "nAddFontWeightStyle", "(JLjava/nio/ByteBuffer;III)Z", |
Ben Wagner | b8e367f | 2015-11-06 11:57:09 -0500 | [diff] [blame] | 220 | (void*)FontFamily_addFontWeightStyle }, |
Seigo Nonaka | ac873c9 | 2017-03-07 15:34:53 -0800 | [diff] [blame] | 221 | { "nAddAxisValue", "(JIF)V", (void*)FontFamily_addAxisValue }, |
Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 222 | }; |
| 223 | |
| 224 | int register_android_graphics_FontFamily(JNIEnv* env) |
| 225 | { |
Ben Wagner | b8e367f | 2015-11-06 11:57:09 -0500 | [diff] [blame] | 226 | int err = RegisterMethodsOrDie(env, "android/graphics/FontFamily", gFontFamilyMethods, |
| 227 | NELEM(gFontFamilyMethods)); |
| 228 | |
Seigo Nonaka | 9ff994d | 2016-11-30 14:04:21 -0800 | [diff] [blame] | 229 | init_FontUtils(env); |
Ben Wagner | b8e367f | 2015-11-06 11:57:09 -0500 | [diff] [blame] | 230 | return err; |
Raph Levien | 1a73f732 | 2014-01-30 16:06:28 -0800 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | } |