Java 类sun.font.FontResolver 实例源码

项目:OpenJSharp    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:jdk8u-jdk    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:openjdk-jdk10    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:openjdk9    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:Java8CN    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:jdk8u_jdk    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:lookaside_java-1.8.0-openjdk    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:VarJ    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

    Object value = aci.getAttribute(TextAttribute.FONT);
    if (value != null) {
        return (Font) value;
    }
    if (aci.getAttribute(TextAttribute.FAMILY) != null) {
        return Font.getFont(aci.getAttributes());
    }

    int ch = CodePointIterator.create(aci).next();
    if (ch != CodePointIterator.DONE) {
        FontResolver resolver = FontResolver.getInstance();
        return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
    }
    return null;
}
项目:jdk-1.7-annotated    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:infobip-open-jdk-8    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:jdk8u-dev-jdk    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:jdk7-jdk    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:openjdk-source-code-learn    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:OLD-OpenJDK8    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:openjdk-jdk7u-jdk    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:openjdk-icedtea7    文件:TextLine.java   
static Font getFontAtCurrentPos(AttributedCharacterIterator aci) {

        Object value = aci.getAttribute(TextAttribute.FONT);
        if (value != null) {
            return (Font) value;
        }
        if (aci.getAttribute(TextAttribute.FAMILY) != null) {
            return Font.getFont(aci.getAttributes());
        }

        int ch = CodePointIterator.create(aci).next();
        if (ch != CodePointIterator.DONE) {
            FontResolver resolver = FontResolver.getInstance();
            return resolver.getFont(resolver.getFontIndex(ch), aci.getAttributes());
        }
        return null;
    }
项目:OpenJSharp    文件:StyledParagraph.java   
/**
 * Return a StyledParagraph reflecting the insertion of a single character
 * into the text.  This method will attempt to reuse the given paragraph,
 * but may create a new paragraph.
 * @param aci an iterator over the text.  The text should be the same as the
 *     text used to create (or most recently update) oldParagraph, with
 *     the exception of inserting a single character at insertPos.
 * @param chars the characters in aci
 * @param insertPos the index of the new character in aci
 * @param oldParagraph a StyledParagraph for the text in aci before the
 *     insertion
 */
public static StyledParagraph insertChar(AttributedCharacterIterator aci,
                                         char[] chars,
                                         int insertPos,
                                         StyledParagraph oldParagraph) {

    // If the styles at insertPos match those at insertPos-1,
    // oldParagraph will be reused.  Otherwise we create a new
    // paragraph.

    char ch = aci.setIndex(insertPos);
    int relativePos = Math.max(insertPos - aci.getBeginIndex() - 1, 0);

    Map<? extends Attribute, ?> attributes =
        addInputMethodAttrs(aci.getAttributes());
    Decoration d = Decoration.getDecoration(attributes);
    if (!oldParagraph.getDecorationAt(relativePos).equals(d)) {
        return new StyledParagraph(aci, chars);
    }
    Object f = getGraphicOrFont(attributes);
    if (f == null) {
        FontResolver resolver = FontResolver.getInstance();
        int fontIndex = resolver.getFontIndex(ch);
        f = resolver.getFont(fontIndex, attributes);
    }
    if (!oldParagraph.getFontOrGraphicAt(relativePos).equals(f)) {
        return new StyledParagraph(aci, chars);
    }

    // insert into existing paragraph
    oldParagraph.length += 1;
    if (oldParagraph.decorations != null) {
        insertInto(relativePos,
                   oldParagraph.decorationStarts,
                   oldParagraph.decorations.size());
    }
    if (oldParagraph.fonts != null) {
        insertInto(relativePos,
                   oldParagraph.fontStarts,
                   oldParagraph.fonts.size());
    }
    return oldParagraph;
}
项目:OpenJSharp    文件:StyledParagraph.java   
/**
 * Resolve the given chars into Fonts using FontResolver, then add
 * font runs for each.
 */
private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
                      int start, int limit) {

    FontResolver resolver = FontResolver.getInstance();
    CodePointIterator iter = CodePointIterator.create(chars, start, limit);
    for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
        int fontIndex = resolver.nextFontRunIndex(iter);
        addFont(resolver.getFont(fontIndex, attributes), runStart);
    }
}
项目:jdk8u-jdk    文件:StyledParagraph.java   
/**
 * Return a StyledParagraph reflecting the insertion of a single character
 * into the text.  This method will attempt to reuse the given paragraph,
 * but may create a new paragraph.
 * @param aci an iterator over the text.  The text should be the same as the
 *     text used to create (or most recently update) oldParagraph, with
 *     the exception of inserting a single character at insertPos.
 * @param chars the characters in aci
 * @param insertPos the index of the new character in aci
 * @param oldParagraph a StyledParagraph for the text in aci before the
 *     insertion
 */
