Why does JavaFX add extra spacing between letters when using the Text component and how do I fix it?

给你一囗甜甜゛ 提交于 2019-12-10 23:14:17

问题


I'm trying to use the text component of JavaFX to do some nice headline typography in my application. How ever the letters in the text are not spaced evenly. For example in the word "visiting", the "iting" part seems disconnected from the first part.

In the sample image I'm using Arial but this kind of bad spacing happens with every font I tried.

This only happens when "gray" anti-aliasing is used (-fx-font-smoothing-type: gray;). One obvious solution would be to change -fx-font-smoothing-type to lcd, but that would result in the text having jagged edges.

The only thing remotely mentioning something like this is the jira issue RT-14187, but that seem to have been resolved in javafx 8 (jre 8).

来源:https://stackoverflow.com/questions/24727748/why-does-javafx-add-extra-spacing-between-letters-when-using-the-text-component

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