Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c75aa4cd authored by Kohsuke Yatoh's avatar Kohsuke Yatoh
Browse files

Update usage of FontCollection::getSupportedTags().

Replace getSupportedTags() with getSupportedAxesCount() /
getSupportedAxisAt(), following minikin change.

Bug: 174672300
Test: atest CtsGraphicsTestCases:android.graphics.cts.TypefaceTest
Change-Id: I7959ea903cc73e89589d5f8bb5b5e5900ba6d5db
parent 9d5621ca
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -140,15 +140,13 @@ static void Typeface_setDefault(CRITICAL_JNI_PARAMS_COMMA jlong faceHandle) {

static jobject Typeface_getSupportedAxes(JNIEnv *env, jobject, jlong faceHandle) {
    Typeface* face = toTypeface(faceHandle);
    const std::unordered_set<minikin::AxisTag>& tagSet = face->fFontCollection->getSupportedTags();
    const size_t length = tagSet.size();
    const size_t length = face->fFontCollection->getSupportedAxesCount();
    if (length == 0) {
        return nullptr;
    }
    std::vector<jint> tagVec(length);
    int index = 0;
    for (const auto& tag : tagSet) {
        tagVec[index++] = tag;
    for (size_t i = 0; i < length; i++) {
        tagVec[i] = face->fFontCollection->getSupportedAxisAt(i);
    }
    std::sort(tagVec.begin(), tagVec.end());
    const jintArray result = env->NewIntArray(length);