<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Установка шрифтов в Magick++ (ImageMagick для C++)]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=24155&amp;type=atom" />
	<updated>2012-09-07T09:15:02Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=24155</id>
		<entry>
			<title type="html"><![CDATA[Re: Установка шрифтов в Magick++ (ImageMagick для C++)]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297472#p297472" />
			<content type="html"><![CDATA[<p>:facepalm: по локоть...<br />Я истерзал гугл и оф. сайт, но не обратил внимания на второй конструктор...</p><p>Большое спасибо! Какой формат пива предпочтителен?&nbsp; <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p>]]></content>
			<author>
				<name><![CDATA[Storm]]></name>
				<uri>https://linuxforum.ru/profile.php?id=263</uri>
			</author>
			<updated>2012-09-07T09:15:02Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297472#p297472</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Установка шрифтов в Magick++ (ImageMagick для C++)]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297459#p297459" />
			<content type="html"><![CDATA[<p>для списка шрифтов пользуй: convert -list font<br />никакие «fully qualified X font names» указывать не надо... просто обычное название, что после Font: стоит... <br />видать доки писались в те времена, когда шрифты были глупые, растровые и ни кто окромя иксов о них ничего поведать не мог...<br />отрендарил пару картинок с:<br /></p><div class="codebox"><pre><code>// отрендерил пару картинок с:
    draw_list.push_back(DrawableFont(&quot;Dejavu-Sans-Mono-Book&quot;));
    draw_list.push_back(DrawablePointSize(20));</code></pre></div><p>// и с:<br />&nbsp; &nbsp; draw_list.push_back(DrawableFont(&quot;Dejavu&quot;, NormalStyle, 400, NormalStretch));</p><br /><p>ЗЫ: если и правда так правильно, то с тебя пиво...</p>]]></content>
			<author>
				<name><![CDATA[Fat-Zer]]></name>
				<uri>https://linuxforum.ru/profile.php?id=11911</uri>
			</author>
			<updated>2012-09-07T07:11:10Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297459#p297459</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Установка шрифтов в Magick++ (ImageMagick для C++)]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297441#p297441" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#include &lt;cstdlib&gt;
#include &lt;list&gt;
#include &lt;iostream&gt;
using namespace std;

#include &lt;Magick++.h&gt;
using namespace Magick;

/*
 * 
 */
int main (int argc, char** argv)
{
    InitializeMagick(*argv);
    
    Image image = Image(&quot;180x100&quot;, &quot;white&quot;);
    
    list&lt;Drawable&gt; draw_list;
    
    // set the text font: the font is specified via a string representing
    // a fully qualified X font name (wildcards &#039;*&#039; are allowed)
    
    //draw_list.push_back(DrawableFont(&quot;-*-droid sans-*-*-*-*-*-*-*-*-*-*-*-ru&quot;));  //    &lt;=--  настройка шрифта
    
    // -misc-fixed-medium-o-semicondensed—13-*-*-*-c-60-iso8859-1
    // -*-droid sans-*-*-*-*-*-*-*-*-*-*-*-ru    
    
    // set the text to be drawn at specified position
    draw_list.push_back(DrawableText(10, 10, &quot;Один два три&quot;));

    // set the text color (the fill color must be set to transparent)
    draw_list.push_back(DrawableStrokeColor(Color(&quot;black&quot;)));
    draw_list.push_back(DrawableFillColor(Color(0, 0, 0, MaxRGB)));

    image.draw(draw_list);

    try
    {
        image.write(&quot;output_image.png&quot;);
    }
    catch (Exception &amp;error_)
    {
        cout &lt;&lt; &quot;Caught exception: &quot; &lt;&lt; error_.what() &lt;&lt; endl;
        return 1;
    }

    return 0;
}</code></pre></div><div class="codebox"><pre><code>g++ -c -g -I/usr/include/ImageMagick -I. -MMD -MP -MF main.o.d -o main.o main.cpp
g++ `Magick++-config --cppflags --cxxflags --ldflags --libs` -o grm main.o</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Storm]]></name>
				<uri>https://linuxforum.ru/profile.php?id=263</uri>
			</author>
			<updated>2012-09-07T05:21:51Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297441#p297441</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Установка шрифтов в Magick++ (ImageMagick для C++)]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297409#p297409" />
			<content type="html"><![CDATA[<p>шут его знает... <br />если выложишь минимальный компилируемый пример - могу посмотреть...</p>]]></content>
			<author>
				<name><![CDATA[Fat-Zer]]></name>
				<uri>https://linuxforum.ru/profile.php?id=11911</uri>
			</author>
			<updated>2012-09-06T17:18:01Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297409#p297409</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Установка шрифтов в Magick++ (ImageMagick для C++)]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297272#p297272" />
			<content type="html"><![CDATA[<p>Выбираю в ней шрифт, использую его в исходнике, в результате ошибки <br /></p><div class="quotebox"><blockquote><p>Resource temporarily unavailable @ error/xwindow.c/XBestFont/831</p></blockquote></div><p>нет, но и текст на картинке не отрисовывается.</p>]]></content>
			<author>
				<name><![CDATA[Storm]]></name>
				<uri>https://linuxforum.ru/profile.php?id=263</uri>
			</author>
			<updated>2012-09-06T07:23:32Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297272#p297272</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Установка шрифтов в Magick++ (ImageMagick для C++)]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297169#p297169" />
			<content type="html"><![CDATA[<p>в сторону <strong>xfontsel</strong> стоит подумать...</p>]]></content>
			<author>
				<name><![CDATA[Fat-Zer]]></name>
				<uri>https://linuxforum.ru/profile.php?id=11911</uri>
			</author>
			<updated>2012-09-05T13:40:04Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297169#p297169</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Установка шрифтов в Magick++ (ImageMagick для C++)]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297166#p297166" />
			<content type="html"><![CDATA[<p>Нужно иметь возможность выводить на картинках текст. <br />В документации к Magick++ говорится про некие &quot;fully qualified X font names&quot;, и эти строки, большая часть содержания которых мне не ясна, используются для указания какой шрифт использовать при отрисовке надписи.</p><p>Вот кусок из руководства:<br /></p><div class="quotebox"><cite>Magick++ tutorial пишет:</cite><blockquote><p>DrawableFont::DrawableFont(const string&amp; font_name) // &#039;font_name&#039; is a string containing<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // a fully qualified X font name<br />// Following is a listing of several font names generally available on Linux systems<br />// (fully qualified X font names)<br />// &quot;-*-helvetica-[medium/bold]-[r/o]-normal-*-*-[80/100/120/140/180]-75-75-*-*-iso8859-1&quot;<br />//<br />» typical usage size is 120<br />// &quot;-misc-fixed-[medium/bold]-[r/o]-[normal/semicondensed]-*-*-[100/120/140/200]-75-75-*-*-iso8859-1&quot;;<br />//<br />» typical usage size is 120, and for this size all combinations are valid<br />//<br />» for all other sizes the combinations are restricted, but the ...-medium-r-normal-...<br />//</p><p>font variants work for all sizes<br />// Example of setting up a DrawableFont object<br />DrawableFont(&quot;-*-helvetica-medium-r-normal-*-*-120-*-*-*-*-iso8859-1&quot;);</p></blockquote></div><p>Проблема в том что, я не могу выяснить какие &quot;fully qualified X font names&quot; доступны в моей системе. <br />Если я использую настройки из приведенного фрагмента, текст не отрисовывается. Если я просто закомментирую строку с этой настройкой - отрисовывается, видимо каким-то стандартным шрифтом.</p><div class="codebox"><pre><code>identify -list font</code></pre></div><p>выдает довольно обширный список, но как из него получить &quot;fully qualified X font names&quot;?</p>]]></content>
			<author>
				<name><![CDATA[Storm]]></name>
				<uri>https://linuxforum.ru/profile.php?id=263</uri>
			</author>
			<updated>2012-09-05T12:58:33Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297166#p297166</id>
		</entry>
</feed>
