From bcbeaf83ca75e4a819377938fdf3ec1e07fa30a7 Mon Sep 17 00:00:00 2001 From: Deepanshu Gupta Date: Wed, 19 Feb 2014 11:05:02 -0800 Subject: Set default text style in layoutlib as NORMAL [DO NOT MERGE] If a style doesn't specify text style (normal/bold/italic/bold-italic) then default to normal instead of throwing an error. Bug: http://b.android.com/61358 Change-Id: I0138c73807a5ff6e4d938a99ece3044333110aa1 (cherry-picked from c63e87d53deb24c4286036313db11719173419b3) --- tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java index 2414d70..9b291cf 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java @@ -103,6 +103,9 @@ public final class Typeface_Delegate { if (familyName == null) { familyName = DEFAULT_FAMILY; } + if (style < 0) { + style = Typeface.NORMAL; + } Typeface_Delegate newDelegate = new Typeface_Delegate(familyName, style); if (sFontLoader != null) { -- cgit v1.1