Skip to content

Commit 8fa2183

Browse files
committed
added method to get the FRC
1 parent f0367e4 commit 8fa2183

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

core/src/processing/core/PGraphics.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
package processing.core;
2727

2828
import java.awt.Color;
29+
import java.awt.Font;
2930
import java.awt.Image;
31+
import java.awt.Toolkit;
32+
import java.awt.font.FontRenderContext;
3033
import java.util.HashMap;
3134
import java.util.WeakHashMap;
3235

@@ -4797,6 +4800,15 @@ protected void textCharScreenImpl(PImage glyph,
47974800
}
47984801

47994802

4803+
/**
4804+
* Convenience method to jump through some Java2D hoops and get an FRC.
4805+
*/
4806+
@SuppressWarnings("deprecation")
4807+
public FontRenderContext getFontRenderContext(Font font) {
4808+
return Toolkit.getDefaultToolkit().getFontMetrics(font).getFontRenderContext();
4809+
}
4810+
4811+
48004812

48014813
//////////////////////////////////////////////////////////////
48024814

0 commit comments

Comments
 (0)