Loading tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java +7 −3 Original line number Diff line number Diff line Loading @@ -314,7 +314,7 @@ public class FontFamily_Delegate { @LayoutlibDelegate /*package*/ static boolean nAddFontFromAssetManager(long builderPtr, AssetManager mgr, String path, int cookie, boolean isAsset) { int cookie, boolean isAsset, int weight, boolean isItalic) { FontFamily_Delegate ffd = sManager.getDelegate(builderPtr); if (ffd == null) { return false; Loading Loading @@ -355,8 +355,12 @@ public class FontFamily_Delegate { Font font = Font.createFont(Font.TRUETYPE_FONT, fontStream); fontInfo = new FontInfo(); fontInfo.mFont = font; if (weight == 0) { fontInfo.mWeight = font.isBold() ? BOLD_FONT_WEIGHT : DEFAULT_FONT_WEIGHT; fontInfo.mIsItalic = font.isItalic(); } else { fontInfo.mWeight = weight; } fontInfo.mIsItalic = weight == 0 ? font.isItalic() : isItalic; ffd.addFont(fontInfo); return true; } catch (IOException e) { Loading Loading
tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java +7 −3 Original line number Diff line number Diff line Loading @@ -314,7 +314,7 @@ public class FontFamily_Delegate { @LayoutlibDelegate /*package*/ static boolean nAddFontFromAssetManager(long builderPtr, AssetManager mgr, String path, int cookie, boolean isAsset) { int cookie, boolean isAsset, int weight, boolean isItalic) { FontFamily_Delegate ffd = sManager.getDelegate(builderPtr); if (ffd == null) { return false; Loading Loading @@ -355,8 +355,12 @@ public class FontFamily_Delegate { Font font = Font.createFont(Font.TRUETYPE_FONT, fontStream); fontInfo = new FontInfo(); fontInfo.mFont = font; if (weight == 0) { fontInfo.mWeight = font.isBold() ? BOLD_FONT_WEIGHT : DEFAULT_FONT_WEIGHT; fontInfo.mIsItalic = font.isItalic(); } else { fontInfo.mWeight = weight; } fontInfo.mIsItalic = weight == 0 ? font.isItalic() : isItalic; ffd.addFont(fontInfo); return true; } catch (IOException e) { Loading