Closed AnzerWall closed 3 years ago
it's not FontFamilyName[]?
extern "C" JNIEXPORT jobjectArray JNICALL Java_org_jetbrains_skija_Typeface__1nGetFamilyNames (JNIEnv* env, jclass jclass, jlong ptr) { SkTypeface* instance = reinterpret_cast<SkTypeface*>(static_cast<uintptr_t>(ptr)); SkTypeface::LocalizedStrings* iter = instance->createFamilyNameIterator(); std::vector<SkTypeface::LocalizedString> names; SkTypeface::LocalizedString name; while (iter->next(&name)) { names.push_back(name); } iter->unref(); jobjectArray res = env->NewObjectArray((jsize) names.size(), skija::FontFamilyName::cls, nullptr); for (int i = 0; i < names.size(); ++i) { jstring nameStr = javaString(env, names[i].fString); jstring langStr = javaString(env, names[i].fLanguage); jobject obj = env->NewObject(skija::FontFamilyName::cls, skija::FontFamilyName::ctor, nameStr, langStr); env->SetObjectArrayElement(res, i, obj); } return res; }
public static native Font[] _nGetFamilyNames(long ptr)
what?
public String[] getFamilyNames() { try { Stats.onNativeCall(); return _nGetFamilyNames(_ptr); } finally { Reference.reachabilityFence(this); } }
Probably a mistake. Do you want to provide a patch?
Fixed in 0.91.8. Thank you for reporting!
it's not FontFamilyName[]?
what?
what?