如何在qml中使用roboto瘦字体 [英] How to use roboto thin font in qml

查看:17
本文介绍了如何在qml中使用roboto瘦字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Linux 的 QML 中使用机器人细字体.我在 ubuntu 上安装了粗体、细体和浅色字体.openoffice 等其他程序只向我展示了roboto.如何在 qml 中使用 roboto thin or light?

I am trying to use robot thin font in QML in Linux.I have install bold,thin and light fonts on ubuntu. Other programs like openoffice shows me only roboto. How do i get to use roboto thin or light in qml?

推荐答案

您可以将字体文件与您的应用程序捆绑在一起,然后使用 FontLoader 组件来加载你想要的版本并在 QML 中使用这些.

You can bundle the font files with your application and then use FontLoader component to load the version you want and use these in QML.

该组件也存在于 QtQuick 1.0 中,因为它是在 Qt 4.7 中引入的 字体加载器

This component also exist for QtQuick 1.0 as it was introduced in Qt 4.7 FontLoader

这篇关于如何在qml中使用roboto瘦字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