Linux 上 org.eclipse.swt.widgets.Composite 上的字体混乱
我扩展了 org.eclipse.swt.widgets.Composite 并在其上创建了许多小部件(标签、表格、文本等)。 我面临的问题是标签的文本在 Linux 上被截断,而在 Windows 上看起来很好。 当我将 Linux 的字体更改为哥特式时,截断少了一些,但仍然存在。 有没有办法让windows和linux显示同质化。 在这种情况下,Linux 中使用的最佳字体是什么?
I extend org.eclipse.swt.widgets.Composite and create many widgets on it, (labels, table, text etc). The problem I am facing is that the labels' text is getting truncated on linux while it appears fine on windows. When I change the linux's font to gothic the truncation is little less but still there. Is there way to homogenize the windows and linux display. What could be the best font to use in linux in such a case.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
更有可能的是,它与我刚刚游说重新打开的这个 eclipse bug 有关: https://bugs.eclipse.org/bugs/show_bug.cgi?id=151322
More likely it is related to this eclipse bug which I just lobbied to have re-opened: https://bugs.eclipse.org/bugs/show_bug.cgi?id=151322
听起来您正在使用绝对定位而不是 动态布局。 (如果不是这种情况,也许您可以发布代码来演示该问题)。使用动态布局应确保调整控件的大小以适应其内容。 (如果您翻译过产品,它们也很棒,因为这样您就不必为每种语言重新调整每个对话框。)
It sounds like you are using absolute positioning instead of dynamic layouts. (If this isn't the case, perhaps you could post code demonstrating the problem). Using a dynamic layout should ensure that controls are resized to accommodate their contents. (They're also great if you ever translate a product, because then you don't have to rejig every dialog for every language.)
为了完成麦克道尔的答案,还有一个 bug 与 Linux 检查换行标签的方式相关:
自 3.4M7 起已修复。
即使它可能与您的情况无关,但了解您正在使用哪个版本的 eclipse 以及是否可以使用最新版本(例如 3.5M6)重现您的错误将很有用
To complete McDowel's answer, there is also a bug related to the way Linux check for wrapping label:
It is fixed since 3.4M7.
Even though it may not be related to your case, it would be useful to know which version of eclipse you are using and if you can reproduce your bug with the latest ones (like a 3.5M6)