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

Surrogate pair characters are rendered incorrectly or not rendered on WebView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8
    • 7u40
    • javafx
    • None
    • Windows 8 (64-bit) + Java 1.7.0_40, and MacOSX 10.8.5 (64-bit) + Java 1.7.0_40

    • web

    Description

      Surrogate pair characters are rendered incorrectly or not rendered on the following program.
      Note: A font file mingliub.ttf (Windows font file) must be installed on the OS (Windows, MacOSX).

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.web.WebView;
      import javafx.stage.Stage;

      public class Main extends Application {
          public final static void main(String[] arguments) {
              Application.launch(arguments);
          }
          @Override
          public void start(Stage stage) throws Exception {
              WebView webView = new WebView();
              webView.getEngine().loadContent("<!DOCTYPE html>\n<html><head></head><body><p style=\"font-family:PMingLiU-ExtB;font-size:200%;text-decoration:underline;\">&#x20000;</p></body></html>");
              webView.setPrefSize(800, 600);
              Scene scene = new Scene(webView);
              stage.setScene(scene);
              stage.sizeToScene();
              stage.show();
          }
      }

      The text part "&#x20000;" is for a character "��" in CJK Unified Ideographs Extension B.
      In the case of "&#x20000;" ... any are not rendered.
      In the case of "��" ... six "?" characters with underline are rendered.
      In the case of "&#xD840;&#xDC00;" ... two "?" characters with underline are rendered.
      In the case of "a&#x20000;" ... "a" and "��" are rendered. "a" is with underline, but "��" is not with underline. And "a" is selectable, but "��" is not selectable.
      In the case of "&#x20000;a" ... "��" and "a" are rendered. The left half of "��" is with underline, and the rest is not with underline, and "a" is not with underline The underline part is selectable and "a" appears on the selecting.
      In the case of "&#x20000;aa" ... "��" and "aa" are rendered. "��" is with underline, "aa" is not with underline. "��" is selectable, but "aa" appears on the selecting.

      Note: On using HTMLEditor instead of WebView, the same characters and underlines are displayed. The cursor moving (and displaying) is incorrectly. But Ctrl+C is valid, and I can copy the character "��" and paste into the clipboard.

      Note2: On Java 8 Build b108 (on MacOSX), these problems seem to be not appeared. On Java 7, will they be fixed?

      Attachments

        Issue Links

          Activity

            People

              peterz Peter Zhelezniakov
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: