diff options
Diffstat (limited to 'src/java/org/apache/fop/area/inline')
-rw-r--r-- | src/java/org/apache/fop/area/inline/Character.java | 59 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/inline/TextArea.java | 36 |
2 files changed, 82 insertions, 13 deletions
diff --git a/src/java/org/apache/fop/area/inline/Character.java b/src/java/org/apache/fop/area/inline/Character.java index 9630614e0..bed1b194a 100644 --- a/src/java/org/apache/fop/area/inline/Character.java +++ b/src/java/org/apache/fop/area/inline/Character.java @@ -23,15 +23,19 @@ package org.apache.fop.area.inline; * This inline area holds a single character. */ public class Character extends InlineArea { - private char character; + // use a String instead of a character because if this character + // ends a syllable the hyphenation character must be added + private String character; + private int iTextWordSpaceAdjust = 0; + private int iTextLetterSpaceAdjust = 0; /** - * Create a new characater inline area with the given character. + * Create a new character inline area with the given character. * * @param ch the character for this inline area */ public Character(char ch) { - character = ch; + character = new String() + ch; } /** @@ -39,8 +43,55 @@ public class Character extends InlineArea { * * @return the character */ - public char getChar() { + public String getChar() { return character; } + + /** + * Add the hyphenation character and its length. + * + * @param hyphChar the hyphenation character + * @param hyphSize the size of the hyphenation character + */ + public void addHyphen(char hyphChar, int hyphSize) { + character += hyphChar; + this.setIPD(this.getIPD() + hyphSize); + } + + /** + * Get text word space adjust. + * + * @return the text word space adjustment + */ + public int getTextWordSpaceAdjust() { + return iTextWordSpaceAdjust; + } + + /** + * Set text word space adjust. + * + * @param iTWSadjust the text word space adjustment + */ + public void setTextWordSpaceAdjust(int iTWSadjust) { + iTextWordSpaceAdjust = iTWSadjust; + } + + /** + * Get text letter space adjust. + * + * @return the text letter space adjustment + */ + public int getTextLetterSpaceAdjust() { + return iTextLetterSpaceAdjust; + } + + /** + * Set text letter space adjust. + * + * @param iTLSadjust the text letter space adjustment + */ + public void setTextLetterSpaceAdjust(int iTLSadjust) { + iTextLetterSpaceAdjust = iTLSadjust; + } } diff --git a/src/java/org/apache/fop/area/inline/TextArea.java b/src/java/org/apache/fop/area/inline/TextArea.java index 110eaa03f..86bf35838 100644 --- a/src/java/org/apache/fop/area/inline/TextArea.java +++ b/src/java/org/apache/fop/area/inline/TextArea.java @@ -27,7 +27,8 @@ public class TextArea extends InlineArea { * The text for this inline area */ protected String text; - private int iTextSpaceAdjust = 0; + private int iTextWordSpaceAdjust = 0; + private int iTextLetterSpaceAdjust = 0; /** * Create a text inline area @@ -54,21 +55,38 @@ public class TextArea extends InlineArea { } /** - * Get text space adjust. + * Get text word space adjust. * - * @return the text space adjustment + * @return the text word space adjustment */ - public int getTextSpaceAdjust() { - return iTextSpaceAdjust; + public int getTextWordSpaceAdjust() { + return iTextWordSpaceAdjust; } /** - * Set text space adjust. + * Set text word space adjust. * - * @param iTSadjust the text space adjustment + * @param iTWSadjust the text word space adjustment */ - public void setTextSpaceAdjust(int iTSadjust) { - iTextSpaceAdjust = iTSadjust; + public void setTextWordSpaceAdjust(int iTWSadjust) { + iTextWordSpaceAdjust = iTWSadjust; + } + /** + * Get text letter space adjust. + * + * @return the text letter space adjustment + */ + public int getTextLetterSpaceAdjust() { + return iTextLetterSpaceAdjust; + } + + /** + * Set text letter space adjust. + * + * @param iTLSadjust the text letter space adjustment + */ + public void setTextLetterSpaceAdjust(int iTLSadjust) { + iTextLetterSpaceAdjust = iTLSadjust; } } |