This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] Linux/AM5718:QT 字体选择

Guru**** 2894990 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/661849/linux-am5718-qt-font-selection

器件型号:AM5718

工具/软件:Linux

您好!

我们使用 AM5718开发了 SOM。 我们将其用于在 QT 上开发的 HMI 应用。 我们正在尝试保留所需的字体类型(Arial)。 我们在以下路径中有 Arial 字体文件

/usr/share/fonts/ttf/arial.ttf

/usr/share/fonts/ttf/arialbl.ttf

/usr/share/fonts/ttf/ariali.ttf

在这里、当我们运行 fc -list 时、它不显示 Arial.TTF 文件、而是显示为其他文件。 字体不采用的原因是什么? 请建议如何保留所需字体。是否有任何程序。

谢谢、此致、

N. V.Subbaiah。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    您可以尝试以下命令:
    FC-cache -fv
    您也可以检查 fonts.conf 文件。


    BR
    玛格丽塔
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    root@am57xx-evm:~ fc-cache -fv
    /usr/share/fonts:
    缓存、新缓存内容:3种字体、0种方向
    /home/root/.local/share/fonts:正在跳过、没有这样的目录
    /home/root/.fonts:正在跳过、没有这样的目录
    /var/cache/fontconfig:正在清理缓存目录
    /home/root/.cache/fontconfig:不清除不存在的高速缓存目录
    /home/root/.fontconfig:不清除不存在的高速缓存目录
    FC-cache:成功


    root@am57xx-EVM:~# fc-list
    /usr/share/fonts/LiberationSerif-Bold.ttf:Liberation Serif:style=Bold
    /usr/share/fonts/LiberationSerif-Regular.ttf:Liberation Serif:style =常规
    /usr/share/fonts/LiberationSerif-Italic.ttf:Liberation Serif:style=Italic


    fc 列表下列出的字体不会反映在 GUI 应用程序中、因为它从以下路径获取。
    根目录@am57xx-EVM:/usr/share/fonts CD /usr/lib/fonts
    root@am57xx-evm:/usr/lib/fonts ls

    字体大小未根据要求反映。 如何更改字体大小。

    谢谢、此致、
    N. V.Subbaiah。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    这在我这边:

    root@am57xx-evm:/usr/share/fonts fc-cache
    root@am57xx-evm:/usr/share/fonts fc-list
    /usr/share/fonts/ttf/LiberationSans-Italic.ttf:Liberation Sans:Style=Italic
    /usr/share/fonts/ttf/LiberationMono-Regular.ttf:LiberMono:Style=Regular
    /usr/share/fonts/ttf/LiberationSans-Bold.ttf:解放军:风格=粗体
    /usr/share/fonts/ttf/LiberationMono-BoldItalic.ttf:解放单声道:样式=粗斜体
    /usr/share/fonts/LiberationSerif-Regular_try.ttf:Liberation Serif:style =常规
    /usr/share/fonts/ttf/LiberationSans-Regular.ttf:Liberation Sans:Style=Regular
    /usr/share/fonts/ttf/LiberationSerif-Bold.ttf:Liberation Serif:style=Bold
    /usr/share/fonts/ttf/LiberationMono-Italic.ttf:解放单声道:样式=斜体
    /usr/share/fonts/ttf/LiberationSerif-Italic.ttf:Liberation Serif:style=Italic
    /usr/share/fonts/ttf/LiberationSans-BoldItalic.ttf:解放军:样式=斜体
    /usr/share/fonts/ttf/LiberationSerif-BoldItalic.ttf:解放串行器/解串器:样式=粗斜体
    /usr/share/fonts/ttf/LiberationSerif-Regular.ttf:Liberation Serif:style =常规
    /usr/share/fonts/ttf/LiberationMono-Bold.ttf:解放单声道:样式=粗体
    /usr/share/fonts/ttf/Arial-Regular.ttf:obyčejné:style= Regular、Normal、Κανονικά、Standard、thường、Normaali、Normál、Normale、Standaard、Normalny、Обычный、Normálne、Navadno、、Arrunta
    root@am57xx-evm:/usr/share/fonts fc-match Arial
    ARI-Regular.TTF:"ARI"常规"


    我建议您检查以下文件:
    root@am57xx-evm:/etc/fonts ls
    配置 fonts.conf

    BR
    玛格丽塔
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    e2e.ti.com/.../conf.d.tar.gze2e.ti.com/.../fontsconf.txtHi、

    请查找随附的文件 fonts.cof 和 conf.d 文件和文件夹。 这些文件中可能会出现什么问题。 我们无法从这些文件中了解任何内容

    谢谢、此致、
    N. V.Subbaiah。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    很抱歉、我误解了一些内容。
    实际上、您看到的是带有 fc 列表的 Arial、但您想在 qt 应用程序中使用它、对吧?

    BR
    玛格丽塔
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    是的。 在不改变尺寸的地方选择字体。

    谢谢、此致、
    N. V.Subbaiah。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    请查看以下主题:
    Forum.qt.io/.../9.
    Doc.qt.io/.../qapplication.html
    Doc.qt.io/.../qfontdialog.html


    希望这对您有所帮助。

    BR
    玛格丽塔