public static StyledParagraph insertChar(AttributedCharacterIterator aci,
                                         char[] chars,
                                         int insertPos,
                                         StyledParagraph oldParagraph) {

    // If the styles at insertPos match those at insertPos-1,
    // oldParagraph will be reused.  Otherwise we create a new
    // paragraph.

    char ch = aci.setIndex(insertPos);
    int relativePos = Math.max(insertPos - aci.getBeginIndex() - 1, 0);

    Map<? extends Attribute, ?> attributes =
        addInputMethodAttrs(aci.getAttributes());
    Decoration d = Decoration.getDecoration(attributes);
    if (!oldParagraph.getDecorationAt(relativePos).equals(d)) {
        return new StyledParagraph(aci, chars);
    }
    Object f = getGraphicOrFont(attributes);
    if (f == null) {
        FontResolver resolver = FontResolver.getInstance();
        int fontIndex = resolver.getFontIndex(ch);
        f = resolver.getFont(fontIndex, attributes);
    }
    if (!oldParagraph.getFontOrGraphicAt(relativePos).equals(f)) {
        return new StyledParagraph(aci, chars);
    }

    // insert into existing paragraph
    oldParagraph.length += 1;
    if (oldParagraph.decorations != null) {
        insertInto(relativePos,
                   oldParagraph.decorationStarts,
                   oldParagraph.decorations.size());
    }
    if (oldParagraph.fonts != null) {
        insertInto(relativePos,
                   oldParagraph.fontStarts,
                   oldParagraph.fonts.size());
    }
    return oldParagraph;
}
项目:jdk8u-jdk    文件:StyledParagraph.java   
/**
 * Resolve the given chars into Fonts using FontResolver, then add
 * font runs for each.
 */
private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
                      int start, int limit) {

    FontResolver resolver = FontResolver.getInstance();
    CodePointIterator iter = CodePointIterator.create(chars, start, limit);
    for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
        int fontIndex = resolver.nextFontRunIndex(iter);
        addFont(resolver.getFont(fontIndex, attributes), runStart);
    }
}
项目:openjdk-jdk10    文件:StyledParagraph.java   
/**
 * Return a StyledParagraph reflecting the insertion of a single character
 * into the text.  This method will attempt to reuse the given paragraph,
 * but may create a new paragraph.
 * @param aci an iterator over the text.  The text should be the same as the
 *     text used to create (or most recently update) oldParagraph, with
 *     the exception of inserting a single character at insertPos.
 * @param chars the characters in aci
 * @param insertPos the index of the new character in aci
 * @param oldParagraph a StyledParagraph for the text in aci before the
 *     insertion
 */
public static StyledParagraph insertChar(AttributedCharacterIterator aci,
                                         char[] chars,
                                         int insertPos,
                                         StyledParagraph oldParagraph) {

    // If the styles at insertPos match those at insertPos-1,
    // oldParagraph will be reused.  Otherwise we create a new
    // paragraph.

    char ch = aci.setIndex(insertPos);
    int relativePos = Math.max(insertPos - aci.getBeginIndex() - 1, 0);

    Map<? extends Attribute, ?> attributes =
        addInputMethodAttrs(aci.getAttributes());
    Decoration d = Decoration.getDecoration(attributes);
    if (!oldParagraph.getDecorationAt(relativePos).equals(d)) {
        return new StyledParagraph(aci, chars);
    }
    Object f = getGraphicOrFont(attributes);
    if (f == null) {
        FontResolver resolver = FontResolver.getInstance();
        int fontIndex = resolver.getFontIndex(ch);
        f = resolver.getFont(fontIndex, attributes);
    }
    if (!oldParagraph.getFontOrGraphicAt(relativePos).equals(f)) {
        return new StyledParagraph(aci, chars);
    }

    // insert into existing paragraph
    oldParagraph.length += 1;
    if (oldParagraph.decorations != null) {
        insertInto(relativePos,
                   oldParagraph.decorationStarts,
                   oldParagraph.decorations.size());
    }
    if (oldParagraph.fonts != null) {
        insertInto(relativePos,
                   oldParagraph.fontStarts,
                   oldParagraph.fonts.size());
    }
    return oldParagraph;
}
项目:openjdk-jdk10    文件:StyledParagraph.java   
/**
 * Resolve the given chars into Fonts using FontResolver, then add
 * font runs for each.
 */
