summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jerome Gaillard <jgaillard@google.com> 2017-05-10 11:22:27 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-05-10 11:22:33 +0000
commit13f6a914c2d2b76f3e703b4c5798674627e28116 (patch)
tree637b6fec9f87bb92b8eb7266e86764d769cf8f72
parent7e87b672f07605420c69e7d8210830f4ec4d4123 (diff)
parentfccc122027c2bc5c590e26dd1d93dac7754dcb4c (diff)
Merge "Modify font metrics computation to match Android"
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java4
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/activity.pngbin35872 -> 36035 bytes
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/allwidgets.pngbin66738 -> 67362 bytes
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/allwidgets_tab.pngbin52245 -> 52614 bytes
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/array_check.pngbin27015 -> 27242 bytes
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/font_test.pngbin51791 -> 52171 bytes
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners.pngbin19503 -> 19542 bytes
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners_translucent.pngbin19391 -> 19497 bytes
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/four_corners_translucent_land.pngbin20951 -> 21113 bytes
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/shadows_test.pngbin11423 -> 11310 bytes
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity-old-theme.pngbin9015 -> 8960 bytes
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity.pngbin8202 -> 8277 bytes
-rw-r--r--tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/simple_activity_noactionbar.pngbin8220 -> 8177 bytes
13 files changed, 2 insertions, 2 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
index 1bb56e3be415..60e5cd99854a 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 @@ public class Paint_Delegate {
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 affc31ee48e2..773c5bee5df4 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 bd7835334a49..4391f47bd35f 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 88fa9ddbd349..bb69ca885d69 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 ee72a6fe27e8..0835d5139f19 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 736b2877355f..7e0c29afd41d 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 a8567b3ef023..ffba2b504560 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 5ae95ea34ad4..b73b359f1270 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 b2b6a970c29f..09fd2790f213 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 4951629a50b6..f1eecf0e2ae8 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 e0abcf412844..b6f373760f5d 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 3d0fbd606188..fd6e6b687906 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 86b00415c3ec..ef207272b464 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