0N/A/*
2362N/A * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage sun.font;
0N/A
0N/Aimport sun.java2d.SunGraphicsEnvironment;
0N/A
0N/Apublic class FontManagerNativeLibrary {
0N/A static {
0N/A java.security.AccessController.doPrivileged(
0N/A new java.security.PrivilegedAction() {
0N/A public Object run() {
0N/A /* REMIND do we really have to load awt here? */
0N/A System.loadLibrary("awt");
1686N/A if (FontUtilities.isOpenJDK &&
0N/A System.getProperty("os.name").startsWith("Windows")) {
0N/A /* Ideally fontmanager library should not depend on
0N/A particular implementation of the font scaler.
0N/A However, freetype scaler is basically small wrapper on
0N/A top of freetype library (that is used in binary form).
0N/A
0N/A This wrapper is compiled into fontmanager and this make
0N/A fontmanger library depending on freetype library.
0N/A
0N/A On Windows DLL's in the JRE's BIN directory cannot be
0N/A found by windows DLL loading as that directory is not
0N/A on the Windows PATH.
0N/A
0N/A To avoid link error we have to load freetype explicitly
0N/A before we load fontmanager.
0N/A
0N/A Note that we do not need to do this for T2K because
0N/A fontmanager.dll does not depend on t2k.dll.
0N/A
0N/A NB: consider moving freetype wrapper part to separate
0N/A shared library in order to avoid dependency. */
0N/A System.loadLibrary("freetype");
0N/A }
0N/A System.loadLibrary("fontmanager");
0N/A
0N/A return null;
0N/A }
0N/A });
0N/A }
0N/A
0N/A /*
0N/A * Call this method to ensure libraries are loaded.
0N/A *
0N/A * Method acts as trigger to ensure this class is loaded
0N/A * (and therefore initializer code is executed).
0N/A * Actual loading is performed by static initializer.
0N/A * (no need to execute doPrivilledged block more than once)
0N/A */
0N/A public static void load() {}
0N/A}