private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
                      int start, int limit) {

    FontResolver resolver = FontResolver.getInstance();
    CodePointIterator iter = CodePointIterator.create(chars, start, limit);
    for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
        int fontIndex = resolver.nextFontRunIndex(iter);
        addFont(resolver.getFont(fontIndex, attributes), runStart);
    }
}
项目:openjdk9    文件:TextLayout.java   
private static Font singleFont(char[] text,
                               int start,
                               int limit,
                               Map<? extends Attribute, ?> attributes) {

    if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
        return null;
    }

    Font font = null;
    try {
        font = (Font)attributes.get(TextAttribute.FONT);
    }
    catch (ClassCastException e) {
    }
    if (font == null) {
        if (attributes.get(TextAttribute.FAMILY) != null) {
            font = Font.getFont(attributes);
            if (font.canDisplayUpTo(text, start, limit) != -1) {
                return null;
            }
        } else {
            FontResolver resolver = FontResolver.getInstance();
            CodePointIterator iter = CodePointIterator.create(text, start, limit);
            int fontIndex = resolver.nextFontRunIndex(iter);
            if (iter.charIndex() == limit) {
                font = resolver.getFont(fontIndex, attributes);
            }
        }
    }

    if (sameBaselineUpTo(font, text, start, limit) != limit) {
        return null;
    }

    return font;
}
项目:openjdk9    文件:StyledParagraph.java   
/**
 * Resolve the given chars into Fonts using FontResolver, then add
 * font runs for each.
 */
private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
                      int start, int limit) {

    FontResolver resolver = FontResolver.getInstance();
    CodePointIterator iter = CodePointIterator.create(chars, start, limit);
    for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
        int fontIndex = resolver.nextFontRunIndex(iter);
        addFont(resolver.getFont(fontIndex, attributes), runStart);
    }
}
项目:Java8CN    文件:TextLayout.java   
private static Font singleFont(char[] text,
                               int start,
                               int limit,
                               Map<? extends Attribute, ?> attributes) {

    if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
        return null;
    }

    Font font = null;
    try {
        font = (Font)attributes.get(TextAttribute.FONT);
    }
    catch (ClassCastException e) {
    }
    if (font == null) {
        if (attributes.get(TextAttribute.FAMILY) != null) {
            font = Font.getFont(attributes);
            if (font.canDisplayUpTo(text, start, limit) != -1) {
                return null;
            }
        } else {
            FontResolver resolver = FontResolver.getInstance();
            CodePointIterator iter = CodePointIterator.create(text, start, limit);
            int fontIndex = resolver.nextFontRunIndex(iter);
            if (iter.charIndex() == limit) {
                font = resolver.getFont(fontIndex, attributes);
            }
        }
    }

    if (sameBaselineUpTo(font, text, start, limit) != limit) {
        return null;
    }

    return font;
}
项目:Java8CN    文件:StyledParagraph.java   
/**
 * Resolve the given chars into Fonts using FontResolver, then add
 * font runs for each.
 */
private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
                      int start, int limit) {

    FontResolver resolver = FontResolver.getInstance();
    CodePointIterator iter = CodePointIterator.create(chars, start, limit);
    for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
        int fontIndex = resolver.nextFontRunIndex(iter);
        addFont(resolver.getFont(fontIndex, attributes), runStart);
    }
}
项目:jdk8u_jdk    文件:TextLayout.java   
private static Font singleFont(char[] text,
                               int start,
                               int limit,
                               Map<? extends Attribute, ?> attributes) {

    if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
        return null;
    }

    Font font = null;
    try {
        font = (Font)attributes.get(TextAttribute.FONT);
    }
    catch (ClassCastException e) {
    }
    if (font == null) {
        if (attributes.get(TextAttribute.FAMILY) != null) {
            font = Font.getFont(attributes);
            if (font.canDisplayUpTo(text, start, limit) != -1) {
                return null;
            }
        } else {
            FontResolver resolver = FontResolver.getInstance();
            CodePointIterator iter = CodePointIterator.create(text, start, limit);
            int fontIndex = resolver.nextFontRunIndex(iter);
            if (iter.charIndex() == limit) {
                font = resolver.getFont(fontIndex, attributes);
            }
        }
    }

    if (sameBaselineUpTo(font, text, start, limit) != limit) {
        return null;
    }

    return font;
}
项目:jdk8u_jdk    文件:StyledParagraph.java   
/**
 * Resolve the given chars into Fonts using FontResolver, then add
 * font runs for each.
 */
