< prev index next >

modules/graphics/src/main/java/com/sun/javafx/font/PrismFontLoader.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, 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

@@ -23,10 +23,11 @@
  * questions.
  */
 
 package com.sun.javafx.font;
 
+import com.sun.javafx.text.FontHelper;
 import javafx.scene.text.*;
 import com.sun.javafx.tk.*;
 import java.lang.reflect.Method;
 import java.net.URL;
 import java.io.InputStream;

@@ -101,11 +102,11 @@
         return null;
     }
 
     @SuppressWarnings("deprecation")
     private Font createFont(PGFont font) {
-        return Font.impl_NativeFont(font,
+        return FontHelper.nativeFont(font,
                                     font.getName(),
                                     font.getFamilyName(),
                                     font.getStyleName(),
                                     font.getSize());
     }

@@ -179,11 +180,11 @@
                        weight.ordinal() >= FontWeight.BOLD.ordinal();
         boolean italic = posture == FontPosture.ITALIC;
         PGFont prismFont = fontFactory.createFont(family, bold, italic, size);
 
         // Create Font and set implementation
-        Font fxFont = Font.impl_NativeFont(prismFont, prismFont.getName(),
+        Font fxFont = FontHelper.nativeFont(prismFont, prismFont.getName(),
                                            prismFont.getFamilyName(),
                                            prismFont.getStyleName(), size);
         return fxFont;
     }
 

@@ -206,16 +207,16 @@
 
         // update the name variable to match what was actually loaded
         String name = prismFont.getName();
         String family = prismFont.getFamilyName();
         String style = prismFont.getStyleName();
-        font.impl_setNativeFont(prismFont, name, family, style);
+        FontHelper.setNativeFont(font, prismFont, name, family, style);
     }
 
     @Override public FontMetrics getFontMetrics(Font font) {
         if (font != null) {
-            PGFont prismFont = (PGFont)font.impl_getNativeFont();
+            PGFont prismFont = (PGFont) FontHelper.getNativeFont(font);
             Metrics metrics = PrismFontUtils.getFontMetrics(prismFont);
             // TODO: what's the difference between ascent and maxAscent?
             float maxAscent = -metrics.getAscent();//metrics.getMaxAscent();
             float ascent = -metrics.getAscent();
             float xheight = metrics.getXHeight();

@@ -228,11 +229,11 @@
             return null; // this should never happen
         }
     }
 
     @Override public float getCharWidth(char ch, Font font) {
-        PGFont prismFont = (PGFont)font.impl_getNativeFont();
+        PGFont prismFont = (PGFont) FontHelper.getNativeFont(font);
         return (float)PrismFontUtils.getCharWidth(prismFont, ch);
     }
 
     @Override public float getSystemFontSize() {
         // PrismFontFactory is what loads the DLL, so we may as
< prev index next >