From 14f2876819860eef68397becd954d7ce98397c0f Mon Sep 17 00:00:00 2001 From: Wizard Atman Date: Mon, 6 Apr 2015 06:07:13 +0300 Subject: [PATCH] Text Size Fix --- src/org/idp/laf/TitanEditor.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/org/idp/laf/TitanEditor.java b/src/org/idp/laf/TitanEditor.java index 2bc3174..3429932 100644 --- a/src/org/idp/laf/TitanEditor.java +++ b/src/org/idp/laf/TitanEditor.java @@ -246,14 +246,31 @@ public class TitanEditor { AttributeSetConfigured asc = cluster.get((String) at.getAttribute(const_DisplayName)); if (asc != null) { - res.add(apply_colors(asc, at, annotation)); + if (!at.getAttribute(const_DisplayName).equals("Default")) + { + res.add(apply_colors(asc, at, annotation)); + } + else + { + res.add(apply_text_size_fix(apply_colors(asc, at, annotation))); + } } } } return res; } - private static AttributeSet apply_colors (AttributeSetConfigured asc, AttributeSet at, boolean annotation) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException + private static SimpleAttributeSet apply_text_size_fix (SimpleAttributeSet old) + { + if (old.isDefined(StyleConstants.FontSize)) + { + old.removeAttribute(StyleConstants.FontSize); + } + old.addAttribute(StyleConstants.FontSize, 18); + return old; + } + + private static SimpleAttributeSet apply_colors (AttributeSetConfigured asc, AttributeSet at, boolean annotation) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { SimpleAttributeSet sas = new SimpleAttributeSet(at);