Linux下JavaFX的默认字体大小

Linux下JavaFX的默认字体大小

本文介绍了Linux下JavaFX的默认字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到Linux下的JavaFX(Ubuntu XY)中的默认字体比在Windows下更大。由于屏幕空间有时非常有限,我希望它的理想尺寸与Windows下相同。是否有一种简单的方法来强制执行相同的默认大小/相同的DPI值?

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?

推荐答案

简而言之,字体渲染将取决于操作系统。因此,根据运行java的操作系统,您将拥有更多/更少的相同单词像素。一个好的做法是尽可能使用:USE_COMPUTED_SIZE以避免出现问题,并根据字体的大小让你的应用程序自适应。

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.

查看本指南了解java如何使用字体:

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

这不是100%相关你的问题,但只需检查这些比较(Windows,Linux,Mac):

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/

这篇关于Linux下JavaFX的默认字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 00:02