http://redmine.emweb.be/http://redmine.emweb.be/favicon.ico?16934085252014-05-05T20:42:51ZRedmineWt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=91762014-05-05T20:42:51ZKeith StevensKeith@gotechknow.com
<ul></ul><p>I got it to compile by casting the argument as:<br><br>
pango_ft2_font_map_create_context((PangoFT2FontMap*)pangoFontMap);</p>
<p>i.e. changed this:</p>
<p>#if PANGO_VERSION_MAJOR > 1 || PANGO_VERSION_MINOR > 21<br><br>
context_ = pango_font_map_create_context(pangoFontMap);<br><br>
#else<br><br>
context_ = pango_ft2_font_map_create_context(pangoFontMap);<br><br>
#endif</p>
<p>to this:<br><br>
#if PANGO_VERSION_MAJOR > 1 || PANGO_VERSION_MINOR > 21<br><br>
context_ = pango_font_map_create_context(pangoFontMap);<br><br>
#else<br><br>
context_ = pango_ft2_font_map_create_context((PangoFT2FontMap*)pangoFontMap);<br><br>
#endif</p>
<p>Don't know yet if that's going to run without segfault but I'll let you know.</p>
Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=92212014-05-07T17:31:58ZKeith StevensKeith@gotechknow.com
<ul></ul><p>I resolved this by using an older version.</p>
Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=92282014-05-13T09:27:08ZKoen Deforchekoen@emweb.be
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>InProgress</i></li><li><strong>Assignee</strong> set to <i>Koen Deforche</i></li></ul> Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=92292014-05-13T09:30:58ZKoen Deforchekoen@emweb.be
<ul><li><strong>Status</strong> changed from <i>InProgress</i> to <i>Feedback</i></li></ul><p>Hey,</p>
<p>What version of pango were you using when you had this problem. And what pango version are you using that resolved the problem?</p>
<p>It seems that you should have got this problem only if something was wrong with pango version detection or if you were using a very old pango version?</p>
<p>Regards,<br><br>
koen</p>
Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=99592014-09-04T12:32:36ZAlan Finleyhanksmail@gmail.com
<ul></ul><p>I have the same problem.<br><br>
I'm trying to build Wt in Centos 5 and <code>pango-1.20.4-1.6</code> is the newest package I could find for that OS.<br><br>
So I get a compile error here:</p>
<pre><code> if (!pangoFontMap)
pangoFontMap = pango_ft2_font_map_new();
#if PANGO_VERSION_MAJOR > 1 || PANGO_VERSION_MINOR > 21
context_ = pango_font_map_create_context(pangoFontMap);
#else
context_ = pango_ft2_font_map_create_context(pangoFontMap);
#endif
</code></pre>
<p><code>pango_ft2_font_map_create_context</code> function takes an argument of type <code>PangoFT2FontMap</code>, but the <code>pangoFontMap</code> variable is <code>PangoFontMap</code>.</p>
Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=99612014-09-04T12:41:30ZKoen Deforchekoen@emweb.be
<ul></ul><p>Hey,</p>
<p>Ah, indeed, it looks like casting to PangoFT2FontMap* should be correct. Can you confirm?</p>
<p>Regards,<br><br>
koen</p>
Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=99622014-09-04T14:12:59ZAlan Finleyhanksmail@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/1624">pango.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1624/pango.patch">pango.patch</a> added</li></ul><p>I don't think that using c-style casts on structs is a good idea :)</p>
<p>So I used <code>PANGO_FT2_FONT_MAP</code> macro to perform cast:</p>
<pre><code>context_ = pango_ft2_font_map_create_context(PANGO_FT2_FONT_MAP(pangoFontMap));
</code></pre>
<p>Then I built a simple example with a <code>WRasterImage</code>:</p>
<pre><code>Wt::WRasterImage pngImage("png", 600, 400);
Wt::WPainter p(&pngImage);
p.drawText(Wt::WRectF(0, 0, 100, 100), Wt::AlignLeft, Wt::TextSingleLine, "PANGO TEST");
std::ofstream f("pango_test.png", std::ios::out | std::ios::binary);
pngImage.write(f);
</code></pre>
<p>It produces a png file with a text. The only difference is that I get an image with a white background on Centos 5 and an image with a transparent background on Centos 6. But I'm not sure this is relevant to this issue.</p>
<p>You can see my patch in the attachment.</p>
Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=99632014-09-04T15:06:27ZAlan Finleyhanksmail@gmail.com
<ul></ul><p>Also I'm not sure about this ckeck:</p>
<pre><code>#if PANGO_VERSION_MAJOR > 1 || PANGO_VERSION_MINOR > 21
</code></pre>
<p>Should it be <code>&&</code> instead of <code>||</code>?</p>
Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=99642014-09-04T16:54:57ZKoen Deforchekoen@emweb.be
<ul></ul><p>Hey Alan,</p>
<p>Thanks for the patch.<br><br>
The check is fine since we want everything later than 1.21 ?</p>
<p>Regards,<br><br>
koen</p>
Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=99652014-09-04T18:31:42ZAlan Finleyhanksmail@gmail.com
<ul></ul><p>Koen Deforche wrote: </p>
<blockquote>
<p>The check is fine since we want everything later than 1.21 ?<br><br>
Old version 0.28 will pass the current check.<br><br>
I think it should be:</p>
</blockquote>
<pre><code>#if PANGO_VERSION_MAJOR >= 1 && PANGO_VERSION_MINOR > 21
</code></pre> Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=99662014-09-05T09:38:11ZKoen Deforchekoen@emweb.be
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Resolved</i></li><li><strong>Target version</strong> set to <i>3.3.4</i></li></ul> Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=99672014-09-05T09:40:09ZKoen Deforchekoen@emweb.be
<ul></ul><p>Hey,</p>
<p>Pango 1.0 dates from 2002, and we do not support pango < 1 (which probably has many API differences).<br><br>
Moreover, the '&&' variant will not match pango 2.0</p>
<p>Regards,<br><br>
koen</p>
Wt - Bug #3069: Wt compile error: cannot convert ‘PangoFontMap*’ to ‘PangoFT2FontMap*’ for argument ‘1’ to ‘PangoContext* pango_ft2_font_map_create_contexthttp://redmine.emweb.be/issues/3069?journal_id=102982014-10-22T00:29:34ZKoen Deforchekoen@emweb.be
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>