mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 02:09:35 +02:00
font families list passed to java style
This commit is contained in:
parent
7ca30d0c9e
commit
fcd2640be7
17 changed files with 78 additions and 29 deletions
|
@ -314,6 +314,18 @@ JNIEXPORT jint JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPlugin
|
|||
}
|
||||
|
||||
// TODO: synchronize FontManager
|
||||
const std::vector<std::vector<std::string> > familyLists = model->fontManager().familyLists();
|
||||
for (std::vector<std::vector<std::string> >::const_iterator it = familyLists.begin(); it != familyLists.end(); ++it) {
|
||||
const std::vector<std::string> &lst = *it;
|
||||
jobjectArray jList = env->NewObjectArray(lst.size(), AndroidUtil::Class_java_lang_String.j(), 0);
|
||||
for (std::size_t i = 0; i < lst.size(); ++i) {
|
||||
jstring jString = AndroidUtil::createJavaString(env, lst[i]);
|
||||
env->SetObjectArrayElement(jList, i, jString);
|
||||
env->DeleteLocalRef(jString);
|
||||
}
|
||||
AndroidUtil::Method_NativeBookModel_registerFontFamilyList->call(javaModel, jList);
|
||||
env->DeleteLocalRef(jList);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue