commit | 13f6a914c2d2b76f3e703b4c5798674627e28116 | [log] [tgz] |
---|---|---|
author | Jerome Gaillard <jgaillard@google.com> | Wed May 10 11:22:27 2017 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Wed May 10 11:22:33 2017 +0000 |
tree | 637b6fec9f87bb92b8eb7266e86764d769cf8f72 | |
parent | 7e87b672f07605420c69e7d8210830f4ec4d4123 [diff] | |
parent | fccc122027c2bc5c590e26dd1d93dac7754dcb4c [diff] |
Merge "Modify font metrics computation to match Android"
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java index 1bb56e3..60e5cd9 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
@@ -596,10 +596,10 @@ java.awt.FontMetrics javaMetrics = delegate.mFonts.get(0).mMetrics; if (fmi != null) { // Android expects negative ascent so we invert the value from Java. - fmi.top = - javaMetrics.getMaxAscent(); + fmi.top = (int)(- javaMetrics.getMaxAscent() * 1.15); fmi.ascent = - javaMetrics.getAscent(); fmi.descent = javaMetrics.getDescent(); - fmi.bottom = javaMetrics.getMaxDescent(); + fmi.bottom = (int)(javaMetrics.getMaxDescent() * 1.15); fmi.leading = javaMetrics.getLeading(); }
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/activity.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/activity.png index affc31e..773c5be 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/activity.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/activity.png Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/allwidgets.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/allwidgets.png index bd78353..4391f47 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/allwidgets.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/allwidgets.png Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/allwidgets_tab.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/allwidgets_tab.png index 88fa9dd..bb69ca8 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/allwidgets_tab.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/allwidgets_tab.png Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/array_check.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/array_check.png index ee72a6f..0835d51 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/array_check.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/array_check.png Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/font_test.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/font_test.png index 736b287..7e0c29a 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/font_test.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/font_test.png Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners.png index a8567b3..ffba2b5 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners.png Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners_translucent.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners_translucent.png index 5ae95ea..b73b359 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners_translucent.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners_translucent.png Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners_translucent_land.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners_translucent_land.png index b2b6a97..09fd279 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners_translucent_land.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners_translucent_land.png Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/shadows_test.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/shadows_test.png index 4951629..f1eecf0 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/shadows_test.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/shadows_test.png Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity-old-theme.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity-old-theme.png index e0abcf4..b6f3737 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity-old-theme.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity-old-theme.png Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity.png index 3d0fbd6..fd6e6b6 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity.png Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity_noactionbar.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity_noactionbar.png index 86b00415..ef20727 100644 --- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity_noactionbar.png +++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity_noactionbar.png Binary files differ