<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Unable to display text property on screen]]></title><description><![CDATA[<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/6bb47ab1-d925-49d7-9d88-bff145041948.jpeg" alt="76D21C3D-42C4-43FB-A999-A4942401A4F8.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Hi. I have a problem.<br />
I think there is something wrong. It is not printing properly on the screen.<br />
I made it print from QML.<br />
Sometimes it works properly and sometimes it works like the picture above<br />
What should i do.</p>
]]></description><link>https://forum.qt.io/topic/142238/unable-to-display-text-property-on-screen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 08:55:45 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/142238.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 17 Jan 2023 02:39:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Unable to display text property on screen on Thu, 26 Jan 2023 04:28:27 GMT]]></title><description><![CDATA[<p dir="auto">The problem has been successfully resolved.</p>
<p dir="auto">But I don't know why this problem is resolved.</p>
<p dir="auto">Problem was "font.bold "</p>
<p dir="auto">I wrote "true" on almost every "font.bold".</p>
<p dir="auto">So, I only left a few, and I fixed most of them to "false."</p>
<p dir="auto">it operated well.</p>
]]></description><link>https://forum.qt.io/post/745235</link><guid isPermaLink="true">https://forum.qt.io/post/745235</guid><dc:creator><![CDATA[Jaekook Choi]]></dc:creator><pubDate>Thu, 26 Jan 2023 04:28:27 GMT</pubDate></item><item><title><![CDATA[Reply to Unable to display text property on screen on Wed, 25 Jan 2023 08:06:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lemons">@<bdi>lemons</bdi></a></p>
<p dir="auto">Sorry for late reply</p>
<p dir="auto">first.</p>
<p dir="auto">int main(int argc, char *argv[])<br />
{<br />
#if QT_VERSION &lt; QT_VERSION_CHECK(6, 0, 0)<br />
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);<br />
#endif<br />
QGuiApplication app(argc, argv);</p>
<pre><code>QSurfaceFormat format;
format.setSamples(8);
QSurfaceFormat::setDefaultFormat(format);

int fontID = QFontDatabase::addApplicationFont(":/font/NanumGothic.ttf");
qDebug() &lt;&lt; "Font ID : " &lt;&lt; fontID &lt;&lt; QFontDatabase::applicationFontFamilies(fontID);

QFont defaultFont;

defaultFont.setFamily("NanumGothic");
defaultFont.setPixelSize(20);
defaultFont.setStyleStrategy(static_cast&lt;QFont::StyleStrategy&gt;(defaultFont.styleStrategy() | QFont::PreferNoShaping));
app.setFont(defaultFont);

CEventFilter cEF;
app.installEventFilter(&amp;cEF);

CAppContainer appContainer;
appContainer.initialize();

appContainer.show();

return app.exec();
</code></pre>
<p dir="auto">}</p>
<p dir="auto">This is my main function.</p>
<p dir="auto">you told me to write "QFontDatabase::addApplicationFont(":/your/qrc/path/NanumGothic.ttf");"</p>
<p dir="auto">But I've already written it.</p>
<p dir="auto">By any chance, is there a strange part of my main function?</p>
<p dir="auto">If I made the character print from c++, it would be printed without any problem, but if I made the character print from QML, the above problem occurred.</p>
<p dir="auto">So I think the font is applied to c++, but the font is not applied to QML.</p>
<p dir="auto">But If i erase code related to the font in c++, QML totally doesn't print character.</p>
<p dir="auto">So the font is not applied?</p>
<p dir="auto">And</p>
<p dir="auto">Now I'm trying to second way that you said(Appliying  fonts in QML)</p>
<p dir="auto">Do i have to make a qmldir file and put one sentence that "singleton Fonts 1.0 Fonts.qml"?</p>
<p dir="auto">Thank for read my reply :)</p>
]]></description><link>https://forum.qt.io/post/745122</link><guid isPermaLink="true">https://forum.qt.io/post/745122</guid><dc:creator><![CDATA[Jaekook Choi]]></dc:creator><pubDate>Wed, 25 Jan 2023 08:06:14 GMT</pubDate></item><item><title><![CDATA[Reply to Unable to display text property on screen on Tue, 17 Jan 2023 10:09:02 GMT]]></title><description><![CDATA[<p dir="auto">can't you ship the font with your application?</p>
<pre><code>// main.cpp
// register shipped font to application
QFontDatabase::addApplicationFont(":/your/qrc/path/NanumGothic.ttf");
</code></pre>
<p dir="auto">You can also add the font from QML:</p>
<pre><code>// qmldir
singleton Fonts 1.0 Fonts.qml
</code></pre>
<pre><code>// Fonts.qml
pragma Singleton
import QtQuick 2.12

