6943487: NPE in makeMultiCharsetString while printing on linux
Reviewed-by: igor, jgodinez
This commit is contained in:
parent
ee0a2ddfe6
commit
93f31249a1
@ -25,10 +25,10 @@
|
||||
|
||||
package sun.awt;
|
||||
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.peer.FontPeer;
|
||||
import java.util.Locale;
|
||||
import java.util.Vector;
|
||||
import sun.font.SunFontManager;
|
||||
import sun.java2d.FontSupport;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.ByteBuffer;
|
||||
@ -57,9 +57,9 @@ public abstract class PlatformFont implements FontPeer {
|
||||
protected static String osVersion;
|
||||
|
||||
public PlatformFont(String name, int style){
|
||||
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
if (ge instanceof FontSupport) {
|
||||
fontConfig = ((FontSupport)ge).getFontConfiguration();
|
||||
SunFontManager sfm = SunFontManager.getInstance();
|
||||
if (sfm instanceof FontSupport) {
|
||||
fontConfig = ((FontSupport)sfm).getFontConfiguration();
|
||||
}
|
||||
if (fontConfig == null) {
|
||||
return;
|
||||
|
@ -59,17 +59,12 @@ import java.awt.Rectangle;
|
||||
* Headless decorator implementation of a SunGraphicsEnvironment
|
||||
*/
|
||||
|
||||
public class HeadlessGraphicsEnvironment extends GraphicsEnvironment
|
||||
implements FontSupport {
|
||||
public class HeadlessGraphicsEnvironment extends GraphicsEnvironment {
|
||||
|
||||
private GraphicsEnvironment ge;
|
||||
private FontSupport fontSupport;
|
||||
|
||||
public HeadlessGraphicsEnvironment(GraphicsEnvironment ge) {
|
||||
this.ge = ge;
|
||||
if (ge instanceof FontSupport) {
|
||||
fontSupport = (FontSupport)ge;
|
||||
}
|
||||
}
|
||||
|
||||
public GraphicsDevice[] getScreenDevices()
|
||||
@ -101,13 +96,6 @@ public class HeadlessGraphicsEnvironment extends GraphicsEnvironment
|
||||
public String[] getAvailableFontFamilyNames(Locale l) {
|
||||
return ge.getAvailableFontFamilyNames(l); }
|
||||
|
||||
public FontConfiguration getFontConfiguration() {
|
||||
if (fontSupport != null) {
|
||||
return fontSupport.getFontConfiguration();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* Used by FontManager : internal API */
|
||||
public GraphicsEnvironment getSunGraphicsEnvironment() {
|
||||
return ge;
|
||||
|
Loading…
x
Reference in New Issue
Block a user