jdk/test/java/awt/font/TextLayout/MissingCodePointLayoutTest.java
author ihse
Tue, 09 May 2017 12:57:30 +0200
changeset 45028 b0ea3c0bfb81
parent 43826 ff4d8d468f68
permissions -rw-r--r--
8179889: Fix typographic errors in copyright headers Reviewed-by: erikj, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
43826
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
     1
/*
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
     2
 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
     4
 *
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
     8
 *
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    13
 * accompanied this code).
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    14
 *
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    18
 *
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
45028
b0ea3c0bfb81 8179889: Fix typographic errors in copyright headers
ihse
parents: 43826
diff changeset
    21
 * questions.
43826
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    22
 */
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    23
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    24
/* @test
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    25
 * @summary Verify no exception for unsupported code point.
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    26
 * @bug 8172967
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    27
 */
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    28
import java.awt.Font;
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    29
import java.awt.font.FontRenderContext;
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    30
import java.awt.font.TextLayout;
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    31
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    32
public class MissingCodePointLayoutTest {
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    33
    public static void main(String[] args) {
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    34
        Font font = new Font("Tahoma", Font.PLAIN, 12);
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    35
        String text = "\ude00";
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    36
        FontRenderContext frc = new FontRenderContext(null, false, false);
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    37
        TextLayout layout = new TextLayout(text, font, frc);
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    38
        layout.getCaretShapes(0);
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    39
    }
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    40
}
ff4d8d468f68 8172967: [macosx] Exception while working with layout for text containing unmappable character
prr
parents:
diff changeset
    41