﻿{"id":2454,"date":"2017-12-20T10:24:28","date_gmt":"2017-12-20T01:24:28","guid":{"rendered":"http:\/\/yucchi.jp\/blog\/?p=2454"},"modified":"2017-12-20T10:25:28","modified_gmt":"2017-12-20T01:25:28","slug":"javafx-9-%e3%81%a7-fontmetrics-%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"http:\/\/yucchi.jp\/blog\/?p=2454","title":{"rendered":"JavaFX 9 \u3067 FontMetrics \u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"<p>\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u306f\u3001<a href=\"https:\/\/qiita.com\/advent-calendar\/2017\/javafx\">JavaFX Advent Calendar 2017<\/a> \u306e 20 \u65e5\u76ee\u3067\u3059\u3002  <\/p>\n<p>\u73fe\u6642\u70b9\u3067\u3082\u30a8\u30f3\u30c8\u30ea\u30fc\u304c\u7121\u3044\u306e\u3067\u6025\u907d\u5148\u65e5\u906d\u9047\u3057\u305f\u554f\u984c\u306b\u89e3\u6c7a\u7b56\u3092\u6559\u3048\u3066\u3044\u305f\u3060\u3044\u305f\u306e\u3067\u305d\u308c\u3092\u8a18\u4e8b\u306b\u3057\u307e\u3057\u305f\u3002  <\/p>\n<p>\u6628\u65e5\u306f <a href=\"https:\/\/twitter.com\/aoetk\">@<b>aoetk<\/b> <\/a>\u3055\u3093\u306e\u300c<a href=\"http:\/\/aoe-tk.hatenablog.com\/entry\/2017\/12\/19\/000437\">Bean Validation\u306eJavaFX\u5bfe\u5fdc<\/a>\u300d\u3067\u3057\u305f\u3002  <\/p>\n<p>\u660e\u65e5\u3082\u3001\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u308b\u73fe\u6642\u70b9\u3067\u306f\u307e\u3060\u7a7a\u3044\u3066\u307e\u3059\u3002(^_^;\u3000\u304d\u3063\u3068\u8ab0\u304b\u304c\u7d20\u6575\u306a\u8a18\u4e8b\u3092\u6295\u7a3f\u3057\u3066\u304f\u308c\u308b\u3068\u697d\u3057\u307f\u306b\u3057\u3066\u3044\u307e\u3059\u3002  <\/p>\n<p>11 \u6708\u304b\u3089 IBM Cloud (Bluemix)\u30e9\u30a4\u30c8\u30fb\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u6c17\u697d\u306b\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a Watson Personality Insights \u3092\u5229\u7528\u3057\u305f\u4eba\u683c\u8a3a\u65ad\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d44\u3093\u3067\u697d\u3057\u3093\u3067\u3044\u307e\u3057\u305f\u3002  <\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/pi.png\"><img loading=\"lazy\" decoding=\"async\" title=\"pi\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"pi\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/pi_thumb.png\" width=\"644\" height=\"331\"><\/a>&nbsp; <\/p>\n<p>\u305d\u306e\u969b\u306b Canvas \u306b\u6587\u5b57\u3092\u63cf\u304f\u3068\u304d\u306e\u4f4d\u7f6e\u6c7a\u3081\u306b\u96e3\u5100\u3057\u305f\u306e\u3067 FontMetrics \u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u03c6(\uff0e\uff0e)\u30e1\u30e2\u30e1\u30e2  <\/p>\n<p>\u307e\u305a\u3001Java \u3067 FontMetrics \u3092\u53d6\u5f97\u3059\u308b\u3068\u3057\u305f\u3089 java.awt.FontMetrics \u30af\u30e9\u30b9\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002  <\/p>\n<p>Abstract Window Toolkit \u3092\u4f7f\u3063\u3066\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d44\u3093\u3067\u307f\u307e\u3057\u305f\u3002 <\/p>\n<pre title=\"TextOfCanvas.java\"><code>\r\npackage jp.yucchi.textofcanvas;\r\n\r\nimport java.awt.BorderLayout;\r\nimport java.awt.Canvas;\r\nimport java.awt.Color;\r\nimport java.awt.Font;\r\nimport java.awt.FontMetrics;\r\nimport java.awt.Frame;\r\nimport java.awt.Graphics;\r\nimport java.awt.GraphicsEnvironment;\r\nimport java.awt.event.WindowAdapter;\r\nimport java.awt.event.WindowEvent;\r\nimport java.util.stream.Stream;\r\nimport jp.yucchi.textofcanvas.TextOfCanvas.Configuration;\r\n\r\n\/**\r\n *\r\n * @author Yucchi\r\n *\/\r\npublic class TextOfCanvas extends Frame {\r\n\r\n    protected enum Configuration {\r\n        WIDTH(800),\r\n        HEIGHT(300),\r\n        FONT_SIZE(100);\r\n\r\n        int settingValue;\r\n\r\n        private Configuration(int settingValue) {\r\n            this.settingValue = settingValue;\r\n        }\r\n\r\n        public int getSettingValue() {\r\n            return settingValue;\r\n        }\r\n    }\r\n\r\n    public static void main(String[] args) {\r\n        TextOfCanvas textOfCanvas = new TextOfCanvas();\r\n\/\/        \/\/ \u4f7f\u7528\u53ef\u80fd\u306a\u30d5\u30a9\u30f3\u30c8       \r\n\/\/        Stream.of(GraphicsEnvironment.getLocalGraphicsEnvironment()\r\n\/\/                .getAvailableFontFamilyNames())\r\n\/\/                .forEach(System.out::println);\r\n    }\r\n\r\n    private Frame frame;\r\n\r\n    TextOfCanvas() {\r\n        initGUI();\r\n    }\r\n\r\n    private void initGUI() {\r\n        frame = new Frame(\"Java AWT Text of Canvas\");\r\n        frame.setSize(Configuration.WIDTH.settingValue, Configuration.HEIGHT.settingValue);\r\n        frame.setLayout(new BorderLayout());\r\n        frame.addWindowListener(new WindowAdapter() {\r\n            @Override\r\n            public void windowClosing(WindowEvent we) {\r\n                System.exit(0);\r\n            }\r\n        });\r\n        TextCanvas textCanvas = new TextCanvas();\r\n        frame.add(textCanvas, BorderLayout.CENTER);\r\n        frame.setLocationRelativeTo(null);\r\n        frame.setVisible(true);\r\n    }\r\n\r\n}\r\n\r\nclass TextCanvas extends Canvas {\r\n\r\n    @Override\r\n    public void paint(Graphics g) {\r\n        g.setColor(Color.LIGHT_GRAY);\r\n        g.drawLine(0, Configuration.HEIGHT.settingValue \/ 2, Configuration.WIDTH.settingValue, Configuration.HEIGHT.settingValue \/ 2);\r\n        g.drawLine(Configuration.WIDTH.settingValue \/ 4, 0, Configuration.WIDTH.settingValue \/ 4, Configuration.HEIGHT.settingValue);\r\n\/\/        Font font = new java.awt.Font(\"\u3042\u304f\u3073\u3093\", java.awt.Font.BOLD, Configuration.FONT_SIZE.settingValue); \/\/ Leading: 0.0\r\n        Font font = new java.awt.Font(\"SansSerif\", java.awt.Font.BOLD, Configuration.FONT_SIZE.settingValue);\r\n        g.setFont(font);\r\n        g.setColor(Color.RED);\r\n        g.drawString(\"Japan \u65e5\u672c\", Configuration.WIDTH.settingValue \/ 4, Configuration.HEIGHT.settingValue \/ 2);\r\n\r\n        FontMetrics fontmetrics = g.getFontMetrics();\r\n        double height = fontmetrics.getHeight(); \/\/ \u30c6\u30ad\u30b9\u30c81\u884c\u306e\u6a19\u6e96\u306e\u9ad8\u3055 Height = Ascent + Descent + Leading\r\n        double width = fontmetrics.stringWidth(\"Japan \u65e5\u672c\");\r\n        double ascent = fontmetrics.getAscent(); \/\/ \u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u304b\u3089\u306e\u9ad8\u3055\r\n        double descent = fontmetrics.getDescent(); \/\/ \u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u304b\u3089\u4e0b\u306b\u306f\u307f\u51fa\u308b\u91cf\r\n\/\/        double maxDecent = fontmetrics.getMaxDecent(); \/\/ \u30b9\u30da\u30eb\u30df\u30b9\u306b\u3088\u308b @Deprecated (^_^;\r\n        double leading = fontmetrics.getLeading(); \/\/ \u524d\u306e\u884c\u306e descent \u306e\u30e9\u30a4\u30f3\u3068\u6b21\u306e\u884c\u306e ascent \u306e\u30e9\u30a4\u30f3\u306e\u9593\u306b\u5fc5\u8981\u306a\u300c\u884c\u9593\u300d\u306e\u91cf\r\n        System.out.println(\"Height: \" + height);\r\n        System.out.println(\"Width: \" + width);\r\n        System.out.println(\"Ascent: \" + ascent);\r\n        System.out.println(\"Descent: \" + descent);\r\n        System.out.println(\"Leading: \" + leading);\r\n\r\n        Font currentFont = g.getFont();\r\n        Font shrinkFont = currentFont.deriveFont(currentFont.getSize() * 0.3F);\r\n        g.setFont(shrinkFont);\r\n        g.setColor(Color.GREEN);\r\n        g.drawLine(0, (int) (Configuration.HEIGHT.settingValue \/ 2 - ascent),\r\n                Configuration.WIDTH.settingValue, (int) (Configuration.HEIGHT.settingValue \/ 2 - ascent));\r\n        g.drawString(\"Ascent: \" + ascent, 0, (int) (Configuration.HEIGHT.settingValue \/ 2 - height + descent));\r\n        g.setColor(Color.BLUE);\r\n        g.drawLine(0, (int) (Configuration.HEIGHT.settingValue \/ 2 + descent),\r\n                Configuration.WIDTH.settingValue, (int) (Configuration.HEIGHT.settingValue \/ 2 + descent));\r\n        g.drawString(\"Descent: \" + descent, 0, (int) (Configuration.HEIGHT.settingValue \/ 2 + descent - leading));\r\n        g.setColor(Color.magenta);\r\n        g.drawLine(0, (int) (Configuration.HEIGHT.settingValue \/ 2 + leading + descent),\r\n                Configuration.WIDTH.settingValue, (int) (Configuration.HEIGHT.settingValue \/ 2 + leading + descent));\r\n        g.drawString(\"Leading: \" + leading,\r\n                0, (int) (Configuration.HEIGHT.settingValue \/ 2 + leading * 2 + descent + g.getFontMetrics().getAscent() - g.getFontMetrics().getDescent()));\r\n    }\r\n}\r\n\r\n<\/code><\/pre>\n<p>\u61d0\u304b\u3057\u3044\u30b3\u30fc\u30c9\u3067\u3059\u306d\u3002 <\/p>\n<p>83 \u884c\u76ee\u3067 FontMetrics \u3092 Graphics \u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3088\u308a\u53d6\u5f97\u3057\u3066\u30d5\u30a9\u30f3\u30c8\u306e\u69cb\u9020\u30c7\u30fc\u30bf\u3092\u305d\u308c\u305e\u308c\u306e\u53d6\u5f97\u30e1\u30bd\u30c3\u30c9\u3067\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002 <\/p>\n<p>\u539f\u70b9\u306e X, Y \u5ea7\u6a19\u306b\u8584\u3044\u30b0\u30ec\u30fc\u3067\u30e9\u30a4\u30f3\u3092\u3072\u3044\u3066\u307e\u3059\u3002 <\/p>\n<p>\u30d5\u30a9\u30f3\u30c8\u306e\u9ad8\u3055\u95a2\u3059\u308b\u30c7\u30fc\u30bf\u3082\u305d\u308c\u305e\u308c\u30e9\u30a4\u30f3\u3092\u3072\u3044\u3066\u307f\u307e\u3057\u305f\u3002 <\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/awt.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"awt\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"awt\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/awt_thumb.png\" width=\"834\" height=\"340\"><\/a> <\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/awt2.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"awt2\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"awt2\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/awt2_thumb.png\" width=\"249\" height=\"173\"><\/a> <\/p>\n<p>Abstract Window Toolkit \u3092\u4f7f\u3063\u3066 FontMetrics \u3092\u5f97\u308b\u3053\u3068\u306f\u7c21\u5358\u306b\u3067\u304d\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002 <\/p>\n<p>\u305d\u308c\u3067\u306f JavaFX 9 \u3067\u306f\u3069\u3046\u3067\u3057\u3087\u3046\u304b\uff1f <\/p>\n<p>\u540c\u3058\u3088\u3046\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d44\u3093\u3067\u3057\u307e\u3057\u305f\u3002 <\/p>\n<pre title=\"TextCoordinates.java\"><code>\r\npackage jp.yucchi.textcoordinates;\r\n\r\nimport com.sun.javafx.tk.FontMetrics;\r\nimport com.sun.javafx.tk.Toolkit;\r\nimport java.awt.GraphicsEnvironment;\r\nimport java.util.stream.Stream;\r\nimport javafx.application.Application;\r\nimport javafx.geometry.VPos;\r\nimport javafx.scene.Group;\r\nimport javafx.scene.Scene;\r\nimport javafx.scene.canvas.Canvas;\r\nimport javafx.scene.canvas.GraphicsContext;\r\nimport javafx.scene.paint.Color;\r\nimport javafx.scene.text.Font;\r\nimport javafx.scene.text.FontSmoothingType;\r\nimport javafx.scene.text.FontWeight;\r\nimport javafx.scene.text.Text;\r\nimport javafx.stage.Stage;\r\n\r\n\/**\r\n *\r\n * @author Yucchi\r\n *\/\r\npublic class TextCoordinates extends Application {\r\n\r\n    private enum Configuration {\r\n        WIDTH(800),\r\n        HEIGHT(300),\r\n        FONT_SIZE(100);\r\n        private final int settingValue;\r\n\r\n        private Configuration(int settingValue) {\r\n            this.settingValue = settingValue;\r\n        }\r\n\r\n        public int getSettingValue() {\r\n            return settingValue;\r\n        }\r\n    }\r\n\r\n    @Override\r\n    public void start(Stage primaryStage) {\r\n\r\n\/\/        \/\/ \u4f7f\u7528\u53ef\u80fd\u306a\u30d5\u30a9\u30f3\u30c8       \r\n\/\/        Stream.of(GraphicsEnvironment.getLocalGraphicsEnvironment()\r\n\/\/                .getAvailableFontFamilyNames())\r\n\/\/                .forEach(System.out::println);\r\n\r\n        Group root = new Group();\r\n        Canvas canvas = new Canvas(Configuration.WIDTH.settingValue, Configuration.HEIGHT.settingValue);\r\n        GraphicsContext gc = canvas.getGraphicsContext2D();\r\n        drawShapes(gc);\r\n        root.getChildren().add(canvas);\r\n        Scene scene = new Scene(root, Configuration.WIDTH.settingValue, Configuration.HEIGHT.settingValue);\r\n        primaryStage.setTitle(\"JavaFX Text of Canvas\");\r\n        primaryStage.setScene(scene);\r\n        primaryStage.show();\r\n    }\r\n\r\n    public static void main(String[] args) {\r\n        launch(args);\r\n    }\r\n\r\n    private void drawShapes(GraphicsContext gc) {\r\n\r\n        Text text = new Text(\"Japan \u65e5\u672c\");\r\n\r\n\/\/        Font font = Font.font(\"\u3042\u304f\u3073\u3093\", FontWeight.BOLD, Configuration.FONT_SIZE.settingValue); \/\/ Leading: 0.0\r\n        Font font = Font.font(\"SansSerif\", FontWeight.BOLD, Configuration.FONT_SIZE.settingValue);\r\n        text.setFont(font);\r\n\r\n        double width = text.getBoundsInLocal().getWidth();\r\n        double height = text.getBoundsInLocal().getHeight();\r\n        double baselineOffset = text.getBaselineOffset();\r\n        double minY = text.getLayoutBounds().getMinY();\r\n        double maxY = text.getLayoutBounds().getMaxY();\r\n        System.out.println(\"Width: \" + width);\r\n        System.out.println(\"Height: \" + height); \/\/ Ascent + Descent\r\n        System.out.println(\"BaselineOffset: \" + baselineOffset);  \/\/ Ascent\r\n        System.out.println(\"MinY: \" + minY); \/\/ -Ascent\r\n        System.out.println(\"MaxY: \" + maxY); \/\/ Descent\r\n\r\n        final FontMetrics fontMetrics = Toolkit.getToolkit().getFontLoader().getFontMetrics(font);\r\n\/\/        float fontMetricsWidth = fontMetrics.computeStringWidth(text.getText()); \/\/ JavaFX9 \u3067\u306f\u7121\u304f\u306a\u3063\u305f\uff1f\r\n        \/\/ \u3053\u306e\u30d5\u30a9\u30f3\u30c8\u3067\u306e\u30c6\u30ad\u30b9\u30c8\u884c\u306e\u305f\u3081\u306e\u6700\u5927\u884c\u9ad8 \r\n        float fontMetricsLineHeight = fontMetrics.getLineHeight();\r\n        \/\/ \u5e73\u5747\u306e\u5c0f\u6587\u5b57\u306e\u6700\u4e0a\u90e8\u3078\u306e\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u304b\u3089\u8ddd\u96e2\r\n        float fontMetricsXHeight = fontMetrics.getXheight();\r\n        \/\/ \u5e73\u5747\u306e\u6700\u5927\u6587\u5b57\u9ad8\u3055\u307e\u3067\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u304b\u3089\u306e\u8ddd\u96e2\u3002 \u3053\u306e\u5024\u306f\u5e38\u306b\u6b63\u306e\u5024\u3067\u3059 \r\n        float fontMetricsAscent = fontMetrics.getAscent();\r\n        \/\/ \u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u304b\u3089\u6700\u5927\u6587\u5b57\u9ad8\u3055\u307e\u3067\u306e\u8ddd\u96e2\u3002 \u3053\u306e\u5024\u306f\u5e38\u306b\u6b63\u306e\u5024\u3067\u3059 \r\n        float fontMetricsMaxAscent = fontMetrics.getMaxAscent();\r\n        \/\/ \u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u306f\u3001\u30c7\u30bb\u30f3\u30c0\u30fc\u306e\u306a\u3044\u6587\u5b57\uff08\u4f8b\u3048\u3070\u3001\u5c0f\u6587\u5b57\u306e\u300ca\u300d\uff09\u304c\u7f6e\u304b\u308c\u3066\u3044\u308b\u4eee\u60f3\u7dda\u3067\u3059\u3002 \r\n        \/\/ \u30d5\u30a9\u30f3\u30c8\u30e1\u30c8\u30ea\u30c3\u30af\u306b\u95a2\u3057\u3066\u306f\u3001\u3053\u306e\u70b9\u304b\u3089\u4ed6\u306e\u3059\u3079\u3066\u306e\u30e1\u30c8\u30ea\u30c3\u30af\u304c\u5c0e\u51fa\u3055\u308c\u307e\u3059\u3002 \u3053\u306e\u70b9\u306f\u6697\u9ed9\u7684\u306b\u30bc\u30ed\u3068\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \r\n        int fontMetricsBaseline = fontMetrics.getBaseline();\r\n        \/\/ \u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u304b\u3089\u6700\u4f4e\u5e73\u5747\u5024\u307e\u3067\u306e\u8ddd\u96e2\u3002 \u30c7\u30a3\u30bb\u30f3\u30c0\u30fc\u3002 \u3053\u306e\u5024\u306f\u5e38\u306b\u6b63\u306e\u5024\u3067\u3059\r\n        float fontMetricsDescent = fontMetrics.getDescent();\r\n        \/\/ \u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u304b\u3089\u7d76\u5bfe\u5024\u306e\u6700\u3082\u4f4e\u3044\u30c7\u30a3\u30bb\u30f3\u30c0\u30fc\u307e\u3067\u306e\u8ddd\u96e2\u3002 \u3053\u306e\u5024\u306f\u5e38\u306b\u6b63\u306e\u5024\u3067\u3059 \r\n        float fontMetricsMaxDescent = fontMetrics.getMaxDescent();\r\n        \/\/ \u3053\u306e\u30d5\u30a9\u30f3\u30c8\u306e\u30c6\u30ad\u30b9\u30c8\u884c\u9593\u306e\u30b9\u30da\u30fc\u30b9\u91cf\u3002 \r\n        \/\/ \u3053\u308c\u306f\u30011\u884c\u306emaxDecent\u3068\u6b21\u306emaxAscent\u306e\u9593\u306e\u30b9\u30da\u30fc\u30b9\u91cf\u3067\u3059\u3002 \r\n        \/\/ \u3053\u306e\u6570\u5024\u306f\u3001lineHeight\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002 \r\n        float fontMetricsLeading = fontMetrics.getLeading();\r\n\/\/        System.out.println(\"FontMetricsWidth: \" + fontMetricsWidth);\r\n        System.out.println(\"FontMetricsLineHeight: \" + fontMetricsLineHeight); \/\/ Ascent + Descent + Leading\r\n        System.out.println(\"FontMetricsXHeight: \" + fontMetricsXHeight);\r\n        System.out.println(\"FontMetricsAscent: \" + fontMetricsAscent);\r\n        System.out.println(\"FontMetricsMaxAscent: \" + fontMetricsMaxAscent);\r\n        System.out.println(\"FontMetricsBaseline: \" + fontMetricsBaseline);\r\n        System.out.println(\"FontMetricsDescent: \" + fontMetricsDescent);\r\n        System.out.println(\"FontMetricsMaxDescent: \" + fontMetricsMaxDescent);\r\n        System.out.println(\"FontMetricsLeading: \" + fontMetricsLeading);\r\n\r\n        gc.setFontSmoothingType(FontSmoothingType.LCD);\r\n\r\n        gc.setStroke(Color.LIGHTGRAY);\r\n        gc.setLineWidth(1.0);\r\n        gc.strokeLine(0.0, Configuration.HEIGHT.settingValue \/ 2.0, Configuration.WIDTH.settingValue, Configuration.HEIGHT.settingValue \/ 2.0);\r\n        gc.strokeLine(Configuration.WIDTH.settingValue \/ 4.0, 0.0, Configuration.WIDTH.settingValue \/ 4.0, Configuration.HEIGHT.settingValue);\r\n        \/\/ \u30c6\u30ad\u30b9\u30c8\r\n        gc.setFont(font);\r\n        gc.setFill(Color.RED);\r\n        gc.setTextBaseline(VPos.BASELINE);\r\n        gc.fillText(text.getText(), Configuration.WIDTH.settingValue \/ 4.0, Configuration.HEIGHT.settingValue \/ 2.0);\r\n        \/\/ FontMetrics \u30c7\u30fc\u30bf\u8868\u793a\u7528\u30d5\u30a9\u30f3\u30c8\r\n        gc.setFont(Font.font(\"SansSerif\", FontWeight.BOLD, Configuration.FONT_SIZE.settingValue * 0.3));\r\n\/\/        gc.setFont(Font.font(\"\u3042\u304f\u3073\u3093\", FontWeight.BOLD, Configuration.FONT_SIZE.settingValue * 0.3));\r\n        final FontMetrics shrinkFontMetrics = Toolkit.getToolkit().getFontLoader().getFontMetrics(gc.getFont());\r\n        \/\/ Ascent\r\n        gc.setStroke(Color.GREEN);\r\n        gc.strokeLine(0.0, Configuration.HEIGHT.settingValue \/ 2.0 - fontMetricsAscent,\r\n                Configuration.WIDTH.settingValue, Configuration.HEIGHT.settingValue \/ 2.0 - fontMetricsAscent);\r\n        gc.setFill(Color.GREEN);\r\n        gc.fillText(\"Ascent: \" + String.format(\"%.1f\", fontMetricsAscent), 0.0, Configuration.HEIGHT.settingValue \/ 2.0 - fontMetricsAscent - fontMetricsLeading);\r\n        \/\/ XHeight\r\n        gc.setStroke(Color.PURPLE);\r\n        gc.strokeLine(0.0, Configuration.HEIGHT.settingValue \/ 2.0 - fontMetricsXHeight,\r\n                Configuration.WIDTH.settingValue, Configuration.HEIGHT.settingValue \/ 2.0 - fontMetricsXHeight);\r\n        gc.setFill(Color.PURPLE);\r\n        gc.fillText(\"XHeight: \" + String.format(\"%.1f\", fontMetricsXHeight), 0.0, Configuration.HEIGHT.settingValue \/ 2.0 - fontMetricsXHeight - fontMetricsLeading);\r\n        \/\/ Descent \r\n        gc.setStroke(Color.BLUE);\r\n        gc.strokeLine(0.0, Configuration.HEIGHT.settingValue \/ 2.0 + fontMetricsDescent,\r\n                Configuration.WIDTH.settingValue, (int) (Configuration.HEIGHT.settingValue \/ 2.0 + fontMetricsDescent));\r\n        gc.setFill(Color.BLUE);\r\n        gc.fillText(\"Descent: \" + String.format(\"%.1f\", fontMetricsDescent), 0.0, Configuration.HEIGHT.settingValue \/ 2.0 + fontMetricsDescent - fontMetricsLeading);\r\n        \/\/ Leading\r\n        gc.setStroke(Color.MAGENTA);\r\n        gc.strokeLine(0.0, (Configuration.HEIGHT.settingValue \/ 2.0 + fontMetricsLeading + fontMetricsDescent),\r\n                Configuration.WIDTH.settingValue, Configuration.HEIGHT.settingValue \/ 2.0 + fontMetricsLeading + fontMetricsDescent);\r\n        gc.setFill(Color.MAGENTA);\r\n        gc.fillText(\"Leading: \" + String.format(\"%.1f\", fontMetricsLeading),\r\n                0.0, Configuration.HEIGHT.settingValue \/ 2.0 + fontMetricsDescent + shrinkFontMetrics.getAscent() + shrinkFontMetrics.getLeading());\r\n\r\n    }\r\n\r\n}\r\n\r\n<\/code><\/pre>\n<p>\u6b8b\u5ff5\u306a\u304c\u3089\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u3067\u3059\u3002 <\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/error.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"error\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"error\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/error_thumb.png\" width=\"884\" height=\"265\"><\/a> <\/p>\n<p>\u300c\u540d\u524d\u306e\u306a\u3044\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u300d\u3063\u3066\u306a\u3093\u306e\u3053\u3068\u3067\u3059\u304b\uff1f <\/p>\n<p>JavaFX 9 \u3067\u306f java.awt.FontMetrics \u30af\u30e9\u30b9\u306f\u4f7f\u3048\u306a\u3044\u3088\u3046\u306a\u306e\u3067 com.sun.javafx.tk.FontMetrics, com.sun.javafx.tk.Toolkit \u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002 <\/p>\n<p>\u78ba\u304b\u3001JavaFX 8 \u3067\u306f\u4f7f\u3048\u3066\u3044\u305f\u3088\u3046\u306a\u8a18\u61b6\u304c\u3042\u308b\u3093\u3060\u3051\u3069\u30fb\u30fb\u30fb <\/p>\n<p>\u305d\u3046\u8a00\u3048\u3070\u3001Project Jigsaw \u306e\u5f71\u97ff\u3067 com.sun \u3067\u306f\u3058\u307e\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u4f7f\u3048\u306a\u3044\u3082\u306e\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002 <\/p>\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u4f7f\u3063\u3066\u3044\u308b com.sun.javafx.tk.FontMetrics, com.sun.javafx.tk.Toolkit \u3082 JDK \u5185\u90e8\uff08\u30e2\u30b8\u30e5\u30fc\u30eb\uff09\u306b\u3061\u3083\u3093\u3068\u3042\u308b\u306e\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4f7f\u3048\u306a\u304f\u3057\u3066\u3042\u308a\u307e\u3059\u3002 <\/p>\n<p>\u56f0\u308a\u307e\u3057\u305f\uff01 <\/p>\n<p>Windows \u74b0\u5883\u306a\u3089 JavaFX 9 \u3060\u3063\u305f\u3089 HiDPI \u5bfe\u5fdc\u306e\u6069\u6075\u3092\u4eab\u53d7\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306a\u306e\u306b\u3002 <\/p>\n<p>\u3061\u306a\u307f\u306b JavaFX 8 \u3060\u3063\u305f\u3089\u554f\u984c\u306a\u304f\u52d5\u304d\u307e\u3057\u305f\u3002 <\/p>\n<p>\u3055\u3066\u3001\u3069\u3046\u3057\u305f\u3082\u306e\u304b\u3002\u3002\u3002 <\/p>\n<p>\u4ee5\u524d Twitter \u3067 \u300choge \u306f fuga \u304c\u3067\u304d\u306a\u3044\u304b\u3089\u30af\u30bd\u30c3\uff01\u300d\u3082\u3057\u304f\u306f\u5973\u5b50\u9ad8\u751f\u3092\u88c5\u3063\u3066\u30d8\u30eb\u30d7\u3092\u3064\u3076\u3084\u304f\u3068\u512a\u79c0\u306a\u30d7\u30ed\u30b0\u30e9\u30de\u304c\u89e3\u6c7a\u7b56\u3092\u63d0\u6848\u3057\u3066\u304f\u308c\u308b\u3068\u3044\u3046\u6cd5\u5247\u3092\u5b66\u3093\u3060\u3002 <\/p>\n<p>\u79c1\u306b\u306f\u5f79\u8005\u306e\u624d\u80fd\u3082\u7121\u3044\u3057\u3001\u5c0f\u8ce2\u3057\u3044\u3053\u3068\u3092\u3059\u308b\u306e\u306f\u9762\u5012\u306a\u306e\u3067\u7d20\u76f4\u306b Twitter \u3067\u3064\u3076\u3084\u3044\u305f\u3068\u3053\u308d\u5fc3\u512a\u3057\u3044 Java \u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u304c\u52a9\u3051\u3066\u304f\u308c\u307e\u3057\u305f\u3002 <\/p>\n<blockquote class=\"twitter-tweet\" data-lang=\"ja\">\n<p lang=\"ja\" dir=\"ltr\">\u30d1\u30c3\u30b1\u30fc\u30b8<a href=\"https:\/\/t.co\/jFZHx0ZAa7\">https:\/\/t.co\/jFZHx0ZAa7<\/a>\u306f\u30e2\u30b8\u30e5\u30fc\u30eb<a href=\"https:\/\/t.co\/KUFXoAdelb\">https:\/\/t.co\/KUFXoAdelb<\/a>\u3067\u5ba3\u8a00\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u540d\u524d\u306e\u306a\u3044\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093<\/p>\n<p>JDK9\u52c9\u5f37\u4e0d\u8db3\u3067\u3069\u3046\u89e3\u6c7a\u3057\u305f\u3089\u3044\u3044\u304b\u89e3\u3089\u306a\u304f\u3066\u6d99\u304c\u6b62\u307e\u3089\u306a\u3044\u3002<br \/>\u3057\u304b\u305f\u306a\u3044\u304b\u3089JDK8\u306b\u623b\u308d\u3046\u3002\uff08\u5f8c\u308d\u5411\u304d\u306a\u89e3\u6c7a\u306b\u9003\u3052\u308b\uff09<\/p>\n<p>\u2014 Yucchi (@Yucchi_jp) <a href=\"https:\/\/twitter.com\/Yucchi_jp\/status\/942587512744165379?ref_src=twsrc%5Etfw\">2017\u5e7412\u670818\u65e5<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote class=\"twitter-tweet\" data-lang=\"ja\" data-conversation=\"none\">\n<p lang=\"ja\" dir=\"ltr\">javac\u3068java\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067&#8211;add-exports=<a href=\"https:\/\/t.co\/sukDO8OAIH\">https:\/\/t.co\/sukDO8OAIH<\/a>\u3092\u6307\u5b9a\u3059\u308c\u3070\u52d5\u304d\u307e\u3059\u3088\u3002<\/p>\n<p>\u2014 Yuichi Sakuraba (@skrb) <a href=\"https:\/\/twitter.com\/skrb\/status\/942618158854111233?ref_src=twsrc%5Etfw\">2017\u5e7412\u670818\u65e5<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01<\/p>\n<p>\u65e9\u901f NetBeans \u306b javac\u3068java\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8a2d\u5b9a\u3057\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u3001\u5b9f\u884c\u3092\u3057\u305f\u3068\u3053\u308d\u7121\u4e8b\u306b\u52d5\u304d\u307e\u3057\u305f\u3002(^_^)<\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/s.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"s\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"s\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/s_thumb.png\" width=\"500\" height=\"75\"><\/a><\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/s2.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"s2\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"s2\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/s2_thumb.png\" width=\"499\" height=\"49\"><\/a><\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/fx.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"fx\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"fx\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/fx_thumb.png\" width=\"849\" height=\"385\"><\/a><\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/fx2.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"fx2\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"fx2\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/fx2_thumb.png\" width=\"358\" height=\"450\"><\/a><\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u30c6\u30ad\u30b9\u30c8\u306e\u633f\u5165\u4f4d\u7f6e\u306e Y \u5ea7\u6a19\u306e\u4f4d\u7f6e\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f VPos.BASELINE \u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>gc.setTextBaseline(VPos.BASELINE);<\/p>\n<p>\u3053\u308c\u306f\u6b21\u306e\u3088\u3046\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>gc.setTextBaseline(VPos.TOP);<\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/top.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"top\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"top\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/top_thumb.png\" width=\"858\" height=\"382\"><\/a><\/p>\n<p>gc.setTextBaseline(VPos.CENTER);<\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/center.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"center\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"center\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/center_thumb.png\" width=\"857\" height=\"384\"><\/a><\/p>\n<p>gc.setTextBaseline(VPos.BOTTOM);<\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/bottom.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"bottom\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"bottom\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/bottom_thumb.png\" width=\"849\" height=\"383\"><\/a><\/p>\n<p>\u3042\u3042\u3063\u30fb\u30fb\u30fb\u3000\u3057\u307e\u3063\u305f\u3002(&gt;_&lt;)\u3000\u5de6\u306e\u30c6\u30ad\u30b9\u30c8\u306e\u4f4d\u7f6e\u306e\u4fee\u6b63\u5fd8\u308c\u305f\u3002\u898b\u306a\u304b\u3063\u305f\u3053\u3068\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u3054\u3081\u3093\u306a\u3055\u3044\uff09<\/p>\n<p>\u3064\u3044\u3067\u306b Leading \u304c\u7121\u3044\u30d5\u30a9\u30f3\u30c8\u306e\u8868\u793a\u3082\u898b\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/awt3.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"awt3\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"awt3\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/awt3_thumb.png\" width=\"834\" height=\"344\"><\/a><\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/awt4.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"awt4\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"awt4\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/awt4_thumb.png\" width=\"249\" height=\"178\"><\/a><\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/fx3.png\"><img loading=\"lazy\" decoding=\"async\" title=\"fx3\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"fx3\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/fx3_thumb.png\" width=\"849\" height=\"382\"><\/a><\/p>\n<p><a href=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/fx4.png\"><img loading=\"lazy\" decoding=\"async\" title=\"fx4\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"fx4\" src=\"http:\/\/yucchi.jp\/blog\/wp-content\/uploads\/2017\/12\/fx4_thumb.png\" width=\"317\" height=\"443\"><\/a><\/p>\n<p>AWT \u3068 JavaFX \u3067\u306f FontMetrics \u306e\u6271\u3044\u65b9\u306b\u9055\u3044\u304c\u3042\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u306d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong><font size=\"5\">\u307e\u3068\u3081<\/font><\/strong><\/p>\n<p>\u3055\u3066\u3001\u3053\u3053\u3067 JavaFX \u3067 FontMetrics \u3092\u6271\u3046\u305f\u3081\u306b com.sun.javafx.tk.FontMetrics, com.sun.javafx.tk.Toolkit \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092 JavaFX 9 \u3067\u4f7f\u3046\u305f\u3081\u306b\u306f javac\u3068java\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b &#8211;add-exports=javafx.graphics\/com.sun.javafx.tk=ALL-UNNAMED \u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p><strong><font size=\"5\">\u53c2\u8003<\/font><\/strong><\/p>\n<p><strong><font size=\"4\"><a href=\"http:\/\/openjdk.java.net\/jeps\/261\" target=\"_blank\">JEP 261: Module System<\/a><\/font><\/strong><\/p>\n<p><strong><font size=\"3\">\u30ab\u30d7\u30bb\u30eb\u5316\u3092\u7834\u308b<\/font><\/strong><\/p>\n<p>\u30e2\u30b8\u30e5\u30fc\u30eb\u30b7\u30b9\u30c6\u30e0\u306b\u3088\u3063\u3066\u5b9a\u7fa9\u3055\u308c\u305f\u30a2\u30af\u30bb\u30b9\u5236\u5fa1\u5883\u754c\u306b\u9055\u53cd\u3057\u3001\u30b3\u30f3\u30d1\u30a4\u30e9\u3068\u4eee\u60f3\u30de\u30b7\u30f3\u306b\u3088\u3063\u3066\u5f37\u5236\u3055\u308c\u3066\u3001<br \/>\u3042\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5225\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u4e00\u90e8\u306e\u975e\u901a\u77e5\u30bf\u30a4\u30d7\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002 <br \/>\u3053\u308c\u306f\u3001\u4f8b\u3048\u3070\u3001\u5185\u90e8\u578b\u306e\u30db\u30ef\u30a4\u30c8\u30dc\u30c3\u30af\u30b9\u30c6\u30b9\u30c8\u3092\u53ef\u80fd\u306b\u3059\u308b\u305f\u3081\u3001<br \/>\u307e\u305f\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u5185\u90e8API\u3092\u305d\u308c\u3089\u306b\u4f9d\u5b58\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u30b3\u30fc\u30c9\u306b\u516c\u958b\u3059\u308b\u305f\u3081\u306b\u671b\u307e\u3057\u3044\u3053\u3068\u304c\u3042\u308b\u3002 <br \/>\u3053\u308c\u3092\u884c\u3046\u306b\u306f\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u3068\u5b9f\u884c\u6642\u306e\u4e21\u65b9\u3067&#8211;add-exports\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002 <br \/>\u69cb\u6587\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<p><font color=\"#666666\">&#8211;add-exports &lt;source-module&gt;\/&lt;package&gt;=&lt;target-module&gt;(,&lt;target-module&gt;)*<\/font><\/p>\n<p>&lt;source-module&gt;\u3068&lt;target-module&gt;\u306f\u30e2\u30b8\u30e5\u30fc\u30eb\u540d\u3067\u3001&lt;package&gt;\u306f\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u3067\u3059\u3002<\/p>\n<p>&#8211;add-exports\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u8907\u6570\u56de\u4f7f\u7528\u3067\u304d\u307e\u3059\u304c\u3001\u30bd\u30fc\u30b9\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u306e\u7279\u5b9a\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u5bfe\u3057\u3066\u6700\u5927\u30671\u56de\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002 <br \/>\u5404\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u52b9\u679c\u306f\u3001\u6307\u5b9a\u3055\u308c\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u4fee\u98fe\u3055\u308c\u305f\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3092\u30bd\u30fc\u30b9\u30e2\u30b8\u30e5\u30fc\u30eb\u304b\u3089\u30bf\u30fc\u30b2\u30c3\u30c8\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3059\u3002 <br \/>\u3053\u308c\u306f\u57fa\u672c\u7684\u306b\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u5ba3\u8a00\u5185\u306e\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u53e5\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f62\u5f0f\u3001\u307e\u305f\u306fModule :: addExports\u30e1\u30bd\u30c3\u30c9\u306e\u7121\u5236\u9650\u306a\u5f62\u5f0f\u306e\u547c\u3073\u51fa\u3057\u3067\u3059\u3002 <br \/>\u7d50\u679c\u3068\u3057\u3066\u3001\u30bf\u30fc\u30b2\u30c3\u30c8\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u30bd\u30fc\u30b9\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u540d\u524d\u4ed8\u304d\u30d1\u30c3\u30b1\u30fc\u30b8\u5185\u306e\u30d1\u30d6\u30ea\u30c3\u30af\u30bf\u30a4\u30d7\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\u30bf\u30fc\u30b2\u30c3\u30c8\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u30bd\u30fc\u30b9\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30e2\u30b8\u30e5\u30fc\u30eb\u5ba3\u8a00\u306erequires\u7bc0\u3001Module :: addReads\u30e1\u30bd\u30c3\u30c9\u3001\u307e\u305f\u306f&#8211;add-reads\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3059\u3002<br \/>\u305f\u3068\u3048\u3070\u3001jmx.wbtest\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u3001java.management\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u975e\u30a8\u30af\u30b9\u30dd\u30fc\u30c8com.sun.jmx.remote.internal\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30db\u30ef\u30a4\u30c8\u30dc\u30c3\u30af\u30b9\u30fb\u30c6\u30b9\u30c8\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u305d\u308c\u304c\u5fc5\u8981\u3068\u3059\u308b\u30a2\u30af\u30bb\u30b9\u306f\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u8a31\u53ef\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><font color=\"#666666\">&#8211;add-exports java.management\/com.sun.jmx.remote.internal=jmx.wbtest<\/font><\/p>\n<p>\u7279\u6b8a\u306a\u30b1\u30fc\u30b9\u3068\u3057\u3066\u3001&lt;target-module&gt;\u304cALL-UNNAMED\u306e\u5834\u5408\u3001\u30bd\u30fc\u30b9\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u3001\u6700\u521d\u306b\u5b58\u5728\u3059\u308b\u304b\u3001\u5f8c\u3067\u4f5c\u6210\u3055\u308c\u308b\u304b\u306b\u95a2\u4fc2\u306a\u304f\u3001\u540d\u524d\u306e\u306a\u3044\u3059\u3079\u3066\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3055\u308c\u307e\u3059\u3002 <br \/>\u3057\u305f\u304c\u3063\u3066\u3001java.management\u30e2\u30b8\u30e5\u30fc\u30eb\u306esun.management\u30d1\u30c3\u30b1\u30fc\u30b8\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306f\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ecb\u3057\u3066\u30af\u30e9\u30b9\u30d1\u30b9\u4e0a\u306e\u3059\u3079\u3066\u306e\u30b3\u30fc\u30c9\u306b\u4e0e\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><font color=\"#666666\">&#8211;add-exports java.management\/sun.management=ALL-UNNAMED<\/font><\/p>\n<p>&#8211;add-exports\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u6307\u5b9a\u3055\u308c\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30d1\u30d6\u30ea\u30c3\u30af\u30bf\u30a4\u30d7\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002 <br \/>\u30b3\u30a2\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3API\u306esetAccessible\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u975e\u516c\u958b\u306e\u3059\u3079\u3066\u306e\u8981\u7d20\u306b\u3055\u3089\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002 <br \/>\u3053\u308c\u3092\u884c\u3046\u306b\u306f\u3001\u5b9f\u884c\u6642\u306b&#8211;add-opens\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 <br \/>&#8211;add-exports\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u540c\u3058\u69cb\u6587\u3067\u3059\uff1a<\/p>\n<p><font color=\"#666666\">&#8211;add-opens &lt;source-module&gt;\/&lt;package&gt;=&lt;target-module&gt;(,&lt;target-module&gt;)*<\/font><\/p>\n<p>&lt;source-module&gt;\u3068&lt;target-module&gt;\u306f\u30e2\u30b8\u30e5\u30fc\u30eb\u540d\u3067\u3001&lt;package&gt;\u306f\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u3067\u3059\u3002<br \/>&#8211;add-opens\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u8907\u6570\u56de\u4f7f\u7528\u3067\u304d\u307e\u3059\u304c\u3001\u30bd\u30fc\u30b9\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u306e\u7279\u5b9a\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u5bfe\u3057\u3066\u6700\u5927\u30671\u56de\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002 <br \/>\u5404\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u52b9\u679c\u306f\u3001\u540d\u524d\u4ed8\u304d\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u4fee\u98fe\u3055\u308c\u305f\u30aa\u30fc\u30d7\u30f3\u3092\u30bd\u30fc\u30b9\u30e2\u30b8\u30e5\u30fc\u30eb\u304b\u3089\u30bf\u30fc\u30b2\u30c3\u30c8\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3059\u3002 <br \/>\u3053\u308c\u306f\u57fa\u672c\u7684\u306b\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u5ba3\u8a00\u306eopens\u7bc0\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f62\u5f0f\u3001\u307e\u305f\u306fModule :: addOpens\u30e1\u30bd\u30c3\u30c9\u306e\u7121\u5236\u9650\u306a\u5f62\u5f0f\u306e\u547c\u3073\u51fa\u3057\u3067\u3059\u3002 <br \/>\u7d50\u679c\u3068\u3057\u3066\u3001\u30bf\u30fc\u30b2\u30c3\u30c8\u30e2\u30b8\u30e5\u30fc\u30eb\u5185\u306e\u30b3\u30fc\u30c9\u306f\u3001\u30bf\u30fc\u30b2\u30c3\u30c8\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u30bd\u30fc\u30b9\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8aad\u307f\u53d6\u308b\u9650\u308a\u3001<br \/>\u30bd\u30fc\u30b9\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3API\u3092\u4f7f\u7528\u3057\u3066\u3001\u30bd\u30fc\u30b9\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u540d\u524d\u4ed8\u304d\u30d1\u30c3\u30b1\u30fc\u30b8\u5185\u306e\u30d1\u30d6\u30ea\u30c3\u30af\u306a\u3069\u306e\u3059\u3079\u3066\u306e\u30bf\u30a4\u30d7\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002<br \/>\u30aa\u30fc\u30d7\u30f3\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u533a\u5225\u3067\u304d\u306a\u3044\u305f\u3081\u3001<br \/>&#8211;add-opens\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u305d\u306e\u30d5\u30a7\u30fc\u30ba\u3067\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p><strong>&#8211;add-exports\u3068&#8211;add-opens\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u7d30\u5fc3\u306e\u6ce8\u610f\u3092\u6255\u3063\u3066\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 <br \/>\u305d\u308c\u3089\u3092\u4f7f\u7528\u3057\u3066\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5185\u90e8API\u3001\u307e\u305f\u306fJDK\u81ea\u4f53\u306e\u30a2\u30af\u30bb\u30b9\u6a29\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u3059\u304c\u3001\u81ea\u5df1\u8cac\u4efb\u3067\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\u5185\u90e8API\u304c\u5909\u66f4\u307e\u305f\u306f\u524a\u9664\u3055\u308c\u305f\u5834\u5408\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u307e\u305f\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u5931\u6557\u3057\u307e\u3059<\/strong>\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong><font color=\"#ff0000\" size=\"3\">((((\uff1b\uff9f\u0414\uff9f)))))))<\/font><\/strong><\/p>\n<p><strong><font color=\"#ff80ff\" size=\"7\">I wish you a Merry Christmas.<\/font><\/strong><\/p>\n<div id=\"scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1a8f30e2-253a-40c5-9b7b-79d28a4f789f\" class=\"wlWriterEditableSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">Hatena \u30bf\u30b0: <a href=\"http:\/\/b.hatena.ne.jp\/t\/Java\" rel=\"tag\">Java<\/a>,<a href=\"http:\/\/b.hatena.ne.jp\/t\/JavaFX\" rel=\"tag\">JavaFX<\/a>,<a href=\"http:\/\/b.hatena.ne.jp\/t\/NetBeans\" rel=\"tag\">NetBeans<\/a><\/div>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_hatena\"><a href='\/\/b.hatena.ne.jp\/add?mode=confirm&url=http%3A%2F%2Fyucchi.jp%2Fblog%2F%3Fp%3D2454&title=JavaFX%209%20%E3%81%A7%20FontMetrics%20%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='http:\/\/yucchi.jp\/blog\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/hatena.gif' alt='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' width='16' height='12' class='wp_social_bookmarking_light_img' \/><\/a><\/div>\n            <div class=\"wsbl_facebook\"><a href='http:\/\/www.facebook.com\/share.php?u=http%3A%2F%2Fyucchi.jp%2Fblog%2F%3Fp%3D2454&t=JavaFX%209%20%E3%81%A7%20FontMetrics%20%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B' title='Facebook \u306b\u30b7\u30a7\u30a2' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='http:\/\/yucchi.jp\/blog\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/facebook.png' alt='Facebook \u306b\u30b7\u30a7\u30a2' title='Facebook \u306b\u30b7\u30a7\u30a2' width='16' height='16' class='wp_social_bookmarking_light_img' \/><\/a><\/div>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"http:\/\/yucchi.jp\/blog\/?p=2454\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"http:\/\/yucchi.jp\/blog\/?p=2454\" data-text=\"JavaFX 9 \u3067 FontMetrics \u3092\u53d6\u5f97\u3059\u308b\" data-lang=\"ja\">Tweet<\/a><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u306f\u3001JavaFX Advent Calendar 2017 \u306e 20 \u65e5\u76ee\u3067\u3059\u3002 \u73fe\u6642\u70b9\u3067\u3082\u30a8\u30f3\u30c8\u30ea\u30fc\u304c\u7121\u3044\u306e\u3067\u6025\u907d\u5148\u65e5\u906d\u9047\u3057\u305f\u554f\u984c\u306b\u89e3\u6c7a\u7b56\u3092\u6559\u3048\u3066\u3044\u305f\u3060\u3044\u305f\u306e\u3067\u305d\u308c\u3092\u8a18\u4e8b\u306b\u3057\u307e\u3057\u305f\u3002 \u6628\u65e5\u306f @aoetk \u3055\u3093\u306e\u300cBean Validation\u306eJavaFX\u5bfe\u5fdc\u300d\u3067\u3057\u305f\u3002 \u660e\u65e5\u3082\u3001\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u308b\u73fe\u6642\u70b9\u3067\u306f\u307e\u3060\u7a7a\u3044\u3066\u307e\u3059\u3002(^_^;\u3000\u304d\u3063\u3068\u8ab0\u304b\u304c\u7d20\u6575\u306a\u8a18\u4e8b\u3092\u6295\u7a3f\u3057\u3066\u304f\u308c\u308b\u3068\u697d\u3057\u307f\u306b\u3057\u3066\u3044\u307e\u3059\u3002 11 \u6708\u304b\u3089 IBM Cloud (Bluemix)\u30e9\u30a4\u30c8\u30fb\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u6c17\u697d\u306b\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a Watson Personality Insights \u3092\u5229\u7528\u3057\u305f\u4eba\u683c\u8a3a\u65ad\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,12,4],"tags":[17,21,19],"class_list":["post-2454","post","type-post","status-publish","format-standard","hentry","category-java","category-javafx","category-netbeans","tag-java","tag-javafx","tag-netbeans"],"_links":{"self":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2454"}],"version-history":[{"count":1,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2454\/revisions"}],"predecessor-version":[{"id":2455,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2454\/revisions\/2455"}],"wp:attachment":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2454"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}