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

Webview Font is gibberish if it is not Bolded

XMLWordPrintable

    • web
    • x86_64
    • linux

      ADDITIONAL SYSTEM INFORMATION :
      OS → Redhat 7.4 64 bit
      Java → OpenJDK 11.08-10

      Extra information:
      JavaFX was imported using maven 11.0.2 but the most recent version also showed issues (16-ea+2)


                  <plugin>
                      <groupId>org.openjfx</groupId>
                      <artifactId>javafx-maven-plugin</artifactId>
                      <version>0.0.4</version>
                      <configuration>
                          <mainClass>main.Mainv2</mainClass>
                      </configuration>
                  </plugin>
      ... (All Maven imports were used but for sake of brevity I will just show 1)
              <dependency>
                  <groupId>org.openjfx</groupId>
                  <artifactId>javafx-web</artifactId>
                  <version>11.0.2</version>
              </dependency>

      A DESCRIPTION OF THE PROBLEM :
      All fonts not bolded basically display this weird font that it's not readable, when the font is indeed bolded the font resumes back to "normal"

      REGRESSION : Last worked in version 8

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.Start Application with javafx:run(preview that the font-weight is 400)
      2.Check that the lower line the font is gibberish
      3.Change the font-weight to 800 and restart application
      4.Check that the lower line the font is fine now

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Font should be shown without issues at it happened on Java 8 on version 162 (Last Version of Java 8 that I tested)
      ACTUAL -
      Fonts appear in a weird font type (Like MT Extra on word 16) if you copy the content and paste elsewhere you see that it's really there the desired text but it's display on this gibberish font

      ---------- BEGIN SOURCE ----------
      public class Mainv2 extends Application {
          private static String getSomethingWentWrongHtml() {
              return "<!DOCTYPE html>\n" +
                      "<html>" +
                      "<body style=\"color:blue;font-family: none;font-size:20px;font-weight:400;\">\n" +
                      "<div id=\"maindiv\">\n" +
                      " <h2>Couldn't load User Manual</h1>\n" +
                      " <br>\n" +
                      " <div>Please report this if you can.</div>\n" +
                      "</div>\n" +
                      "</body>\n" +
                      "</html>";
          }

          @Override
          public void start(Stage primaryStage) {
              WebView view = new WebView();

              WebEngine engine = view.getEngine();
              engine.loadContent(getSomethingWentWrongHtml());
              primaryStage.setTitle("ex1");
              primaryStage.setScene(new Scene(view, 300, 250));
              primaryStage.show();
          }


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

      CUSTOMER SUBMITTED WORKAROUND :
      All Fonts be bolded solves the issue (Although the document gets a bit ugly)

      FREQUENCY : always


            ajoseph Arun Joseph (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: