Java Code Examples for sun.awt.SunHints#INTVAL_TEXT_ANTIALIAS_GASP

The following examples show how to use sun.awt.SunHints#INTVAL_TEXT_ANTIALIAS_GASP . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SunGraphics2D.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 2
Source File: SunGraphics2D.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 3
Source File: SunGraphics2D.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 4
Source File: SunGraphics2D.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 5
Source File: SunGraphics2D.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 6
Source File: SunGraphics2D.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 7
Source File: SunGraphics2D.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 8
Source File: SunGraphics2D.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 9
Source File: SunGraphics2D.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 10
Source File: SunGraphics2D.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 11
Source File: SunGraphics2D.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 12
Source File: SunGraphics2D.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 13
Source File: SunGraphics2D.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}
 
Example 14
Source File: SunGraphics2D.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setFont(Font font) {
    /* replacing the reference equality test font != this.font with
     * !font.equals(this.font) did not yield any measurable difference
     * in testing, but there may be yet to be identified cases where it
     * is beneficial.
     */
    if (font != null && font!=this.font/*!font.equals(this.font)*/) {
        /* In the GASP AA case the textpipe depends on the glyph size
         * as determined by graphics and font transforms as well as the
         * font size, and information in the font. But we may invalidate
         * the pipe only to find that it made no difference.
         * Deferring pipe invalidation to checkFontInfo won't work because
         * when called we may already be rendering to the wrong pipe.
         * So, if the font is transformed, or the graphics has more than
         * a simple scale, we'll take that as enough of a hint to
         * revalidate everything. But if they aren't we will
         * use the font's point size to query the gasp table and see if
         * what it says matches what's currently being used, in which
         * case there's no need to invalidate the textpipe.
         * This should be sufficient for all typical uses cases.
         */
        if (textAntialiasHint == SunHints.INTVAL_TEXT_ANTIALIAS_GASP &&
            textpipe != invalidpipe &&
            (transformState > TRANSFORM_ANY_TRANSLATE ||
             font.isTransformed() ||
             fontInfo == null || // Precaution, if true shouldn't get here
             (fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
                 FontUtilities.getFont2D(font).
                     useAAForPtSize(font.getSize()))) {
            textpipe = invalidpipe;
        }
        this.font = font;
        this.fontMetrics = null;
        this.validFontInfo = false;
    }
}