private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
                      int start, int limit) {

    FontResolver resolver = FontResolver.getInstance();
    CodePointIterator iter = CodePointIterator.create(chars, start, limit);
    for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
        int fontIndex = resolver.nextFontRunIndex(iter);
        addFont(resolver.getFont(fontIndex, attributes), runStart);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:TextLayout.java   
private static Font singleFont(char[] text,
                               int start,
                               int limit,
                               Map<? extends Attribute, ?> attributes) {

    if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
        return null;
    }

    Font font = null;
    try {
        font = (Font)attributes.get(TextAttribute.FONT);
    }
    catch (ClassCastException e) {
    }
    if (font == null) {
        if (attributes.get(TextAttribute.FAMILY) != null) {
            font = Font.getFont(attributes);
            if (font.canDisplayUpTo(text, start, limit) != -1) {
                return null;
            }
        } else {
            FontResolver resolver = FontResolver.getInstance();
            CodePointIterator iter = CodePointIterator.create(text, start, limit);
            int fontIndex = resolver.nextFontRunIndex(iter);
            if (iter.charIndex() == limit) {
                font = resolver.getFont(fontIndex, attributes);
            }
        }
    }

    if (sameBaselineUpTo(font, text, start, limit) != limit) {
        return null;
    }

    return font;
}
项目:lookaside_java-1.8.0-openjdk    文件:StyledParagraph.java   
/**
 * Resolve the given chars into Fonts using FontResolver, then add
 * font runs for each.
 */
private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
                      int start, int limit) {

    FontResolver resolver = FontResolver.getInstance();
    CodePointIterator iter = CodePointIterator.create(chars, start, limit);
    for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
        int fontIndex = resolver.nextFontRunIndex(iter);
        addFont(resolver.getFont(fontIndex, attributes), runStart);
    }
}
项目:VarJ    文件:TextLayout.java   
private static Font singleFont(char[] text,
                               int start,
                               int limit,
                               Map attributes) {

    if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
        return null;
    }

    Font font = null;
    try {
        font = (Font)attributes.get(TextAttribute.FONT);
    }
    catch (ClassCastException e) {
    }
    if (font == null) {
        if (attributes.get(TextAttribute.FAMILY) != null) {            
            font = Font.getFont(attributes);
            if (font.canDisplayUpTo(text, start, limit) != -1) {
                return null;
            }
        } else {
            FontResolver resolver = FontResolver.getInstance();
            CodePointIterator iter = CodePointIterator.create(text, start, limit);
            int fontIndex = resolver.nextFontRunIndex(iter);
            if (iter.charIndex() == limit) {
                font = resolver.getFont(fontIndex, attributes);
            }
        }
    }

    if (sameBaselineUpTo(font, text, start, limit) != limit) {
        return null;
    }

    return font;
}
项目:VarJ    文件:StyledParagraph.java   
/**
    * Resolve the given chars into Fonts using FontResolver, then add
    * font runs for each.
    */
   private void addFonts(char[] chars, Map attributes, int start, int limit) {

       FontResolver resolver = FontResolver.getInstance();
CodePointIterator iter = CodePointIterator.create(chars, start, limit);
for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
    int fontIndex = resolver.nextFontRunIndex(iter);
           addFont(resolver.getFont(fontIndex, attributes), runStart);
       }
   }
项目:jdk-1.7-annotated    文件:TextLayout.java   
private static Font singleFont(char[] text,
                               int start,
                               int limit,
                               Map attributes) {

    if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
        return null;
    }

    Font font = null;
    try {
        font = (Font)attributes.get(TextAttribute.FONT);
    }
    catch (ClassCastException e) {
    }
    if (font == null) {
        if (attributes.get(TextAttribute.FAMILY) != null) {
            font = Font.getFont(attributes);
            if (font.canDisplayUpTo(text, start, limit) != -1) {
                return null;
            }
        } else {
            FontResolver resolver = FontResolver.getInstance();
            CodePointIterator iter = CodePointIterator.create(text, start, limit);
            int fontIndex = resolver.nextFontRunIndex(iter);
            if (iter.charIndex() == limit) {
                font = resolver.getFont(fontIndex, attributes);
            }
        }
    }

    if (sameBaselineUpTo(font, text, start, limit) != limit) {
        return null;
    }

    return font;
}
项目:jdk-1.7-annotated    文件:StyledParagraph.java   
/**
 * Resolve the given chars into Fonts using FontResolver, then add
 * font runs for each.
 */