Item {
    property FontLoader nanumGothic: FontLoader {
        source: "qrc:/your/qrc/path/NanumGothic.ttf"
    }
    readonly property string indiFont: nanumGothic.name
}

</code></pre>
<pre><code>// in any other QML
Text{
    text: "ABCDEF"
    font.family: Fonts.indiFont
}
</code></pre>
]]></description><link>https://forum.qt.io/post/744092</link><guid isPermaLink="true">https://forum.qt.io/post/744092</guid><dc:creator><![CDATA[lemons]]></dc:creator><pubDate>Tue, 17 Jan 2023 10:09:02 GMT</pubDate></item><item><title><![CDATA[Reply to Unable to display text property on screen on Tue, 17 Jan 2023 07:05:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a></p>
<p dir="auto">I'm sorry</p>
<p dir="auto">vxworks7<br />
intel 8th<br />
based on Qt 6.2.3<br />
NanumGothic.ttf<br />
through invokeMethod</p>
<p dir="auto">in CPP<br />
QMetaObject::invokeMethod(m_pOperPPIQmlInstance, "show_c2a_key", Q_ARG(QVariant, indi));</p>
<p dir="auto">in QML<br />
function show_c2a_key(indi)<br />
{<br />
if(indi === 1) {<br />
c2a_key.text = "ABCDEFGHI"<br />
}<br />
}</p>
<p dir="auto">and</p>
<p dir="auto">Text{<br />
id: c2a_key<br />
x: 544<br />
y: 430<br />
color: "green"<br />
text: ""<br />
font.pixelSize: 16<br />
font.bold: true<br />
font.preferShaping: false<br />
}</p>
<p dir="auto">When the program runs, the terminal outputs the following statement:</p>
<p dir="auto">QFontDatabase: Cannot find font directory /usr/local/Qt-5.15.3/lib/fonts.<br />
Note that Qt no longer ships fonts. Deploy some (from <a href="https://dejavu-fonts.github.io/" target="_blank" rel="noopener noreferrer nofollow ugc">https://dejavu-fonts.github.io/</a> for example) or switch to fontconfig.</p>
<p dir="auto">Is there any connection?</p>
]]></description><link>https://forum.qt.io/post/744080</link><guid isPermaLink="true">https://forum.qt.io/post/744080</guid><dc:creator><![CDATA[Jaekook Choi]]></dc:creator><pubDate>Tue, 17 Jan 2023 07:05:59 GMT</pubDate></item><item><title><![CDATA[Reply to Unable to display text property on screen on Tue, 17 Jan 2023 05:12:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jaekook-choi">@<bdi>Jaekook-Choi</bdi></a> said in <a href="/post/744061">Unable to display text property on screen</a>:</p>
<blockquote>
<p dir="auto">What should i do</p>
</blockquote>
<p dir="auto">Provide more information.<br />
On which platform?<br />
On what hardware?<br />
Which Qt version?<br />
What font?<br />
What are you using to print text?</p>
]]></description><link>https://forum.qt.io/post/744066</link><guid isPermaLink="true">https://forum.qt.io/post/744066</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 17 Jan 2023 05:12:19 GMT</pubDate></item></channel></rss>