691 if (FontUtilities.isLinux) {
692 fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
693 }
694 fontdirs = fontConfigDirs.toArray(new String[0]);
695 }
696
697 // Implements SunGraphicsEnvironment.createFontConfiguration.
698 protected FontConfiguration createFontConfiguration() {
699 /* The logic here decides whether to use a preconfigured
700 * fontconfig.properties file, or synthesise one using platform APIs.
701 * On Solaris we try to use the
702 * pre-configured ones, but if the files it specifies are missing
703 * we fail-safe to synthesising one. This might happen if Solaris
704 * changes its fonts.
705 * For Linux we require an exact match of distro and version to
706 * use the preconfigured file.
707 * If synthesising fails, we fall back to any preconfigured file
708 * and do the best we can.
709 */
710 FontConfiguration mFontConfig = new MFontConfiguration(this);
711 if ((FontUtilities.isLinux && !mFontConfig.foundOsSpecificFile()) ||
712 (FontUtilities.isSolaris && !mFontConfig.fontFilesArePresent())) {
713 FcFontConfiguration fcFontConfig =
714 new FcFontConfiguration(this);
715 if (fcFontConfig.init()) {
716 return fcFontConfig;
717 }
718 }
719 mFontConfig.init();
720 return mFontConfig;
721 }
722
723 public FontConfiguration
724 createFontConfiguration(boolean preferLocaleFonts,
725 boolean preferPropFonts) {
726
727 return new MFontConfiguration(this,
728 preferLocaleFonts, preferPropFonts);
729 }
730
731 protected synchronized String getFontPath(boolean noType1Fonts) {
732 isHeadless(); // make sure GE is inited, as its the X11 lock.
|
691 if (FontUtilities.isLinux) {
692 fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
693 }
694 fontdirs = fontConfigDirs.toArray(new String[0]);
695 }
696
697 // Implements SunGraphicsEnvironment.createFontConfiguration.
698 protected FontConfiguration createFontConfiguration() {
699 /* The logic here decides whether to use a preconfigured
700 * fontconfig.properties file, or synthesise one using platform APIs.
701 * On Solaris we try to use the
702 * pre-configured ones, but if the files it specifies are missing
703 * we fail-safe to synthesising one. This might happen if Solaris
704 * changes its fonts.
705 * For Linux we require an exact match of distro and version to
706 * use the preconfigured file.
707 * If synthesising fails, we fall back to any preconfigured file
708 * and do the best we can.
709 */
710 FontConfiguration mFontConfig = new MFontConfiguration(this);
711 if ((FontUtilities.isLinux && !mFontConfig.foundOsSpecificFile())) {
712 FcFontConfiguration fcFontConfig =
713 new FcFontConfiguration(this);
714 if (fcFontConfig.init()) {
715 return fcFontConfig;
716 }
717 }
718 mFontConfig.init();
719 return mFontConfig;
720 }
721
722 public FontConfiguration
723 createFontConfiguration(boolean preferLocaleFonts,
724 boolean preferPropFonts) {
725
726 return new MFontConfiguration(this,
727 preferLocaleFonts, preferPropFonts);
728 }
729
730 protected synchronized String getFontPath(boolean noType1Fonts) {
731 isHeadless(); // make sure GE is inited, as its the X11 lock.
|