From 184865deae30e3f5515a3d905ad83765146b54ea Mon Sep 17 00:00:00 2001 From: Nikolay Pultsin Date: Sat, 7 Jun 2014 02:50:00 +0100 Subject: [PATCH] text-decoration, font-weight, font-style, hyphens, text-align settings --- assets/resources/application/ar.xml | 40 ++++++------- assets/resources/application/be.xml | 40 ++++++------- assets/resources/application/bg.xml | 40 ++++++------- assets/resources/application/ca.xml | 40 ++++++------- assets/resources/application/cs.xml | 40 ++++++------- assets/resources/application/da.xml | 40 ++++++------- assets/resources/application/de.xml | 40 ++++++------- assets/resources/application/el.xml | 40 ++++++------- assets/resources/application/en.xml | 40 ++++++------- assets/resources/application/es.xml | 40 ++++++------- assets/resources/application/eu.xml | 40 ++++++------- assets/resources/application/fa.xml | 40 ++++++------- assets/resources/application/fr.xml | 40 ++++++------- assets/resources/application/gl.xml | 40 ++++++------- assets/resources/application/hu.xml | 40 ++++++------- assets/resources/application/hy.xml | 40 ++++++------- assets/resources/application/it.xml | 40 ++++++------- assets/resources/application/ka.xml | 40 ++++++------- assets/resources/application/nb.xml | 40 ++++++------- assets/resources/application/nl.xml | 40 ++++++------- assets/resources/application/pl.xml | 40 ++++++------- assets/resources/application/pt.xml | 40 ++++++------- assets/resources/application/ro.xml | 40 ++++++------- assets/resources/application/ru.xml | 38 ++++++------- assets/resources/application/sr.xml | 40 ++++++------- assets/resources/application/th.xml | 40 ++++++------- assets/resources/application/tr.xml | 40 ++++++------- assets/resources/application/uk.xml | 40 ++++++------- assets/resources/application/vi.xml | 40 ++++++------- assets/resources/application/zh.xml | 40 ++++++------- assets/resources/application/zh_TW.xml | 40 ++++++------- .../preferences/PreferenceActivity.java | 56 +++++++++---------- .../view/style/ZLTextNGStyleDescription.java | 4 +- 33 files changed, 584 insertions(+), 714 deletions(-) diff --git a/assets/resources/application/ar.xml b/assets/resources/application/ar.xml index 5f56b8666..01d697227 100644 --- a/assets/resources/application/ar.xml +++ b/assets/resources/application/ar.xml @@ -400,7 +400,7 @@ - + @@ -410,43 +410,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -459,7 +455,7 @@ - + diff --git a/assets/resources/application/be.xml b/assets/resources/application/be.xml index 8f621fe27..681b904a2 100644 --- a/assets/resources/application/be.xml +++ b/assets/resources/application/be.xml @@ -408,7 +408,7 @@ - + @@ -418,43 +418,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -467,7 +463,7 @@ - + diff --git a/assets/resources/application/bg.xml b/assets/resources/application/bg.xml index 13a08cba5..a92c704ea 100644 --- a/assets/resources/application/bg.xml +++ b/assets/resources/application/bg.xml @@ -407,7 +407,7 @@ - + @@ -417,43 +417,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -466,7 +462,7 @@ - + diff --git a/assets/resources/application/ca.xml b/assets/resources/application/ca.xml index 641a402f2..ef7cbc896 100644 --- a/assets/resources/application/ca.xml +++ b/assets/resources/application/ca.xml @@ -408,7 +408,7 @@ - + @@ -418,43 +418,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -467,7 +463,7 @@ - + diff --git a/assets/resources/application/cs.xml b/assets/resources/application/cs.xml index 02359ae4d..8c321de43 100644 --- a/assets/resources/application/cs.xml +++ b/assets/resources/application/cs.xml @@ -411,7 +411,7 @@ - + @@ -421,43 +421,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -470,7 +466,7 @@ - + diff --git a/assets/resources/application/da.xml b/assets/resources/application/da.xml index e9a7113b4..436197a3b 100644 --- a/assets/resources/application/da.xml +++ b/assets/resources/application/da.xml @@ -402,7 +402,7 @@ - + @@ -412,43 +412,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -461,7 +457,7 @@ - + diff --git a/assets/resources/application/de.xml b/assets/resources/application/de.xml index 62966caaf..9bc41a608 100644 --- a/assets/resources/application/de.xml +++ b/assets/resources/application/de.xml @@ -407,7 +407,7 @@ - + @@ -417,43 +417,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -466,7 +462,7 @@ - + diff --git a/assets/resources/application/el.xml b/assets/resources/application/el.xml index 05cae15c6..f5e460dcb 100644 --- a/assets/resources/application/el.xml +++ b/assets/resources/application/el.xml @@ -392,7 +392,7 @@ - + @@ -402,43 +402,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -451,7 +447,7 @@ - + diff --git a/assets/resources/application/en.xml b/assets/resources/application/en.xml index ef9d4ff83..d0bdb3a44 100644 --- a/assets/resources/application/en.xml +++ b/assets/resources/application/en.xml @@ -402,7 +402,7 @@ - + @@ -412,43 +412,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -461,7 +457,7 @@ - + diff --git a/assets/resources/application/es.xml b/assets/resources/application/es.xml index 685c8a9e5..24a7131eb 100644 --- a/assets/resources/application/es.xml +++ b/assets/resources/application/es.xml @@ -407,7 +407,7 @@ - + @@ -417,43 +417,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -466,7 +462,7 @@ - + diff --git a/assets/resources/application/eu.xml b/assets/resources/application/eu.xml index 9469d3984..4b2243b5f 100644 --- a/assets/resources/application/eu.xml +++ b/assets/resources/application/eu.xml @@ -402,7 +402,7 @@ - + @@ -412,43 +412,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -461,7 +457,7 @@ - + diff --git a/assets/resources/application/fa.xml b/assets/resources/application/fa.xml index 0ed597c18..f1541304b 100644 --- a/assets/resources/application/fa.xml +++ b/assets/resources/application/fa.xml @@ -402,7 +402,7 @@ - + @@ -412,43 +412,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -461,7 +457,7 @@ - + diff --git a/assets/resources/application/fr.xml b/assets/resources/application/fr.xml index 96e7f6785..d2d07310a 100644 --- a/assets/resources/application/fr.xml +++ b/assets/resources/application/fr.xml @@ -395,7 +395,7 @@ - + @@ -405,43 +405,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -454,7 +450,7 @@ - + diff --git a/assets/resources/application/gl.xml b/assets/resources/application/gl.xml index 5c178a9df..d6d7a3ddb 100644 --- a/assets/resources/application/gl.xml +++ b/assets/resources/application/gl.xml @@ -392,7 +392,7 @@ - + @@ -402,43 +402,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -451,7 +447,7 @@ - + diff --git a/assets/resources/application/hu.xml b/assets/resources/application/hu.xml index 1378b265e..701106b25 100644 --- a/assets/resources/application/hu.xml +++ b/assets/resources/application/hu.xml @@ -392,7 +392,7 @@ - + @@ -402,43 +402,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -451,7 +447,7 @@ - + diff --git a/assets/resources/application/hy.xml b/assets/resources/application/hy.xml index 6c451ae7d..361c0e93d 100644 --- a/assets/resources/application/hy.xml +++ b/assets/resources/application/hy.xml @@ -407,7 +407,7 @@ - + @@ -417,43 +417,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -466,7 +462,7 @@ - + diff --git a/assets/resources/application/it.xml b/assets/resources/application/it.xml index 28498ed71..ef24e77a4 100644 --- a/assets/resources/application/it.xml +++ b/assets/resources/application/it.xml @@ -393,7 +393,7 @@ - + @@ -403,43 +403,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -452,7 +448,7 @@ - + diff --git a/assets/resources/application/ka.xml b/assets/resources/application/ka.xml index 7cb4071f7..bd88ee225 100644 --- a/assets/resources/application/ka.xml +++ b/assets/resources/application/ka.xml @@ -407,7 +407,7 @@ - + @@ -417,43 +417,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -466,7 +462,7 @@ - + diff --git a/assets/resources/application/nb.xml b/assets/resources/application/nb.xml index 84f952c97..2e2a0fdd6 100644 --- a/assets/resources/application/nb.xml +++ b/assets/resources/application/nb.xml @@ -402,7 +402,7 @@ - + @@ -412,43 +412,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -461,7 +457,7 @@ - + diff --git a/assets/resources/application/nl.xml b/assets/resources/application/nl.xml index eacd375e8..0c747fe38 100644 --- a/assets/resources/application/nl.xml +++ b/assets/resources/application/nl.xml @@ -402,7 +402,7 @@ - + @@ -412,43 +412,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -461,7 +457,7 @@ - + diff --git a/assets/resources/application/pl.xml b/assets/resources/application/pl.xml index 17c72f709..d77dc3641 100644 --- a/assets/resources/application/pl.xml +++ b/assets/resources/application/pl.xml @@ -392,7 +392,7 @@ - + @@ -402,43 +402,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -451,7 +447,7 @@ - + diff --git a/assets/resources/application/pt.xml b/assets/resources/application/pt.xml index d1c443bf6..354bb84da 100644 --- a/assets/resources/application/pt.xml +++ b/assets/resources/application/pt.xml @@ -404,7 +404,7 @@ - + @@ -414,43 +414,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -463,7 +459,7 @@ - + diff --git a/assets/resources/application/ro.xml b/assets/resources/application/ro.xml index 1e369dfc5..b8d4da438 100644 --- a/assets/resources/application/ro.xml +++ b/assets/resources/application/ro.xml @@ -392,7 +392,7 @@ - + @@ -402,43 +402,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -451,7 +447,7 @@ - + diff --git a/assets/resources/application/ru.xml b/assets/resources/application/ru.xml index acfbcfe7c..cb6002b5a 100644 --- a/assets/resources/application/ru.xml +++ b/assets/resources/application/ru.xml @@ -407,7 +407,7 @@ - + @@ -417,43 +417,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + diff --git a/assets/resources/application/sr.xml b/assets/resources/application/sr.xml index 004942f11..c9aa47123 100644 --- a/assets/resources/application/sr.xml +++ b/assets/resources/application/sr.xml @@ -402,7 +402,7 @@ - + @@ -412,43 +412,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -461,7 +457,7 @@ - + diff --git a/assets/resources/application/th.xml b/assets/resources/application/th.xml index 487ea67c3..be489a667 100644 --- a/assets/resources/application/th.xml +++ b/assets/resources/application/th.xml @@ -392,7 +392,7 @@ - + @@ -402,43 +402,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -451,7 +447,7 @@ - + diff --git a/assets/resources/application/tr.xml b/assets/resources/application/tr.xml index ffef610eb..51cf56279 100644 --- a/assets/resources/application/tr.xml +++ b/assets/resources/application/tr.xml @@ -402,7 +402,7 @@ - + @@ -412,43 +412,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -461,7 +457,7 @@ - + diff --git a/assets/resources/application/uk.xml b/assets/resources/application/uk.xml index f93d0dfb4..56481ca8b 100644 --- a/assets/resources/application/uk.xml +++ b/assets/resources/application/uk.xml @@ -392,7 +392,7 @@ - + @@ -402,43 +402,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -451,7 +447,7 @@ - + diff --git a/assets/resources/application/vi.xml b/assets/resources/application/vi.xml index ca5f94ab5..38dacb71b 100644 --- a/assets/resources/application/vi.xml +++ b/assets/resources/application/vi.xml @@ -392,7 +392,7 @@ - + @@ -402,43 +402,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -451,7 +447,7 @@ - + diff --git a/assets/resources/application/zh.xml b/assets/resources/application/zh.xml index 869448c38..473a16dd7 100644 --- a/assets/resources/application/zh.xml +++ b/assets/resources/application/zh.xml @@ -392,7 +392,7 @@ - + @@ -402,43 +402,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -451,7 +447,7 @@ - + diff --git a/assets/resources/application/zh_TW.xml b/assets/resources/application/zh_TW.xml index ce17b8fef..856556192 100644 --- a/assets/resources/application/zh_TW.xml +++ b/assets/resources/application/zh_TW.xml @@ -392,7 +392,7 @@ - + @@ -402,43 +402,39 @@ - - - + + + - - - + + + - - - - - - - - - + + + + + - + - + - - - + + + @@ -451,7 +447,7 @@ - + diff --git a/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java b/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java index a0b0c3ba8..41a179c6f 100644 --- a/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java +++ b/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java @@ -256,32 +256,6 @@ public class PreferenceActivity extends ZLPreferenceActivity { final Screen moreStylesScreen = textScreen.createPreferenceScreen("more"); /* - final Screen formatScreen = moreStylesScreen.createPreferenceScreen(decoration.Name); - formatScreen.addPreference(new ZLBoolean3Preference( - this, textScreen.Resource, "bold", - decoration.BoldOption - )); - formatScreen.addPreference(new ZLBoolean3Preference( - this, textScreen.Resource, "italic", - decoration.ItalicOption - )); - formatScreen.addPreference(new ZLBoolean3Preference( - this, textScreen.Resource, "underlined", - decoration.UnderlineOption - )); - formatScreen.addPreference(new ZLBoolean3Preference( - this, textScreen.Resource, "strikedThrough", - decoration.StrikeThroughOption - )); - final String[] allAlignments = { "unchanged", "left", "right", "center", "justify" }; - formatScreen.addPreference(new ZLChoicePreference( - this, textScreen.Resource, "alignment", - decoration.AlignmentOption, allAlignments - )); - formatScreen.addPreference(new ZLBoolean3Preference( - this, textScreen.Resource, "allowHyphenations", - decoration.AllowHyphenationsOption - )); final ZLIntegerOption spacePercentOption = decoration.LineSpacePercentOption; final int[] spacingValues = new int[17]; final String[] spacingKeys = new String[17]; @@ -309,10 +283,31 @@ public class PreferenceActivity extends ZLPreferenceActivity { StringPreference.Constraint.POSITIVE_LENGTH, textScreen.Resource, "fontSize" )); - //public final ZLStringOption FontWeightOption; - //public final ZLStringOption FontStyleOption; - //public final ZLStringOption TextDecorationOption; - //public final ZLStringOption HyphenationOption; + ngScreen.addPreference(new ZLStringChoicePreference( + this, textScreen.Resource, "bold", + description.FontWeightOption, + new String[] { "inherit", "normal", "bold" } + )); + ngScreen.addPreference(new ZLStringChoicePreference( + this, textScreen.Resource, "italic", + description.FontStyleOption, + new String[] { "inherit", "normal", "italic" } + )); + ngScreen.addPreference(new ZLStringChoicePreference( + this, textScreen.Resource, "textDecoration", + description.TextDecorationOption, + new String[] { "inherit", "none", "underline", "line-through" } + )); + ngScreen.addPreference(new ZLStringChoicePreference( + this, textScreen.Resource, "allowHyphenations", + description.HyphenationOption, + new String[] { "inherit", "none", "auto" } + )); + ngScreen.addPreference(new ZLStringChoicePreference( + this, textScreen.Resource, "alignment", + description.AlignmentOption, + new String[] { "inherit", "left", "right", "center", "justify" } + )); ngScreen.addPreference(new StringPreference( this, description.MarginTopOption, StringPreference.Constraint.LENGTH, @@ -338,7 +333,6 @@ public class PreferenceActivity extends ZLPreferenceActivity { StringPreference.Constraint.LENGTH, textScreen.Resource, "firstLineIndent" )); - //public final ZLStringOption AlignmentOption; ngScreen.addPreference(new StringPreference( this, description.VerticalAlignOption, StringPreference.Constraint.LENGTH, diff --git a/src/org/geometerplus/zlibrary/text/view/style/ZLTextNGStyleDescription.java b/src/org/geometerplus/zlibrary/text/view/style/ZLTextNGStyleDescription.java index 613b8d24f..244582769 100644 --- a/src/org/geometerplus/zlibrary/text/view/style/ZLTextNGStyleDescription.java +++ b/src/org/geometerplus/zlibrary/text/view/style/ZLTextNGStyleDescription.java @@ -160,7 +160,7 @@ public class ZLTextNGStyleDescription { final String textDecoration = TextDecorationOption.getValue(); if ("underline".equals(textDecoration)) { return ZLBoolean3.B3_TRUE; - } else if ("".equals(textDecoration)) { + } else if ("".equals(textDecoration) || "inherit".equals(textDecoration)) { return ZLBoolean3.B3_UNDEFINED; } else { return ZLBoolean3.B3_FALSE; @@ -170,7 +170,7 @@ public class ZLTextNGStyleDescription { final String textDecoration = TextDecorationOption.getValue(); if ("line-through".equals(textDecoration)) { return ZLBoolean3.B3_TRUE; - } else if ("".equals(textDecoration)) { + } else if ("".equals(textDecoration) || "inherit".equals(textDecoration)) { return ZLBoolean3.B3_UNDEFINED; } else { return ZLBoolean3.B3_FALSE;