Want to suppress a warning

View: New views
3 Messages — Rating Filter:   Alert me  

Want to suppress a warning

by gOS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I want to suppress a specific warning from pgnuplot:

"(pgnuplot.exe:3664): Pango-WARNING **: couldn't load font "C:\WINDOWS\Fonts\COUR.ttf Not-Rotated 200", falling back to "Sans Not-Rotated 200",  expect ugly output."

I realize this is not a specific Octave question, but I only deal with pgnuplot through octave, so I'd like to know if there is a way to prevent this from showing up.

I know usually the recommendation is to use ** set(0, 'defaulttextfontname', '*') **; however, I would like to use the font COUR.ttf, as the default font set by '*' does not print correctly to a .png file. So, I would like to use ** set(0, 'defaulttextfontname', 'C:\WINDOWS\Fonts\COUR.ttf') **, but I want to suppress the pgnuplot pango warning that comes up.

I understand the warning, but less informed users who use the scripts and are unfamiliar with the difference between an error and a warning tend to view the warning as a problem and then don't trust their results.

Please advise and thank you.


Re: Want to suppress a warning

by Michael Goffioul-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Might be completely unrelated, but why don't you try
set(0, 'defaulttextfontname', 'Courier New')
Doesn't that work?

Michael.


On Fri, Jan 2, 2009 at 2:21 PM, gOS <bkirklin@...> wrote:

>
> I want to suppress a specific warning from pgnuplot:
>
> "(pgnuplot.exe:3664): Pango-WARNING **: couldn't load font
> "C:\WINDOWS\Fonts\COUR.ttf Not-Rotated 200", falling back to "Sans
> Not-Rotated 200",  expect ugly output."
>
> I realize this is not a specific Octave question, but I only deal with
> pgnuplot through octave, so I'd like to know if there is a way to prevent
> this from showing up.
>
> I know usually the recommendation is to use ** set(0, 'defaulttextfontname',
> '*') **; however, I would like to use the font COUR.ttf, as the default font
> set by '*' does not print correctly to a .png file. So, I would like to use
> ** set(0, 'defaulttextfontname', 'C:\WINDOWS\Fonts\COUR.ttf') **, but I want
> to suppress the pgnuplot pango warning that comes up.
>
> I understand the warning, but less informed users who use the scripts and
> are unfamiliar with the difference between an error and a warning tend to
> view the warning as a problem and then don't trust their results.
>
> Please advise and thank you.
>
>
> --
> View this message in context: http://www.nabble.com/Want-to-suppress-a-warning-tp21251936p21251936.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> Help-octave@...
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: Want to suppress a warning

by gOS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I meant to hit 'reply all' but apparently hit reply. In case this affects another person's input here's the correspondence:


-----Original Message-----
From: Michael Goffioul [mailto:michael.goffioul@gmail.com]
Sent: Friday, January 02, 2009 9:36 AM
To: gOS
Cc: help-octave@octave.org
Subject: Re: Want to suppress a warning

Might be completely unrelated, but why don't you try set(0, 'defaulttextfontname', 'Courier New') Doesn't that work?

Michael.

The method I used to set it as COUR.tff is how I need to do it to get Courier New to work. That is fine, it displays properly in both the plot window and in the .png file, but I receive the warning. I'm receiving exactly the output I desire from Octave and gnuplot with what I'm doing, but I want to suppress the pango warning so that other people don't think something is going wrong, when there isn't anything wrong going on.

So, is there a way to suppress the warning from pgnuplot with some sort of pragma-like command from in Octave?


> I understand your problem, but I was just wondering whether the warning is not related to the way you > define the font name from octave.

> Michael.

On Fri, Jan 2, 2009 at 3:01 PM, Brian <bkirklin@quantapoint.com> wrote:
> I'll expand on what happens in each case I've tried so that you can
> understand why I've chosen what I have as a solution. I understand you
> as well, but this may make my situation more clear.
>
> Different responses received:
>
> ------------------------------------------------
> set(0, 'defaulttextfontname', '*');
> ------------------------------------------------
> RESULTS:
>> Proper display of all text in pgnuplot window.
>> Lines of text are not saved to the .png file.
>> Several errors are returned by pgnuplot about the kind of font being
>> used. (gdImageStringFt)
> ________________________________________________
>
> ------------------------------------------------
> set(0, 'defaulttextfontname', 'Courier New');
> ------------------------------------------------
> RESULTS:
>> Proper display of all text in pgnuplot window.
>> No text at all is saved to the .png file.
>> Errors are returned for each line of text from pgnuplot.
>> (gdImageStringFt)
> ________________________________________________
>
> ----------------------------------------------------------------
> set(0, 'defaulttextfontname', 'C:\\WINDOWS\\Fonts\\COUR.ttf');
> ----------------------------------------------------------------
> RESULTS:
>> Proper display of all text in pgnuplot window and in .png.
>> One warning from gnuplot is returned.
> ________________________________________________________________
>
>
> Without giving the specific path and address to the font, GNUplot
> appears unable to properly print the fonts to the .png file. I visited
> their site and browsed the history of this mailing list to discover
> the cause of this problem and possible solutions.
> The GNUplot website suggested that I used the absolute path, and I've
> not had problems with the display since then, which was the desired
> result.
>
> I've tried several different ways of setting the font to receive the
> desired output without the *pango* warning, but as of yet, I can't
> avoid that specific warning and have proper printing in both locations
> without a message from pgnuplot.
>
> All text displays in the plot window when I do that, but then no text
> shows up in the .png file.
>
> I do appreciate the suggestion, but I've tested that already.
>
> I'll also mention that saving to .eps works perfectly, but I'd like to
> save to .png as .eps isn't supported well on Microsoft machines
> without installing additional products, and there are too many
> machines and users who don't respond well to multi-software solutions
> for that solution to work well.
>
> Am I to take it that I can't suppress the pango warning from inside
> Octave since you haven't told me how I might do it?

I don't know if you can suppress the warnings, but if there's a way, it is to be found in pango documentation (maybe it's controlled by some config file or some env variable).

Michael.

Anyhow, I'm looking into the pango, glib, and pgnuplot documentation, but have not turned anything up yet