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

WebView does not render woff fonts

    Details

    • Subcomponent:
      web
    • CPU:
      x86_64
    • OS:
      windows_7

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0_60-ea"
        Java(TM) SE Runtime Environment (build 1.8.0_60-ea-b21)
        Java HotSpot(TM) Client VM (build 25.60-b21, mixed mode, sharing)

        A DESCRIPTION OF THE PROBLEM :
        Fonts included via @font-face in woff format are no longer recognized by the WebView control. OTF Fonts are recognized, though. This is a regression as it works in Java 8u45.

        REGRESSION. Last worked in version 8u45

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Install the html code and woff file from below on an WebServer
        2. Run the java class below with Java8 u45.
         -> The second headline will be rendered with the DinPro Font
        3. Run the same class with Java8 u60
         -> The second headline will be rendered with the Default Font


        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        WebViewSample.java:

        import javafx.application.Application;
        import javafx.scene.Scene;
        import javafx.scene.web.WebView;
        import javafx.stage.Stage;
         
         
        public class WebViewSample extends Application {
            
            @Override public void start(Stage stage) {
                // create the scene
                stage.setTitle("Web View");
                WebView webView = new WebView();
                Scene scene = new Scene(webView,750,500);
                webView.getEngine().load("http://localhost/FontTest.html");
                stage.setScene(scene);
                stage.show();
            }
         
            public static void main(String[] args){
                launch(args);
            }

        }


        FontTest.html:

        <!DOCTYPE HTML>
        <html>
          <head>
            <title>Web Font</title>
            <style>
        @font-face {
                font-family: "WOFF-DIN-Regular";
                src: url(/DINWebPro.woff) format("woff");
              }
            </style>
          </head>
          <body>
            <h1>This is a H1 heading styled with default Font</h1>
        <h1 style="font-family: 'WOFF-DIN-Regular';" >This is a H1 heading styled with WOFF-DIN-Regular</h1>
          </body>
        </html>

        DINWebPro.woff is available at:
        http://easyprint.com/_global/fonts/DINWebPro.woff



        ---------- END SOURCE ----------

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ant Anton Tarasov
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: