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

Commit 9382c5a7 authored by Roozbeh Pournader's avatar Roozbeh Pournader Committed by Android (Google) Code Review
Browse files

Merge "Add test for ascent and descent of serif and mono fonts"

parents eb22a929 ede3a17f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.graphics.Paint;
import android.graphics.Typeface;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;

import junit.framework.TestCase;


+0 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ public class GraphicsTests {
        TestSuite suite = new TestSuite(GraphicsTests.class.getName());

        suite.addTestSuite(BitmapTest.class);
        suite.addTestSuite(TypefaceTest.class);
        return suite;
    }
}
+7 −3
Original line number Diff line number Diff line
@@ -558,9 +558,13 @@ def check_vertical_metrics():
    for record in _fallback_chain:
        if record.name in ['sans-serif', 'sans-serif-condensed']:
            font = open_font(record.font)
            assert (font['head'].yMax == 2163 and font['head'].yMin == -555 and
                    font['hhea'].ascent == 1900 and font['hhea'].descent == -500), (
                   'Vertical metrics of %s do not match expected Roboto metrics.' % (record.font,))
            assert font['head'].yMax == 2163 and font['head'].yMin == -555, (
                'yMax and yMin of %s do not match expected values.' % (record.font,))

        if record.name in ['sans-serif', 'sans-serif-condensed', 'serif', 'monospace']:
            font = open_font(record.font)
            assert font['hhea'].ascent == 1900 and font['hhea'].descent == -500, (
                'ascent and descent of %s do not match expected values.' % (record.font,))


def main():