Java Code Examples for java.awt.font.FontRenderContext#getFractionalMetricsHint()

The following examples show how to use java.awt.font.FontRenderContext#getFractionalMetricsHint() . 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: Font.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 2
Source File: EditorView.java    From consulo with Apache License 2.0 5 votes vote down vote up
private boolean setFontRenderContext(FontRenderContext context) {
  FontRenderContext contextToSet = context == null ? FontInfo.getFontRenderContext(myEditor.getContentComponent()) : context;
  if (areEqualContexts(myFontRenderContext, contextToSet)) return false;
  myFontRenderContext = contextToSet.getFractionalMetricsHint() == myEditor.myFractionalMetricsHintValue
                        ? contextToSet
                        : new FontRenderContext(contextToSet.getTransform(), contextToSet.getAntiAliasingHint(), myEditor.myFractionalMetricsHintValue);
  return true;
}
 
Example 3
Source File: Font.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 4
Source File: Font.java    From jdk-1.7-annotated with Apache License 2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 5
Source File: Font.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 6
Source File: Font.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 7
Source File: Font.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 8
Source File: Font.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 9
Source File: Font.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 10
Source File: Font.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 11
Source File: Font.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 12
Source File: Font.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 13
Source File: SwingUtilities2.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private static boolean
    isFontRenderContextPrintCompatible(FontRenderContext frc1,
                                       FontRenderContext frc2) {

    if (frc1 == frc2) {
        return true;
    }

    if (frc1 == null || frc2 == null) { // not supposed to happen
        return false;
    }

    if (frc1.getFractionalMetricsHint() !=
        frc2.getFractionalMetricsHint()) {
        return false;
    }

    /* If both are identity, return true */
    if (!frc1.isTransformed() && !frc2.isTransformed()) {
        return true;
    }

    /* That's the end of the cheap tests, need to get and compare
     * the transform matrices. We don't care about the translation
     * components, so return true if they are otherwise identical.
     */
    double[] mat1 = new double[4];
    double[] mat2 = new double[4];
    frc1.getTransform().getMatrix(mat1);
    frc2.getTransform().getMatrix(mat2);
    return
        mat1[0] == mat2[0] &&
        mat1[1] == mat2[1] &&
        mat1[2] == mat2[2] &&
        mat1[3] == mat2[3];
}
 
Example 14
Source File: Font.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 15
Source File: Font.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 16
Source File: Font.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 17
Source File: Font.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 18
Source File: Font.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 19
Source File: Font.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
 
Example 20
Source File: Font.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private float getItalicAngle(FontRenderContext frc) {
    Object aa, fm;
    if (frc == null) {
        aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        fm = RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
    } else {
        aa = frc.getAntiAliasingHint();
        fm = frc.getFractionalMetricsHint();
    }
    return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}