简体   繁体   English

Linux下JavaFX的默认字体大小

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

I noticed that the default font is way larger in JavaFX under Linux (Ubuntu XY) as it is under Windows. 我注意到Linux下的JavaFX(Ubuntu XY)中的默认字体比Windows更大。 Since screen space is sometimes quite limited i would like to have it ideally the same size as it is under Windows. 由于屏幕空间有时非常有限,我希望它的理想尺寸与Windows下相同。 Is there a simple way to enforce the same default size / the same DPI value? 是否有一种简单的方法来强制执行相同的默认大小/相同的DPI值?

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. 因此,根据运行java的操作系统,您将拥有更多/更少的像素。 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. 一个好的做法是尽可能使用:USE_COMPUTED_SIZE以避免出现问题,并根据字体的大小让您的应用程序自适应。

Check this guide to know how java works with fonts: http://docs.oracle.com/javase/7/docs/technotes/guides/intl/fontconfig.html 查看本指南,了解java如何使用字体: 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/ 这与您的问题不是100%相关,只是检查这些比较(Windows,Linux,Mac): http//fxexperience.com/2013/01/modena-new-theme-for-javafx-8/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM