在 FXRuby 中,当尝试指定字体时,出现错误“FXDCWindow::setFont:指定了非法或 NULL 字体。”,如何解决此问题?

发布于 2024-10-01 22:45:23 字数 199 浏览 0 评论 0原文

在 Ruby 中,当尝试指定字体时,出现错误“FXDCWindow::setFont:指定了非法或 NULL 字体。”。我尝试这样做:

@font = FXFont.new(app, 'times')

我需要设置一种字体才能在我的程序中使用drawText,但我不知道如何设置。哦,郑重声明,我只是一个初学者。谢谢!

In Ruby when trying to specify a font I get an error "FXDCWindow::setFont: illegal or NULL font specified.". I tried doing it like this:

@font = FXFont.new(app, 'times')

I need to set a font in order to use drawText in my program and I can't figure out how to. Oh and for the record I'm justt a beginner. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

萌吟 2024-10-08 22:45:23

根据文档,您至少需要指定大小。尝试:

@font = FXFont.new(app, "times,12")

According to the documentation, you need to specify the size at least. Try:

@font = FXFont.new(app, "times,12")
靑春怀旧 2024-10-08 22:45:23

确保在创建字体对象之前没有尝试使用它;请参阅http://www.fox-toolkit.org/faq.html#ILLEGALICON

Make sure you're not trying to use the font object before it has been created; see http://www.fox-toolkit.org/faq.html#ILLEGALICON.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文