private void addFonts(char[] chars, Map attributes, int start, int limit) {

    FontResolver resolver = FontResolver.getInstance();
    CodePointIterator iter = CodePointIterator.create(chars, start, limit);
    for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
        int fontIndex = resolver.nextFontRunIndex(iter);
        addFont(resolver.getFont(fontIndex, attributes), runStart);
    }
}
项目:infobip-open-jdk-8    文件:TextLayout.java   
private static Font singleFont(char[] text,
                               int start,
                               int limit,
                               Map<? extends Attribute, ?> attributes) {

    if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
        return null;
    }

    Font font = null;
    try {
        font = (Font)attributes.get(TextAttribute.FONT);
    }
    catch (ClassCastException e) {
    }
    if (font == null) {
        if (attributes.get(TextAttribute.FAMILY) != null) {
            font = Font.getFont(attributes);
            if (font.canDisplayUpTo(text, start, limit) != -1) {
                return null;
            }
        } else {
            FontResolver resolver = FontResolver.getInstance();
            CodePointIterator iter = CodePointIterator.create(text, start, limit);
            int fontIndex = resolver.nextFontRunIndex(iter);
            if (iter.charIndex() == limit) {
                font = resolver.getFont(fontIndex, attributes);
            }
        }
    }

    if (sameBaselineUpTo(font, text, start, limit) != limit) {
        return null;
    }

    return font;
}
项目:infobip-open-jdk-8    文件:StyledParagraph.java   
/**
 * Resolve the given chars into Fonts using FontResolver, then add
 * font runs for each.
 */
private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
                      int start, int limit) {

    FontResolver resolver = FontResolver.getInstance();
    CodePointIterator iter = CodePointIterator.create(chars, start, limit);
    for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
        int fontIndex = resolver.nextFontRunIndex(iter);
        addFont(resolver.getFont(fontIndex, attributes), runStart);
    }
}
项目:jdk8u-dev-jdk    文件:TextLayout.java   
private static Font singleFont(char[] text,
                               int start,
                               int limit,
                               Map<? extends Attribute, ?> attributes) {

    if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
        return null;
    }

    Font font = null;
    try {
        font = (Font)attributes.get(TextAttribute.FONT);
    }
    catch (ClassCastException e) {
    }
    if (font == null) {
        if (attributes.get(TextAttribute.FAMILY) != null) {
            font = Font.getFont(attributes);
            if (font.canDisplayUpTo(text, start, limit) != -1) {
                return null;
            }
        } else {
            FontResolver resolver = FontResolver.getInstance();
            CodePointIterator iter = CodePointIterator.create(text, start, limit);
            int fontIndex = resolver.nextFontRunIndex(iter);
            if (iter.charIndex() == limit) {
                font = resolver.getFont(fontIndex, attributes);
            }
        }
    }

    if (sameBaselineUpTo(font, text, start, limit) != limit) {
        return null;
    }

    return font;
}
项目:jdk8u-dev-jdk    文件:StyledParagraph.java   
/**
 * Resolve the given chars into Fonts using FontResolver, then add
 * font runs for each.
 */
private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
                      int start, int limit) {

    FontResolver resolver = FontResolver.getInstance();
    CodePointIterator iter = CodePointIterator.create(chars, start, limit);
    for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
        int fontIndex = resolver.nextFontRunIndex(iter);
        addFont(resolver.getFont(fontIndex, attributes), runStart);
    }
}
项目:jdk7-jdk    文件:TextLayout.java   
private static Font singleFont(char[] text,
                               int start,
                               int limit,
                               Map attributes) {

    if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
        return null;
    }

    Font font = null;
    try {
        font = (Font)attributes.get(TextAttribute.FONT);
    }
    catch (ClassCastException e) {
    }
    if (font == null) {
        if (attributes.get(TextAttribute.FAMILY) != null) {
            font = Font.getFont(attributes);
            if (font.canDisplayUpTo(text, start, limit) != -1) {
                return null;
            }
        } else {
            FontResolver resolver = FontResolver.getInstance();
            CodePointIterator iter = CodePointIterator.create(text, start, limit);
            int fontIndex = resolver.nextFontRunIndex(iter);
            if (iter.charIndex() == limit) {
                font = resolver.getFont(fontIndex, attributes);
            }
        }
    }

    if (sameBaselineUpTo(font, text, start, limit) != limit) {
        return null;
    }

    return font;
}
项目:jdk7-jdk    文件:StyledParagraph.java   
/**
 * Resolve the given chars into Fonts using FontResolver, then add
 * font runs for each.
 */
private void addFonts(char[] chars, Map attributes, int start, int limit) {

    FontResolver resolver = FontResolver.getInstance();
    CodePointIterator iter = CodePointIterator.create(chars, start, limit);
    for (int runStart = iter.charIndex(); runStart < limit; runStart = iter.charIndex()) {
        int fontIndex = resolver.nextFontRunIndex(iter);
        addFont(resolver.getFont(fontIndex, attributes), runStart);
    }
}