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

Canvas text rendering handles control character inconsistently, such as line feed

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7u6
    • Fix Version/s: 7u6
    • Component/s: javafx
    • Labels:

      Description


      context.font = "24pt Arial";
      context.textAlign = "center";
      context.fillStyle = "blue";
      context.fillText("Hello World!\nand\n3rd Line", x, y);

      The above code snipped will currently render text into multiple lines. But will have inconsistent alignment with JavaFX Text.

      - HTML5 Canvas strips out control characters, and only renders single line of text per fillText(...)
      - JavaFX Text however will create multiple lines and align them according to baseline, origin and wrapping width.

        Attachments

          Activity

            People

            • Assignee:
              thor Thor Johannesson (Inactive)
              Reporter:
              thor Thor Johannesson (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: