<?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[schrift aendern]]></title><description><![CDATA[<p>hola leute</p>
<p>wie kann ich die schrift fuer TextOut aendern ?</p>
<p>hab in meiner WndPRoc unter WM_CREATE folgendes dinnen:</p>
<pre><code class="language-cpp">hfont = CreateFont(10, 5, 0, 0, 700, TRUE, TRUE, FALSE, ANSI_CHARSET,

                   OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH,

                   &quot;Arial&quot;);
SendMessage(hwnd, WM_SETFONT, (WPARAM)hfont, MAKELONG(TRUE, 0));
</code></pre>
<p>es bleibt trotzdem die systemschrift oder was das sein soll.<br />
was hab ich da falsch gemacht ? bzw. wie macht man das richtig ?</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/157705/schrift-aendern</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 11:42:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/157705.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Aug 2006 18:19:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to schrift aendern on Mon, 28 Aug 2006 18:19:31 GMT]]></title><description><![CDATA[<p>hola leute</p>
<p>wie kann ich die schrift fuer TextOut aendern ?</p>
<p>hab in meiner WndPRoc unter WM_CREATE folgendes dinnen:</p>
<pre><code class="language-cpp">hfont = CreateFont(10, 5, 0, 0, 700, TRUE, TRUE, FALSE, ANSI_CHARSET,

                   OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH,

                   &quot;Arial&quot;);
SendMessage(hwnd, WM_SETFONT, (WPARAM)hfont, MAKELONG(TRUE, 0));
</code></pre>
<p>es bleibt trotzdem die systemschrift oder was das sein soll.<br />
was hab ich da falsch gemacht ? bzw. wie macht man das richtig ?</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126364</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Mon, 28 Aug 2006 18:19:31 GMT</pubDate></item><item><title><![CDATA[Reply to schrift aendern on Mon, 28 Aug 2006 18:33:02 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=1819" rel="nofollow">rüdiger</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=8" rel="nofollow">Rund um die Programmierung</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126371</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126371</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 28 Aug 2006 18:33:02 GMT</pubDate></item><item><title><![CDATA[Reply to schrift aendern on Mon, 28 Aug 2006 18:41:07 GMT]]></title><description><![CDATA[<p>Du schickst dir nur ne nachricht.<br />
hFont muss static in der wndproc sein.<br />
Dann einfach in WM_PAINT SelectObject(&lt;dein Kontext&gt;, hFont);<br />
Und bei WM_DESTROY wieder mit DestroyObject(hFont);<br />
vernichten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126380</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126380</guid><dc:creator><![CDATA[tobZel]]></dc:creator><pubDate>Mon, 28 Aug 2006 18:41:07 GMT</pubDate></item><item><title><![CDATA[Reply to schrift aendern on Mon, 28 Aug 2006 18:50:44 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>1. Die Schriftvariable muss static. Anschließend unter WM_DESTROY wieder freigeben.</p>
<p>2. TextOut und WM_SETFONT sind 2 Paar Schuhe: Mit TextOut malst du direkt auf<br />
den Display (jaja...über den DC) und bei WM_SETFONT setzt du die Schrift eines Controls.<br />
Dieses kümmert sich dann selbst um die Zeichenarbeiten. Bei TextOut muss du die Schrift wie<br />
tobZel schon sagte in den DC selektieren und anschließend (WICHTIG) das GDI Clean up dafür<br />
durchführen.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/12854">@tobZel</a>:</p>
<p>tobZel schrieb:</p>
<blockquote>
<p>[...]<br />
Und bei WM_DESTROY wieder mit DestroyObject(hFont);<br />
[...]</p>
</blockquote>
<p>DeleteObject(...) <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126385</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Mon, 28 Aug 2006 18:50:44 GMT</pubDate></item><item><title><![CDATA[Reply to schrift aendern on Mon, 28 Aug 2006 19:06:52 GMT]]></title><description><![CDATA[<p>re</p>
<p>static HFONT war mein fehler. cermy. DeletObject hab ich shco dabei gehabt.</p>
<p>wenn man in ner anwendung hausnummer 5 verschiedene schriftarten braucht. ist es dann sinnvoller am anfang schon die fonts zu erstellen oder erst dann wenn man sie braucht? ich hab leider keine ahnung wie lange das erzeugen einer schrift dauert und wieviel speicher so ein objekt in anspruch nimmt.<br />
wie macht man das eigendlich wenn man die schrift auf z.b. fett umstellen will ?<br />
font loeschen und wieder den gleichen mit attribut 'fett' erstellen ? oder kann man das anders aendern ?</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126394</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Mon, 28 Aug 2006 19:06:52 GMT</pubDate></item><item><title><![CDATA[Reply to schrift aendern on Mon, 28 Aug 2006 19:06:15 GMT]]></title><description><![CDATA[<p>Meep Meep schrieb:</p>
<blockquote>
<p>re</p>
<p>static HFONT war mein fehler. cermy. DeletObject hab ich shco dabei gehabt.</p>
<p>wenn man in ner anwendung hausnummer 5 verschiedene schriftarten braucht. ist es dann sinnvoller am anfang schon die fonts zu erstellen oder erst dann wenn man sie braucht? ich hab leider keine ahnung wie lange das erzeugen einer schrift dauert und wieviel speicher so ein objekt in anspruch nimmt.</p>
<p>Meep Meep</p>
</blockquote>
<p>Hängt von der Anzahl der Verwendung ab. Wo wird die denn gebraucht? -WM_PAINT ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126397</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126397</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Mon, 28 Aug 2006 19:06:15 GMT</pubDate></item><item><title><![CDATA[Reply to schrift aendern on Mon, 28 Aug 2006 19:10:40 GMT]]></title><description><![CDATA[<p>unter anderem fuer WM_PAINT.<br />
ich hab leider noch nicht so viel ahnung wie das intern ablaeuft.<br />
bei CreateFont gibt man mit den ersten 2 parametern den groesse der schrift an. woher weiß man, welche werte man eingeben muss, damit man eine z.b. 8 punkt schrift hat ?</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126399</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126399</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Mon, 28 Aug 2006 19:10:40 GMT</pubDate></item><item><title><![CDATA[Reply to schrift aendern on Mon, 28 Aug 2006 19:42:41 GMT]]></title><description><![CDATA[<p>Hast Du schon die WinAPI Reference?<br />
<a href="http://www.borland.com/devsupport/borlandcpp/patches/BC52HLP1.ZIP" rel="nofollow">http://www.borland.com/devsupport/borlandcpp/patches/BC52HLP1.ZIP</a></p>
<p>Seit neuestem hole ich mir die Schriftarten gleich zum Programmanfang:</p>
<pre><code class="language-cpp">HFONT hFontArial8;
HFONT hFontFixedsys;

void InitFont(void)
{
  LOGFONT lf;

  memset(&amp;lf, 0, sizeof(LOGFONT));
  lf.lfHeight = 8;
  strcpy(lf.lfFaceName, &quot;Arial&quot;);
  hFontArial8 = CreateFontIndirect(&amp;lf);
  strcpy(lf.lfFaceName, &quot;Fixedsys&quot;);
  hFontFixedsys = CreateFontIndirect(&amp;lf);
}

... WndProc(...)
{
  WM_CREATE:
      InitFont();
      return();
  WM_PAINT:
      BeginPaint();
      oldfont = (HFONT)SelectObject(hdc, hFontArial8);
      TextOut(hdc, 0, 0, &quot;Schweine im Weltall&quot;, strlen(&quot;Schweine im Weltall&quot;));
      SelectObject(hdc, oldfont);
      EndPaint();
      return();
  WM_DESTROY:
      DeleteObject(hFontArial8);
      DeleteObject(hFontFixedsys);
      return();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1126426</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126426</guid><dc:creator><![CDATA[keksekekse]]></dc:creator><pubDate>Mon, 28 Aug 2006 19:42:41 GMT</pubDate></item><item><title><![CDATA[Reply to schrift aendern on Mon, 28 Aug 2006 19:56:27 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/13442">@keksekekse</a>: Globale Variablen...naja <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1126433</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1126433</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Mon, 28 Aug 2006 19:56:27 GMT</pubDate></item></channel></rss>