From 1a93e4ae130864cda6de2d39f7fc4c4afd9a2a41 Mon Sep 17 00:00:00 2001 From: Emux Date: Mon, 12 Dec 2016 11:35:04 +0200 Subject: [PATCH] TextStyle improvements --- vtm/src/org/oscim/theme/styles/TextStyle.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/vtm/src/org/oscim/theme/styles/TextStyle.java b/vtm/src/org/oscim/theme/styles/TextStyle.java index eed0d676..707d747e 100644 --- a/vtm/src/org/oscim/theme/styles/TextStyle.java +++ b/vtm/src/org/oscim/theme/styles/TextStyle.java @@ -186,8 +186,8 @@ public final class TextStyle extends RenderStyle { this.bitmap = text.bitmap; this.texture = text.texture; this.fillColor = text.paint.getColor(); - this.fontFamily = FontFamily.DEFAULT; - this.fontStyle = FontStyle.NORMAL; + this.fontFamily = text.fontFamily; + this.fontStyle = text.fontStyle; if (text.stroke != null) { this.strokeColor = text.stroke.getColor(); this.strokeWidth = text.stroke.getStrokeWidth(); @@ -230,6 +230,8 @@ public final class TextStyle extends RenderStyle { } else stroke = null; + this.fontFamily = tb.fontFamily; + this.fontStyle = tb.fontStyle; this.fontSize = tb.fontSize; this.symbolWidth = tb.symbolWidth; @@ -239,7 +241,9 @@ public final class TextStyle extends RenderStyle { public final String style; - public final float fontSize; + public final FontFamily fontFamily; + public final FontStyle fontStyle; + public float fontSize; public final Paint paint; public final Paint stroke; public final String textKey; @@ -282,9 +286,10 @@ public final class TextStyle extends RenderStyle { @Override public void scaleTextSize(float scaleFactor) { - paint.setTextSize(fontSize * scaleFactor); + fontSize *= scaleFactor; + paint.setTextSize(fontSize); if (stroke != null) - stroke.setTextSize(fontSize * scaleFactor); + stroke.setTextSize(fontSize); fontHeight = paint.getFontHeight(); fontDescent = paint.getFontDescent();