|
From: Mojca M. <moj...@gm...> - 2012-01-09 17:40:36
|
Hello, browsing through my MacPorts (actually, I was unsuccessfully trying to figure out how to convince Octave to use a different gnuplot binary, so that I wouldn't have to use X11 for plotting), I figured out that MacPorts keep patching gnuplot with the following: http://trac.macports.org/changeset/76048 --- src/variable.c.orig 2010-10-18 15:41:53.000000000 +0200 +++ src/variable.c 2010-10-18 15:42:11.000000000 +0200 @@ -244,13 +244,13 @@ }; #endif -#if defined(_Macintosh) && !defined(FONTPATHSET) +#if defined(__APPLE__) && !defined(FONTPATHSET) # define FONTPATHSET static const struct path_table fontpath_tbl[] = { - { "/System/Library/Fonts!" }, - { "/Library/Fonts!" }, - { "$(HOME)/Library/Fonts!" }, + { "/System/Library/Fonts" }, + { "/Library/Fonts" }, + { "$(HOME)/Library/Fonts" }, { NULL } }; #endif I'm not sure how this influences terminals (which terminals are influenced). If I try Zapfino font, I get mixed results: - AquaTerm: works properly - X11: font is change to some random font (but that is almost ok, there's a chance that it is not easy to configure X11 to use that font) - wxt: (process:9969): Pango-WARNING **: couldn't load font "Zapfino Not-Rotated 200", falling back to "Sans Not-Rotated 200", expect ugly output. This should probably not have happened. The font should work. (But I'm not sure which libraries are trying to find fonts.) The same behaviour is observed even if I apply the patch. - png: > set term png Terminal type set to 'png' Could not find/open font when opening font "arial", using internal non-scalable font (which means that there is something wrong with fonts, but I remember asking for a patch of gd library, but the library is probably still at 36 RC1 and even though patched, the patch has never been released together with a library; maybe I could ask MacPorts team to patch their library in the same way to see if anything gets improved) - qt: works, but look awful since the font is not antialiased (that might be an easy patch - just a boolean value to set somewhere) About the patch: as already discussed, "defined(_Macintosh)" has zero influence. (See GP archives "Identifying system with macro": http://thread.gmane.org/gmane.comp.graphics.gnuplot.devel/9978, http://thread.gmane.org/gmane.comp.graphics.gnuplot.devel/9988). There is no _Macintosh defined anywhere. The three folders are relevant for modern OS, but honestly I don't know how that code influences any terminal to be able to test if patching the code actually makes any difference. If nothing else it would be great in MacPorts wouldn't need the above mentioned patch any more. About the remaining "_Macintosh" entries: 1.) in term.h: /* Apple Macintosh */ #ifdef _Macintosh # include "mac.trm" #endif 1.a) Can somebody please explain me where any of the functions like MAC_text are defined? It seems to me as if term/mac.trm does nothing. I must be blind, but I don't find any function implemented anywhere. 1.b) Obviously that doesn't hurt anyone since _Macintosh isn't defined anywhere but on ancient machines. But what's the point in keeping it if mac.trm is empty anyway? (I suspect that there was some other mac-specific source somewhere that got lost in years.) 2.) in plot.c: #if defined(_Windows) || defined(_Macintosh) int gnu_main(int argc, char **argv) #else int main(int argc, char **argv) #endif I don't understand what this does, but gnu_main is probably not needed on Apple (modern Mac OS X), so "|| defined(_Macintosh)" may probably go away if there is no code to support the old macintosh anyway. 3.) in command.c: if (sleep_time < 0) { #if defined(_Windows) ... #elif defined(_Macintosh) if (strcmp(term->name, "macintosh") == 0 && sleep_time < 0) Pause( (int)sleep_time ); This also seems to be related to the old _Macintosh. But if there is no code for the old mac, there is little point in keeping this one as well. Mojca |