{"id":74,"date":"2015-06-15T12:04:25","date_gmt":"2015-06-15T12:04:25","guid":{"rendered":"https:\/\/www.spotonoracle.com\/?p=74"},"modified":"2016-05-10T12:07:42","modified_gmt":"2016-05-10T12:07:42","slug":"know-your-font-update-on-sql-developer-oddity","status":"publish","type":"post","link":"https:\/\/www.spotonoracle.com\/?p=74","title":{"rendered":"Know Your Font: update on SQL Developer oddity"},"content":{"rendered":"<p>A while back I posted a note about an oddity I ran into using SQL Developer on Windows (see <a href=\"https:\/\/www.spotonoracle.com\/?p=41\" target=\"_blank\">here<\/a> for details). As I couldn&#8217;t leave the issue alone I eventually found the root cause with a little help from my friends (fellow developers): It&#8217;s the font &#8220;DialogInput&#8221; SQL Developer uses by default. As I learned, &#8220;DialogInput&#8221; is a so-called logical font (read about that <a href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/2d\/text\/fonts.html\" target=\"_blank\">here<\/a>). Apparently, these logical fonts are a composition of multiple physical fonts depending on what&#8217;s actually installed on your system and hence, differ on my Linux and Windows systems. This little Java program prints out the font composition:<\/p>\n<pre class=\"brush: sql; collapse: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\nimport java.awt.Font;\r\nimport java.lang.reflect.Method;\r\nimport java.util.Locale;\r\n\r\nimport sun.font.CompositeFont;\r\nimport sun.font.Font2D;\r\nimport sun.font.PhysicalFont;\r\n\r\npublic class Test {\r\n    public static void main(String... args)\r\n    throws Exception\r\n    {\r\n        Font font = new Font(&quot;DialogInput&quot;, Font.PLAIN, 12);\r\n        describeFont(font);\r\n    }\r\n\r\n    private static void describeFont(Font font)\r\n    throws Exception\r\n    {\r\n        Method method = font.getClass().getDeclaredMethod(&quot;getFont2D&quot;);\r\n        method.setAccessible(true);\r\n        Font2D f = (Font2D)method.invoke(font);\r\n\r\n        describeFont2D(f);\r\n    }\r\n\r\n    private static void describeFont2D(Font2D font)\r\n    {\r\n        if (font instanceof CompositeFont)\r\n        {\r\n            System.out.println(&quot;Font '&quot; + font.getFontName(Locale.getDefault()) + &quot;' is composed of:&quot;);\r\n\r\n            CompositeFont cf = (CompositeFont)font;\r\n            for (int i = 0; i &lt; cf.getNumSlots(); i++)\r\n            {\r\n                PhysicalFont pf = cf.getSlotFont(i);\r\n                describeFont2D(pf);\r\n            }\r\n        }\r\n        else\r\n            System.out.println(&quot;-&gt; &quot; + font);\r\n    }\r\n}\r\n<\/pre>\n<p><strong>Output from my Linux system:<\/strong><\/p>\n<pre class=\"brush: sql; collapse: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\nFont 'DialogInput.plain' is composed of:\r\n-&gt; ** TrueType Font: Family=DejaVu Sans Mono Name=DejaVu Sans Mono style=0 fileName=\/usr\/share\/fonts\/dejavu\/DejaVuSansMono.ttf\r\n-&gt; ** TrueType Font: Family=DejaVu Sans Mono Name=DejaVu Sans Mono Bold style=1 fileName=\/usr\/share\/fonts\/dejavu\/DejaVuSansMono-Bold.ttf\r\n-&gt; ** Type1 Font: Family=Nimbus Mono L Name=Nimbus Mono L Regular style=0 fileName=\/usr\/share\/fonts\/default\/Type1\/n022003l.pfb\r\n-&gt; ** TrueType Font: Family=VL Gothic Name=VL Gothic Regular style=0 fileName=\/usr\/share\/fonts\/vlgothic\/VL-Gothic-Regular.ttf\r\n-&gt; ** TrueType Font: Family=NanumGothic Name=NanumGothic style=0 fileName=\/usr\/share\/fonts\/nhn-nanum\/NanumGothic.ttf\r\n-&gt; ** TrueType Font: Family=Lohit Bengali Name=Lohit Bengali style=0 fileName=\/usr\/share\/fonts\/lohit-bengali\/Lohit-Bengali.ttf\r\n-&gt; ** TrueType Font: Family=Lohit Gujarati Name=Lohit Gujarati style=0 fileName=\/usr\/share\/fonts\/lohit-gujarati\/Lohit-Gujarati.ttf\r\n-&gt; ** TrueType Font: Family=Lohit Punjabi Name=Lohit Punjabi style=0 fileName=\/usr\/share\/fonts\/lohit-punjabi\/Lohit-Punjabi.ttf\r\n-&gt; ** TrueType Font: Family=Lohit Tamil Name=Lohit Tamil style=0 fileName=\/usr\/share\/fonts\/lohit-tamil\/Lohit-Tamil.ttf\r\n-&gt; ** TrueType Font: Family=Meera Name=Meera style=0 fileName=\/usr\/share\/fonts\/smc\/Meera.ttf\r\n-&gt; ** TrueType Font: Family=Lohit Kannada Name=Lohit Kannada style=0 fileName=\/usr\/share\/fonts\/lohit-kannada\/Lohit-Kannada.ttf\r\n-&gt; ** TrueType Font: Family=Lohit Telugu Name=Lohit Telugu style=0 fileName=\/usr\/share\/fonts\/lohit-telugu\/Lohit-Telugu.ttf\r\n-&gt; ** TrueType Font: Family=Lohit Oriya Name=Lohit Oriya style=0 fileName=\/usr\/share\/fonts\/lohit-oriya\/Lohit-Oriya.ttf\r\n-&gt; ** TrueType Font: Family=LKLUG Name=LKLUG style=0 fileName=\/usr\/share\/fonts\/lklug\/lklug.ttf\r\n-&gt; ** TrueType Font: Family=FreeMono Name=FreeMono style=0 fileName=\/usr\/share\/fonts\/gnu-free\/FreeMono.ttf\r\n-&gt; ** TrueType Font: Family=FreeSans Name=FreeSans style=0 fileName=\/usr\/share\/fonts\/gnu-free\/FreeSans.ttf\r\n-&gt; ** TrueType Font: Family=FreeSerif Name=FreeSerif style=0 fileName=\/usr\/share\/fonts\/gnu-free\/FreeSerif.ttf\r\n-&gt; ** TrueType Font: Family=OpenSymbol Name=OpenSymbol style=0 fileName=\/usr\/share\/fonts\/opensymbol\/opens___.ttf\r\n-&gt; ** TrueType Font: Family=PakType Naqsh Name=PakType Naqsh style=0 fileName=\/usr\/share\/fonts\/paktype-naqsh\/PakType_Naqsh.ttf\r\n-&gt; ** TrueType Font: Family=Khmer OS Name=Khmer OS style=0 fileName=\/usr\/share\/fonts\/khmeros\/KhmerOS.ttf\r\n-&gt; ** TrueType Font: Family=Padauk Name=Padauk style=0 fileName=\/usr\/share\/fonts\/sil-padauk\/Padauk.ttf\r\n-&gt; ** TrueType Font: Family=Lohit Devanagari Name=Lohit Devanagari style=0 fileName=\/usr\/share\/fonts\/lohit-devanagari\/Lohit-Devanagari.ttf\r\n-&gt; ** TrueType Font: Family=DejaVu Sans Name=DejaVu Sans style=0 fileName=\/usr\/share\/fonts\/dejavu\/DejaVuSans.ttf\r\n-&gt; ** TrueType Font: Family=DejaVu Serif Name=DejaVu Serif style=0 fileName=\/usr\/share\/fonts\/dejavu\/DejaVuSerif.ttf\r\n-&gt; ** TrueType Font: Family=Nuosu SIL Name=Nuosu SIL style=0 fileName=\/usr\/share\/fonts\/sil-nuosu\/NuosuSIL.ttf\r\n-&gt; ** TrueType Font: Family=PT Sans Name=PT Sans style=0 fileName=\/usr\/share\/fonts\/paratype-pt-sans\/PTS55F.ttf\r\n-&gt; ** TrueType Font: Family=Abyssinica SIL Name=Abyssinica SIL style=0 fileName=\/usr\/share\/fonts\/sil-abyssinica\/AbyssinicaSIL-R.ttf\r\n-&gt; ** TrueType Font: Family=Carlito Name=Carlito style=0 fileName=\/usr\/share\/fonts\/google-crosextra-carlito\/Carlito-Regular.ttf\r\n-&gt; ** TrueType Font: Family=Liberation Sans Name=Liberation Sans style=0 fileName=\/usr\/share\/fonts\/liberation\/LiberationSans-Regular.ttf\r\n-&gt; ** TrueType Font: Family=Liberation Serif Name=Liberation Serif style=0 fileName=\/usr\/share\/fonts\/liberation\/LiberationSerif-Regular.ttf\r\n-&gt; ** TrueType Font: Family=Noto Sans Mandaic Name=Noto Sans Mandaic style=0 fileName=\/usr\/share\/fonts\/google-noto\/NotoSansMandaic-Regular.ttf\r\n-&gt; ** TrueType Font: Family=Noto Sans Meetei Mayek Name=Noto Sans Meetei Mayek style=0 fileName=\/usr\/share\/fonts\/google-noto\/NotoSansMeeteiMayek-Regular.ttf\r\n-&gt; ** TrueType Font: Family=Noto Sans Tagalog Name=Noto Sans Tagalog style=0 fileName=\/usr\/share\/fonts\/google-noto\/NotoSansTagalog-Regular.ttf\r\n-&gt; ** TrueType Font: Family=Noto Sans Tai Tham Name=Noto Sans Tai Tham style=0 fileName=\/usr\/share\/fonts\/google-noto\/NotoSansTaiTham-Regular.ttf\r\n-&gt; ** TrueType Font: Family=Noto Sans Tai Viet Name=Noto Sans Tai Viet style=0 fileName=\/usr\/share\/fonts\/google-noto\/NotoSansTaiViet-Regular.ttf\r\n-&gt; ** TrueType Font: Family=Waree Name=Waree style=0 fileName=\/usr\/share\/fonts\/thai-scalable\/Waree.ttf\r\n-&gt; ** TrueType Font: Family=Mingzat Name=Mingzat style=0 fileName=\/usr\/share\/fonts\/sil-mingzat\/Mingzat-R.ttf\r\n-&gt; ** TrueType Font: Family=Jomolhari Name=Jomolhari style=0 fileName=\/usr\/share\/fonts\/jomolhari\/Jomolhari-alpha3c-0605331.ttf\r\n-&gt; ** TrueType Font: Family=WenQuanYi Zen Hei Name=WenQuanYi Zen Hei style=0 fileName=\/usr\/share\/fonts\/wqy-zenhei\/wqy-zenhei.ttc\r\n-&gt; ** TrueType Font: Family=WenQuanYi Zen Hei Name=WenQuanYi Zen Hei style=0 fileName=\/usr\/share\/fonts\/wqy-zenhei\/wqy-zenhei.ttc\r\n-&gt; ** TrueType Font: Family=AR PL UMing CN Name=AR PL UMing CN style=0 fileName=\/usr\/share\/fonts\/cjkuni-uming\/uming.ttc\r\n-&gt; ** TrueType Font: Family=AR PL UMing CN Name=AR PL UMing CN style=0 fileName=\/usr\/share\/fonts\/cjkuni-uming\/uming.ttc\r\n-&gt; ** TrueType Font: Family=AR PL UMing CN Name=AR PL UMing CN style=0 fileName=\/usr\/share\/fonts\/cjkuni-uming\/uming.ttc\r\n<\/pre>\n<p><strong>Output from my Windows system:<\/strong><\/p>\n<pre class=\"brush: sql; collapse: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\nFFont 'DialogInput.plain' is composed of:\r\n-&gt; ** TrueType Font: Family=Courier New Name=Courier New style=0 fileName=C:\\Windows\\Fonts\\COUR.TTF\r\n-&gt; ** TrueType Font: Family=Wingdings Name=Wingdings style=0 fileName=C:\\Windows\\Fonts\\WINGDING.TTF\r\n-&gt; ** TrueType Font: Family=Symbol Name=Symbol style=0 fileName=C:\\Windows\\Fonts\\SYMBOL.TTF\r\n-&gt; ** TrueType Font: Family=Lucida Sans Name=Lucida Sans Regular style=0 fileName=C:\\Program Files\\Java\\jdk1.7.0_45\\jre\\lib\\fonts\\LucidaSansRegular.ttf\r\n-&gt; ** TrueType Font: Family=MingLiU Name=MingLiU style=0 fileName=C:\\Windows\\Fonts\\MINGLIU.TTC\r\n-&gt; ** TrueType Font: Family=Lucida Sans Name=Lucida Sans Regular style=0 fileName=C:\\Program Files\\Java\\jdk1.7.0_45\\jre\\lib\\fonts\\LucidaSansRegular.ttf\r\n-&gt; ** TrueType Font: Family=SimSun Name=SimSun style=0 fileName=C:\\Windows\\Fonts\\SIMSUN.TTC\r\n-&gt; ** TrueType Font: Family=Lucida Sans Name=Lucida Sans Regular style=0 fileName=C:\\Program Files\\Java\\jdk1.7.0_45\\jre\\lib\\fonts\\LucidaSansRegular.ttf\r\n-&gt; ** TrueType Font: Family=MS Gothic Name=MS Gothic style=0 fileName=C:\\Windows\\Fonts\\MSGOTHIC.TTC\r\n-&gt; ** TrueType Font: Family=Gulim Name=Gulim style=0 fileName=C:\\Windows\\Fonts\\gulim.TTC\r\n-&gt; ** TrueType Font: Family=MingLiU-ExtB Name=MingLiU-ExtB style=0 fileName=C:\\Windows\\Fonts\\MINGLIUB.TTC\r\n-&gt; ** TrueType Font: Family=SimSun-ExtB Name=SimSun-ExtB style=0 fileName=C:\\Windows\\Fonts\\SIMSUNB.TTF\r\n-&gt; ** TrueType Font: Family=Sylfaen Name=Sylfaen style=0 fileName=C:\\Windows\\Fonts\\sylfaen.ttf\r\n<\/pre>\n<p>And therein lies the tragic of the issue: on Windows &#8220;DialogInput&#8221; includes the font &#8220;MingLiU&#8221; which in turn represents Unicode code point U+0092 as right single quotation mark (see <a href=\"http:\/\/www.fileformat.info\/info\/unicode\/char\/0092\/fontsupport.htm\" target=\"_blank\">here<\/a>).<\/p>\n<p><strong>Conclusion<\/strong><br \/>\nI appologize for falsely accusing SQL Developer to do something strange when it is perfectly fine. On the other hand, it&#8217;s utterly beyond me why someone would design a font to represent a PRIVATE USE TWO Unicode code point to be a printable, otherwise perfectly well-defined character.<br \/>\nWhen in doubt, change the SQL Developer properties to a physical font you know or get familiar with the code points it supports &#8211; know your font!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A while back I posted a note about an oddity I ran into using SQL Developer on Windows (see here for details). As I couldn&#8217;t leave the issue alone I eventually found the root cause with a little help from my friends (fellow developers): It&#8217;s the font &#8220;DialogInput&#8221; SQL Developer uses by default. As I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-internals","category-sqldev"],"_links":{"self":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=74"}],"version-history":[{"count":2,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/74\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}