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

Commit a4ab320e authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Use variation settings for Typeface creation.

Bug: 35416390
Test: android.graphics.cts.TypefaceTest passed
Change-Id: Ieefa2cf095fb1031d3c7ac99fd59710311d7ede3
parent 503b5ccc
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -358,10 +358,10 @@ public class Typeface {
                        FileChannel.MapMode.READ_ONLY, 0, fontSize);
                int style = result.getStyle();
                int weight = (style & BOLD) != 0 ? 700 : 400;
                // TODO: this method should be
                // create(fd, ttcIndex, fontVariationSettings, style).
                final ArrayList<FontConfig.Axis> axes = FontListParser.parseFontVariationSettings(
                        result.getFontVariationSettings());
                if (!fontFamily.addFontFromBuffer(fontBuffer, result.getTtcIndex(),
                                null, weight,
                                axes.toArray(new FontConfig.Axis[axes.size()]), weight,
                                (style & ITALIC) == 0 ? Builder.NORMAL : Builder.ITALIC)) {
                    Log.e(TAG, "Error creating font " + request.getQuery());
                    callback.onTypefaceRequestFailed(