< prev index next >
modules/graphics/src/main/java/com/sun/javafx/font/directwrite/DWFontFile.java
Print this page
@@ -139,6 +139,22 @@
@Override
protected PrismFontStrike<DWFontFile> createStrike(float size, BaseTransform transform,
int aaMode, FontStrikeDesc desc) {
return new DWFontStrike(this, size, transform, aaMode, desc);
}
+
+ /* This is called only for fonts where a temp file was created
+ */
+ @Override
+ protected synchronized void disposeOnShutdown() {
+ if (fontFace != null) {
+ //If this isn't done, Windows won't delete the file, since
+ // DW will have it open.
+ fontFace.Release();
+ if (PrismFontFactory.debugFonts) {
+ System.err.println("fontFace freed: " + fontFace);
+ }
+ fontFace = null;
+ }
+ super.disposeOnShutdown(); // deletes the file.
+ }
}
< prev index next >