Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8152430

By using custom fonts the temp files "+JXF[?].tmp" are not removed on exit.

XMLWordPrintable

    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.8.0_74"
      Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
      Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      By using custom fonts the temp files "+JXF[…].tmp" in "C:\Users\[user]\AppData\Local\Temp" are not removed on exit.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Use a custom font in a application.
      2) A temp file "+JXF[…].tmp" will be created in "C:\Users\[user]\AppData\Local\Temp"
      3) Exit the application

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The temp file "+JXF[…].tmp" was deleted.
      ACTUAL -
      The temp file "+JXF[…].tmp" was not deleted.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.naming.ConfigurationException;
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      public class FxFontApplication extends Application {

      private static final String fontName = "ARIAL.ttf";

      public static void main(String[] args) {
      launch(args);
      }

      @Override
      public void start(Stage primaryStage) throws ConfigurationException, IOException {

      loadFontForFX();

      StackPane root = new StackPane();
      root.getChildren().add(new Label("Hello Font"));

      Scene scene = new Scene(root, 300, 200, javafx.scene.paint.Color.ALICEBLUE);

      // No difference with or without css
      // scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());

      primaryStage.setScene(scene);
      primaryStage.show();
      }

      private void loadFontForFX() throws ConfigurationException, IOException {
      InputStream inputStream = FxFontApplication.class.getResourceAsStream(fontName);
      javafx.scene.text.Font loadedFont = javafx.scene.text.Font.loadFont(inputStream, -1);
      if (loadedFont == null) {
      throw new ConfigurationException("Cannot load font for JavaFX from file '" + fontName + "'.");
      }
      inputStream.close();
      }

      }
      ---------- END SOURCE ----------

            prr Philip Race
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: