< prev index next >
modules/graphics/src/test/java/test/com/sun/javafx/pgstub/StubFontLoader.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2011, 2015, 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
@@ -27,10 +27,11 @@
import com.sun.javafx.font.FontResource;
import com.sun.javafx.font.FontStrike;
import com.sun.javafx.font.PGFont;
import com.sun.javafx.geom.transform.BaseTransform;
+import com.sun.javafx.text.FontHelper;
import com.sun.javafx.tk.FontLoader;
import com.sun.javafx.tk.FontMetrics;
import javafx.scene.text.Font;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontWeight;
@@ -46,38 +47,38 @@
public void loadFont(Font font) {
StubFont nativeFont = new StubFont();
nativeFont.font = font;
String name = font.getName().trim().toLowerCase(Locale.ROOT);
if (name.equals("system") || name.equals("system regular")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "System", "Regular");
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "System", "Regular");
} else if (name.equals("amble regular")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble", "Regular");
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble", "Regular");
} else if (name.equals("amble bold")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble", "Bold");
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble", "Bold");
} else if (name.equals("amble italic")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble", "Italic");
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble", "Italic");
} else if (name.equals("amble bold italic")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble",
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble",
"Bold Italic");
} else if (name.equals("amble condensed")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble Cn", "Regular");
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble Cn", "Regular");
} else if (name.equals("amble bold condensed")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble Cn", "Bold");
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble Cn", "Bold");
} else if (name.equals("amble condensed italic")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble Cn", "Italic");
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble Cn", "Italic");
} else if (name.equals("amble bold condensed italic")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble Cn",
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble Cn",
"Bold Italic");
} else if (name.equals("amble light")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble Lt", "Regular");
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble Lt", "Regular");
} else if (name.equals("amble light italic")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble Lt", "Italic");
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble Lt", "Italic");
} else if (name.equals("amble light condensed")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble LtCn",
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble LtCn",
"Regular");
} else if (name.equals("amble light condensed italic")) {
- font.impl_setNativeFont(nativeFont, font.getName(), "Amble LtCn",
+ FontHelper.setNativeFont(font, nativeFont, font.getName(), "Amble LtCn",
"Italic");
}
}
@Override
< prev index next >