Examples of Hyphenation


Examples of org.apache.fop.hyphenation.Hyphenation

        // Or perhaps in that case, we say that it's several words.
        // We probably should bring the hyphenation props up from the actual
        // TextLM which generate the hyphenation buffer,
        // since these properties inherit and could be specified
        // on an inline or wrapper below the block level.
        Hyphenation hyph
            = Hyphenator.hyphenate(hyphenationProperties.language.getString(),
                               hyphenationProperties.country.getString(),
                               getFObj().getUserAgent().getFactory().getHyphenationTreeResolver(),
                               sbChars.toString(),
                               hyphenationProperties.hyphenationRemainCharacterCount.getValue(),
                               hyphenationProperties.hyphenationPushCharacterCount.getValue());
        // They hyph structure contains the information we need
        // Now start from prev: reset to that position, ask that LM to get
        // a Position for the first hyphenation offset. If the offset isn't in
        // its characters, it returns null,
        // but must tell how many chars it had.
        // Keep looking at currentBP using next hyphenation point until the
        // returned size is greater than the available size
        // or no more hyphenation points remain. Choose the best break.
        if (hyph != null) {
            return new HyphContext(hyph.getHyphenationPoints());
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.apache.fop.hyphenation.Hyphenation

        // Or perhaps in that case, we say that it's several words.
        // We probably should bring the hyphenation props up from the actual
        // TextLM which generate the hyphenation buffer,
        // since these properties inherit and could be specified
        // on an inline or wrapper below the block level.
        Hyphenation hyph
            = Hyphenator.hyphenate(hyphenationProperties.language.getString(),
                               hyphenationProperties.country.getString(),
                               getFObj().getUserAgent().getFactory().getHyphenationTreeResolver(),
                               getFObj().getUserAgent().getFactory().getHyphPatNames(),
                               sbChars.toString(),
                               hyphenationProperties.hyphenationRemainCharacterCount.getValue(),
                               hyphenationProperties.hyphenationPushCharacterCount.getValue());
        // They hyph structure contains the information we need
        // Now start from prev: reset to that position, ask that LM to get
        // a Position for the first hyphenation offset. If the offset isn't in
        // its characters, it returns null,
        // but must tell how many chars it had.
        // Keep looking at currentBP using next hyphenation point until the
        // returned size is greater than the available size
        // or no more hyphenation points remain. Choose the best break.
        if (hyph != null) {
            return new HyphContext(hyph.getHyphenationPoints());
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.apache.fop.hyphenation.Hyphenation

        // Or perhaps in that case, we say that it's several words.
        // We probably should bring the hyphenation props up from the actual
        // TextLM which generate the hyphenation buffer,
        // since these properties inherit and could be specified
        // on an inline or wrapper below the block level.
        Hyphenation hyph
            = Hyphenator.hyphenate(hyphenationProperties.language,
                               hyphenationProperties.country,
                               getFObj().getUserAgent().getFactory().getHyphenationTreeResolver(),
                               sbChars.toString(),
                               hyphenationProperties.hyphenationRemainCharacterCount,
                               hyphenationProperties.hyphenationPushCharacterCount);
        // They hyph structure contains the information we need
        // Now start from prev: reset to that position, ask that LM to get
        // a Position for the first hyphenation offset. If the offset isn't in
        // its characters, it returns null,
        // but must tell how many chars it had.
        // Keep looking at currentBP using next hyphenation point until the
        // returned size is greater than the available size
        // or no more hyphenation points remain. Choose the best break.
        if (hyph != null) {
            return new HyphContext(hyph.getHyphenationPoints());
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.apache.fop.hyphenation.Hyphenation

        // Or perhaps in that case, we say that it's several words.
        // We probably should bring the hyphenation props up from the actual
        // TextLM which generate the hyphenation buffer,
        // since these properties inherit and could be specified
        // on an inline or wrapper below the block level.
        Hyphenation hyph
            = Hyphenator.hyphenate(hyphenationProperties.language,
                               hyphenationProperties.country,
                               getFObj().getUserAgent().getFactory().getHyphenationTreeResolver(),
                               sbChars.toString(),
                               hyphenationProperties.hyphenationRemainCharacterCount,
                               hyphenationProperties.hyphenationPushCharacterCount);
        // They hyph structure contains the information we need
        // Now start from prev: reset to that position, ask that LM to get
        // a Position for the first hyphenation offset. If the offset isn't in
        // its characters, it returns null,
        // but must tell how many chars it had.
        // Keep looking at currentBP using next hyphenation point until the
        // returned size is greater than the available size
        // or no more hyphenation points remain. Choose the best break.
        if (hyph != null) {
            return new HyphContext(hyph.getHyphenationPoints());
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.apache.fop.hyphenation.Hyphenation

        // Or perhaps in that case, we say that it's several words.
        // We probably should bring the hyphenation props up from the actual
        // TextLM which generate the hyphenation buffer,
        // since these properties inherit and could be specified
        // on an inline or wrapper below the block level.
        Hyphenation hyph
            = Hyphenator.hyphenate(hyphenationProperties.language,
                                   hyphenationProperties.country, sbChars.toString(),
                                   hyphenationProperties.hyphenationRemainCharacterCount,
                                   hyphenationProperties.hyphenationPushCharacterCount);
        // They hyph structure contains the information we need
        // Now start from prev: reset to that position, ask that LM to get
        // a Position for the first hyphenation offset. If the offset isn't in
        // its characters, it returns null,
        // but must tell how many chars it had.
        // Keep looking at currentBP using next hyphenation point until the
        // returned size is greater than the available size
        // or no more hyphenation points remain. Choose the best break.
        if (hyph != null) {
            return new HyphContext(hyph.getHyphenationPoints());
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.apache.fop.hyphenation.Hyphenation

        // Or perhaps in that case, we say that it's several words.
        // We probably should bring the hyphenation props up from the actual
        // TextLM which generate the hyphenation buffer,
        // since these properties inherit and could be specified
        // on an inline or wrapper below the block level.
        Hyphenation hyph
            = Hyphenator.hyphenate(hyphenationProperties.language,
                                   hyphenationProperties.country, sbChars.toString(),
                                   hyphenationProperties.hyphenationRemainCharacterCount,
                                   hyphenationProperties.hyphenationPushCharacterCount);
        // They hyph structure contains the information we need
        // Now start from prev: reset to that position, ask that LM to get
        // a Position for the first hyphenation offset. If the offset isn't in
        // its characters, it returns null,
        // but must tell how many chars it had.
        // Keep looking at currentBP using next hyphenation point until the
        // returned size is greater than the available size
        // or no more hyphenation points remain. Choose the best break.
        if (hyph != null) {
            return new HyphContext(hyph.getHyphenationPoints());
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.apache.fop.layout.hyphenation.Hyphenation

                     + this.currentFontState.width(currentFontState.mapChar(inwordPunctuation)));
            }
        }

        // are there any hyphenation points
        Hyphenation hyph =
            Hyphenator.hyphenate(hyphProps.language, hyphProps.country,
                                 wordToHyphenate,
                                 hyphProps.hyphenationRemainCharacterCount,
                                 hyphProps.hyphenationPushCharacterCount);
        // no hyphenation points and no inword non letter character
        if (hyph == null && preString == null) {
            if (remainingString.length() > 0) {
                return wordStart - 1;
            } else {
                return wordStart;
            }

            // no hyphenation points, but a inword non-letter character
        } else if (hyph == null && preString != null) {
            remainingString.append(preString);
            // is.addMapWord(startChar,remainingString);
            this.addWord(startChar, remainingString);
            return wordStart + remainingString.length();
            // hyphenation points and no inword non-letter character
        } else if (hyph != null && preString == null) {
            int index = getFinalHyphenationPoint(hyph, remainingWidth);
            if (index != -1) {
                remainingString.append(hyph.getPreHyphenText(index));
                remainingString.append(this.hyphProps.hyphenationChar);
                // is.addMapWord(startChar,remainingString);
                this.addWord(startChar, remainingString);
                return wordStart + remainingString.length() - 1;
            }
            // hyphenation points and a inword non letter character
        } else if (hyph != null && preString != null) {
            int index = getFinalHyphenationPoint(hyph, remainingWidth);
            if (index != -1) {
                remainingString.append(preString.append(hyph.getPreHyphenText(index)));
                remainingString.append(this.hyphProps.hyphenationChar);
                // is.addMapWord(startChar,remainingString);
                this.addWord(startChar, remainingString);
                return wordStart + remainingString.length() - 1;
            } else {
View Full Code Here

Examples of org.apache.fop.layout.hyphenation.Hyphenation

                remainingWidth -= (getWordWidth(wordToHyphenate) + this.currentFontState.width(inwordPunctuation));
            }
        }

        //are there any hyphenation points
        Hyphenation hyph = Hyphenator.hyphenate(language,country,wordToHyphenate,hyphenationRemainCharacterCount,hyphenationPushCharacterCount);
        //no hyphenation points and no inword non letter character
        if (hyph == null && preString == null) {
            if (remainingString.length() > 0) {
                return wordStart-1;
            } else {
                return wordStart;
            }

        //no hyphenation points, but a inword non-letter character
        } else if (hyph == null && preString != null){
            remainingString.append(preString);
            this.addWord(startChar,remainingString);
            return wordStart + remainingString.length();
        //hyphenation points and no inword non-letter character
        } else if (hyph != null && preString == null)  {
            int index = getFinalHyphenationPoint(hyph,remainingWidth);
            if (index != -1) {
                remainingString.append(hyph.getPreHyphenText(index));
                remainingString.append(this.hyphenationChar);
                this.addWord(startChar,remainingString);
                return wordStart + remainingString.length()-1;
            }
        //hyphenation points and a inword non letter character
        } else if (hyph != null && preString != null) {
            int index = getFinalHyphenationPoint(hyph,remainingWidth);
            if (index != -1) {
              remainingString.append(preString.append(hyph.getPreHyphenText(index)));
              remainingString.append(this.hyphenationChar);
              this.addWord(startChar,remainingString);
              return wordStart + remainingString.length()-1;
            } else {
              remainingString.append(preString) ;
View Full Code Here

Examples of org.apache.fop.layout.hyphenation.Hyphenation

                     + this.currentFontState.width(currentFontState.mapChar(inwordPunctuation)));
            }
        }

        // are there any hyphenation points
        Hyphenation hyph =
            Hyphenator.hyphenate(hyphProps.language, hyphProps.country,
                                 wordToHyphenate,
                                 hyphProps.hyphenationRemainCharacterCount,
                                 hyphProps.hyphenationPushCharacterCount);
        // no hyphenation points and no inword non letter character
        if (hyph == null && preString == null) {
            if (remainingString.length() > 0) {
                return wordStart - 1;
            } else {
                return wordStart;
            }

            // no hyphenation points, but a inword non-letter character
        } else if (hyph == null && preString != null) {
            remainingString.append(preString);
            // is.addMapWord(startChar,remainingString);
            this.addWord(startChar, remainingString);
            return wordStart + remainingString.length();
            // hyphenation points and no inword non-letter character
        } else if (hyph != null && preString == null) {
            int index = getFinalHyphenationPoint(hyph, remainingWidth);
            if (index != -1) {
                remainingString.append(hyph.getPreHyphenText(index));
                remainingString.append(this.hyphProps.hyphenationChar);
                // is.addMapWord(startChar,remainingString);
                this.addWord(startChar, remainingString);
                return wordStart + remainingString.length() - 1;
            }
            // hyphenation points and a inword non letter character
        } else if (hyph != null && preString != null) {
            int index = getFinalHyphenationPoint(hyph, remainingWidth);
            if (index != -1) {
                remainingString.append(preString.append(hyph.getPreHyphenText(index)));
                remainingString.append(this.hyphProps.hyphenationChar);
                // is.addMapWord(startChar,remainingString);
                this.addWord(startChar, remainingString);
                return wordStart + remainingString.length() - 1;
            } else {
View Full Code Here

Examples of org.apache.fop.layout.hyphenation.Hyphenation

                                   this.currentFontState.width(currentFontState.mapChar(inwordPunctuation)));
            }
        }

        //are there any hyphenation points
        Hyphenation hyph = Hyphenator.hyphenate(hyphProps.language,
            hyphProps.country, wordToHyphenate,hyphProps.hyphenationRemainCharacterCount,hyphProps.hyphenationPushCharacterCount);
        //no hyphenation points and no inword non letter character
        if (hyph == null && preString == null) {
            if (remainingString.length() > 0) {
                return wordStart-1;
            } else {
                return wordStart;
            }

        //no hyphenation points, but a inword non-letter character
        } else if (hyph == null && preString != null){
            remainingString.append(preString);
            this.addWord(startChar,remainingString);
            return wordStart + remainingString.length();
        //hyphenation points and no inword non-letter character
        } else if (hyph != null && preString == null)  {
            int index = getFinalHyphenationPoint(hyph,remainingWidth);
            if (index != -1) {
                remainingString.append(hyph.getPreHyphenText(index));
                remainingString.append(this.hyphProps.hyphenationChar);
                this.addWord(startChar,remainingString);
                return wordStart + remainingString.length()-1;
            }
        //hyphenation points and a inword non letter character
        } else if (hyph != null && preString != null) {
            int index = getFinalHyphenationPoint(hyph,remainingWidth);
            if (index != -1) {
              remainingString.append(preString.append(hyph.getPreHyphenText(index)));
              remainingString.append(this.hyphProps.hyphenationChar);
              this.addWord(startChar,remainingString);
              return wordStart + remainingString.length()-1;
            } else {
              remainingString.append(preString) ;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.