src/share/classes/sun/font/FontScaler.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 80,106 **** * this (and this is probably more important for Type1 fonts). */ public abstract class FontScaler implements DisposerRecord { private static FontScaler nullScaler = null; ! private static Constructor<FontScaler> scalerConstructor = null; //Find preferred font scaler // //NB: we can allow property based preferences // (theoretically logic can be font type specific) static { ! Class scalerClass = null; ! Class arglst[] = new Class[] {Font2D.class, int.class, boolean.class, int.class}; try { ! if (FontUtilities.isOpenJDK) { ! scalerClass = Class.forName("sun.font.FreetypeFontScaler"); ! } else { ! scalerClass = Class.forName("sun.font.T2KFontScaler"); ! } } catch (ClassNotFoundException e) { scalerClass = NullFontScaler.class; } //NB: rewrite using factory? constructor is ugly way --- 80,107 ---- * this (and this is probably more important for Type1 fonts). */ public abstract class FontScaler implements DisposerRecord { private static FontScaler nullScaler = null; ! private static Constructor<? extends FontScaler> scalerConstructor = null; //Find preferred font scaler // //NB: we can allow property based preferences // (theoretically logic can be font type specific) static { ! Class<? extends FontScaler> scalerClass = null; ! Class<?>[] arglst = new Class<?>[] {Font2D.class, int.class, boolean.class, int.class}; try { ! @SuppressWarnings("unchecked") ! Class<? extends FontScaler> tmp = (Class<? extends FontScaler>) ! (FontUtilities.isOpenJDK ? ! Class.forName("sun.font.FreetypeFontScaler") : ! Class.forName("sun.font.T2KFontScaler")); ! scalerClass = tmp; } catch (ClassNotFoundException e) { scalerClass = NullFontScaler.class; } //NB: rewrite using factory? constructor is ugly way