Default font size of JavaFX under Linux is larger as on Windows

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 03:38:49

问题


I noticed that the default font is way larger in JavaFX under Linux (Ubuntu XY) as it is under Windows. Since screen space is sometimes quite limited i would like to have it ideally the same size as it is under Windows. Is there a simple way to enforce the same default size / the same DPI value?


回答1:


In short, font rendering will depend of the OS. So you will have more/less pixels for the same word depending of the OS where java is running. One good practice is to use: USE_COMPUTED_SIZE as much as possible to avoid problems and let your app just fit by it self depending on the size of the fonts.

Check this guide to know how java works with fonts: http://docs.oracle.com/javase/7/docs/technotes/guides/intl/fontconfig.html

This is not 100% related to your question but just check these comparisons (Windows,Linux,Mac): http://fxexperience.com/2013/01/modena-new-theme-for-javafx-8/



来源:https://stackoverflow.com/questions/28350260/default-font-size-of-javafx-under-linux-is-larger-as-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!