diff --git a/src/main/java/writer2latex/xhtml/TextStyleConverter.java b/src/main/java/writer2latex/xhtml/TextStyleConverter.java
index 8efc857..4cb57ec 100644
--- a/src/main/java/writer2latex/xhtml/TextStyleConverter.java
+++ b/src/main/java/writer2latex/xhtml/TextStyleConverter.java
@@ -71,7 +71,8 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
// Use default font?
private boolean bConvertFont = false;
//convert letter spacing
- private boolean addLetterSpacing = false;
+ private Double minLetterSpacing = null;
+
/** Create a new TextStyleConverter
* @param ofr an OfficeReader
to read style information from
@@ -94,7 +95,11 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
}
}
this.bConvertFont = !config.useDefaultFont();
- this.addLetterSpacing = config.exportLetterSpacing();
+
+ String minLS = config.minLetterSpacing().replaceAll("[a-zA-Z]", "");
+ if (!minLS.equals("")) {
+ this.minLetterSpacing = Double.parseDouble(minLS);
+ }
}
/** Apply a link style, using a combination of two text styles
@@ -387,7 +392,18 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
// Letter spacing: This property fit with css
s = style.getProperty(XMLString.FO_LETTER_SPACING,bInherit);
- if (s!=null && addLetterSpacing ) { props.addValue("letter-spacing",scale(s)); }
+ if ( s != null ) {
+ if ( minLetterSpacing != null ) {
+ String onlyNums = scale(s).replaceAll("[a-zA-Z]", "");
+ Double curLS = Double.parseDouble(onlyNums);
+ if ( minLetterSpacing < curLS ) {
+ props.addValue("letter-spacing",scale(s));
+ }
+ } else {
+ props.addValue("letter-spacing",scale(s));
+ }
+
+ }
// Capitalization: This property fit with css
s = style.getProperty(XMLString.FO_TEXT_TRANSFORM,bInherit);
diff --git a/src/main/java/writer2latex/xhtml/XhtmlConfig.java b/src/main/java/writer2latex/xhtml/XhtmlConfig.java
index 1f47ff5..52e78a5 100644
--- a/src/main/java/writer2latex/xhtml/XhtmlConfig.java
+++ b/src/main/java/writer2latex/xhtml/XhtmlConfig.java
@@ -160,7 +160,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
private static final int DOCUMENT_ICON = 58;
private static final int HEADING_TAGS = 59;
private static final int PAGE_TAGS = 60;
- private static final int EXPORT_LETTER_SPACING = 61;
+ private static final int MIN_LETTER_SPACING = 61;
protected ComplexOption xheading = addComplexOption("heading-map");
protected ComplexOption xpar = addComplexOption("paragraph-map");
@@ -296,7 +296,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
options[DOCUMENT_ICON] = new Option("document_icon","");
options[HEADING_TAGS] = new Option("heading_tags","sections");
options[PAGE_TAGS] = new Option("page_tags","div");
- options[EXPORT_LETTER_SPACING] = new BooleanOption("export_letter_spacing","false");
+ options[MIN_LETTER_SPACING] = new Option("min_letter_spacing","");
}
@@ -446,8 +446,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
}
return options[HEADING_TAGS].getString(); }
public String getPageTags() { return options[PAGE_TAGS].getString(); }
- public boolean exportLetterSpacing() { return ((BooleanOption) options[EXPORT_LETTER_SPACING]).getValue(); }
-
+ public String minLetterSpacing() { return ( options[MIN_LETTER_SPACING]).getString(); }
public XhtmlStyleMap getXParStyleMap() { return getStyleMap(xpar); }
public XhtmlStyleMap getXHeadingStyleMap() { return getStyleMap(xheading); }