|
From: Tatsuro M. <tma...@ya...> - 2010-03-20 11:02:45
|
Hello Recently, in the one of the gnuplot in Japan, the font setting around fontconfig has been extensively discussed. Two topics are mainly has been discussed. One is the font setting on the gd related terminals linked with the fontconfig. The other is how to add new fonts in the terminals where the fontconfig treats font mapping on windows. Here I introduce the first one. In the current cygwin, the gd library provide by the cygwin team is linked with the fontconfig library. And the windows binaries of gcc-4.4.0 are also prepared with the gd library with the fontconfig without deep consideration. In the discussions in the threads it was noticed that the gd linked with the fontconfig affects the font setting of gd related terminals (png, jpeg, and gif). In this case the font setting is almost the same as the pango related terminals (wxt, pdfcairo, pngcairo). The font setting like set term png font "/usr/local/fonts/ttf/arial.ttf" is not allowed and one must use set term png font 'arial' and fonts used in these terminals have to be set through the forntconfig configuration files. In addition GDFONTPATH is not effective. The situation is obviously contradicted to the current manual concerning to the gd related terminals. However, from the view point unification of font setting among the terminals, the situation is not always bad. The below also is to be considered. In the unixy distributions, the dependencies are usually provided from the distributions. In the case, users use the gd library linked with the fontconfig happens to be used without deep consideration like me. (In this case, the cygwin is categorized as unixy.) I would like to hear the opinions from the developers and experts of the gnuplot on this matter. Should next binary distribution be prepared with the gd not linked with the fontconfig library ? Regards Tatsuro -------------------------------------- VANCOUVER 2010 PARALYMPIC GAMES News http://pr.mail.yahoo.co.jp/para/ |
|
From: Ethan M. <merritt@u.washington.edu> - 2010-03-20 16:52:14
|
On Saturday 20 March 2010, Tatsuro MATSUOKA wrote:
>
> In the current cygwin, the gd library provide by the cygwin team is linked with the
> fontconfig library. And the windows binaries of gcc-4.4.0 are also prepared
> with the gd library with the fontconfig without deep consideration.
What is the exact version of libgd?
> In the discussions in the threads it was noticed that the gd linked
> with the fontconfig affects the font setting of gd related terminals
> (png, jpeg, and gif).
>
> In this case the font setting is almost the same as the pango related
> terminals (wxt, pdfcairo, pngcairo).
>
> The font setting like
> set term png font "/usr/local/fonts/ttf/arial.ttf"
> is not allowed and one must use set term png font 'arial'
Both are allowed. The 'old' method using the filename of the font
is tried first. If that fails, then the 'new' fontconfig method is
used.
> and fonts used in these terminals have to be set through the forntconfig
> configuration files. In addition GDFONTPATH is not effective.
> The situation is obviously contradicted to the current manual
> concerning to the gd related terminals.
I think it is likely that your gnuplot executable was linked against
a buggy version of libgd. When the fontconfig code was first added
to libgd (2.0.36RC1), there was a bug that prevented using both methods
from the same calling program. That bug was later fixed.
Here is the fix:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--- gd-2.0.36RC1/gdft.c 2007-11-27 00:30:34.000000000 -0800
+++ gd-fixed/gdft.c 2009-05-20 20:22:13.000000000 -0700
@@ -1661,7 +1661,7 @@ static char * font_path(char **fontpath,
BGD_DECLARE(int) gdFTUseFontConfig(int flag)
{
#ifdef HAVE_LIBFONTCONFIG
- fontConfigFlag = 1;
+ fontConfigFlag = flag;
return 1;
#else
return 0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> Should next binary distribution be prepared with the gd not linked with
> the fontconfig library ?
It should be linked against a fixed version of libgd.
Unfortunately I don't see a fixed version listed for download on
libgd.org. I am cc'ing libgd maintainer Pierre Joye, who may be
able to update the version on the site.
Pierre: Isn't it about time that a "final" version of 2.0.36
is packaged up? The -RC1 is now more than 2 years old!
Here is the output from gnuplot-4.4.0 built from source and linked
against libgd 2.0.36RC1 + bugfix. I added a pair of debug statement
to gd.trm so that you can see how the font search works
gnuplot>
gnuplot> set term png font '/home/ttfonts/verdana.ttf'
Terminal type set to 'png'
Trying to find font "/home/ttfonts/verdana.ttf" using old mechanism succeeded
Options are 'nocrop font /home/ttfonts/verdana.ttf 12 fontscale 1.0 size 640,480 '
gnuplot> set term png font 'Embargo'
Terminal type set to 'png'
Trying to find font "Embargo" using old mechanism failed
Trying to find font "Embargo" using new mechanism succeeded
Options are 'nocrop font Embargo 12 fontscale 1.0 size 640,480 '
regards,
Ethan
|
|
From: Tatsuro M. <tma...@ya...> - 2010-03-20 21:37:07
|
Hello
Thank you for your reply.
--- Ethan Merritt wrote:
>What is the exact version of libgd?
I have been using the gd-2.0.36RC1.
> Both are allowed. The 'old' method using the filename of the font
> is tried first. If that fails, then the 'new' fontconfig method is
> used.
> I think it is likely that your gnuplot executable was linked against
> a buggy version of libgd. When the fontconfig code was first added
> to libgd (2.0.36RC1), there was a bug that prevented using both methods
> from the same calling program. That bug was later fixed.
>
> Here is the fix:
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> --- gd-2.0.36RC1/gdft.c 2007-11-27 00:30:34.000000000 -0800
> +++ gd-fixed/gdft.c 2009-05-20 20:22:13.000000000 -0700
> @@ -1661,7 +1661,7 @@ static char * font_path(char **fontpath,
> BGD_DECLARE(int) gdFTUseFontConfig(int flag)
> {
> #ifdef HAVE_LIBFONTCONFIG
> - fontConfigFlag = 1;
> + fontConfigFlag = flag;
> return 1;
> #else
> return 0;
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I have tried the change of 'gdft.c' proposed by Kakuto in the threads introduced the previous post.
######################
BGD_DECLARE(int) gdFTUseFontConfig(int flag)
{
#ifdef HAVE_LIBFONTCONFIG
if(flag) {
fontConfigFlag = 1;
return 1;
} else {
fontConfigFlag = 0;
return 0;
}
#else
return 0;
#endif /* HAVE_LIBFONTCONFIG */
#####################
The modification the above seems to be logically the same as your patch.
At the previous post I seemed to do mis-confirmation.
I have put cour.ttf to 'C:/usr/tatsu/test/gptest/cour.ttf'
gnuplot> set term png font 'C:/usr/tatsu/test/gptest/cour.ttf'
Terminal type set to 'png'
Options are 'nocrop font C:/usr/tatsu/test/gptest/cour.ttf 12 fontscale 1.0 size 640,480 '
gnuplot> set out 'test.png'
gnuplot> plot sin(x)
gnuplot> set out
The gnuplot with the modified gd successfully gave a graph with courier fonts while the gnuplot-4.4.0
binary gave a graph with arial.
Therefore the modification proposed by Kakuto allow the gd linked with fontconfig to use old syntax.
However I cannot see the below message that you pointed out.
********
Trying to find font "/home/ttfonts/verdana.ttf" using old mechanism succeeded
*********
Anyway I will use your patch if new gd will not be available.
>
> It should be linked against a fixed version of libgd.
> Unfortunately I don't see a fixed version listed for download on
> libgd.org. I am cc'ing libgd maintainer Pierre Joye, who may be
> able to update the version on the site.
>
> Pierre: Isn't it about time that a "final" version of 2.0.36
> is packaged up? The -RC1 is now more than 2 years old!
In related to 'libpng-1.4', I have posted the gd should be modified not to use png_check_sig but to
use png_sig_cmp.
Please see;
http://old.nabble.com/Note-for-building-gd-wiwith-libpng-1.4-to27808790.html
Manfred Schwarb introduced me a tip.tar.gz on
http://bitbucket.org/pierrejoye/gd-libgd-20/get/tip.tar.gz.
However I do not have it in my home computer and it unfortunately could not be used I could not
configure script because of error related the autotool.
I will wait for the reply.
Anyway I will make gnuplot-4.5 (cvs) package for windows prepared with gd 2.0.36RC1+fontconfig with
the patch you have shown and upload it on my web.
For the cygwin, the gd library prepared by the maintainer on the cygwin community. I will report this
topic in the cygwin ML.
Regards
Tatsuro
--------------------------------------
VANCOUVER 2010 PARALYMPIC GAMES News
http://pr.mail.yahoo.co.jp/para/
|
|
From: Manfred S. <man...@gm...> - 2010-03-20 23:07:36
|
Am Sonntag, den 21.03.2010, 06:36 +0900 schrieb Tatsuro MATSUOKA: > Hello > Manfred Schwarb introduced me a tip.tar.gz on > http://bitbucket.org/pierrejoye/gd-libgd-20/get/tip.tar.gz. This link is always the latest check-out of the new development repository of libgd. > However I do not have it in my home computer and it unfortunately could not be used I could not > configure script because of error related the autotool. > In my follow-up mail of march 7, 2010 I indicated how to fix it. You have to modify configure.ac. Some time ago I had some problems with libtool when building libgd, I had to do something like the following for the generated file "libtool": # sed -i 's/^ECHO=.\?echo.*/ECHO=echo; echo=echo/' libtool But this was most likely an issue of libtool and not of libgd. Cheers, Manfred |
|
From: Manfred S. <man...@gm...> - 2010-03-20 23:21:40
|
Am Sonntag, den 21.03.2010, 00:07 +0100 schrieb Manfred Schwarb: > > > However I do not have it in my home computer and it unfortunately could not be used I could not > > configure script because of error related the autotool. > > > > In my follow-up mail of march 7, 2010 I indicated how to fix it. You > have to modify configure.ac. For gd-devel readers, this was: Although recent checkouts do not compile, as configure.ac additions have to be made for the latest added test cases: Around line 570 of configure.ac, you have to add tests/gdimagefilledpolygon/Makefile tests/gdimageopenpolygon/Makefile tests/gdimagepolygon/Makefile Cheers, Manfred |
|
From: Tatsuro M. <tma...@ya...> - 2010-03-21 03:40:28
|
Hello Manfred Schwarb Thank you for your mail. Excuse this post is not directly related for gnuplot. Please allow me. --- Manfred Schwarb wrote: > In my follow-up mail of march 7, 2010 I indicated how to fix it. You > have to modify configure.ac. > ****************** I know your follow up. But ./bootstrap.sh failed at that time. I have reported to perhaps to 'issues' in http://bitbucket.org/pierrejoye/gd-libgd-20 I cannot find it now. I have now download gd-libgd-20-tip.tar.gz again. I have tried again. After the change you suggested, ********** Around line 570 of configure.ac, you have to add tests/gdimagefilledpolygon/Makefile tests/gdimageopenpolygon/Makefile tests/gdimagepolygon/Makefile *********** ./bootstrap.sh was carried out. The results are On cygwin $ ./bootstrap.sh configure.ac:64: warning: macro `AM_ICONV' not found in library configure.ac:64: error: possibly undefined macro: AM_ICONV If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. Failed At that time I have stopped here. configure.ac:64: error: possibly undefined macro: AM_ICONV ****************** configure.ac:64-67 AM_ICONV # if test -n "$LIBICONV" ; then # LIBS="$LIBS $LIBICONV" # fi **************** I commented out AM_ICONV like #AM_ICONV The ./bootstrap.sh went well. And the I go back Msys+mingw cd "C:\usr\tatsu\mingwhome\tools\gd\gd-libgd-2.0_20100119_build" CC='gcc -shared-libgcc' \ CPPFLAGS='-DHAVE_BOOLEAN -I/WinDevTools/include' \ LDFLAGS='-L/WinDevTools/lib' \ CFLAGS='-O3 -fomit-frame-pointer' \ LIB='-liconv' \ ../gd-libgd-2.0_20100119/configure --disable-libtool-lock --prefix=/WinDevTools configure seemed went well but At the make /bin/sh ./libtool --tag=CC --mode=compile gcc -shared-libgcc -DHAVE_CONFIG_H -I. -I../gd-libgd-2.0_20100119 -I/WinDevTools/include/freetype2 -I/WinDevTools/include -DHAVE_BOOLEAN -I/WinDevTools/include -I/WinDevTools/include/libpng14 -O3 -fomit-frame-pointer -MT gd.lo -MD -MP -MF .deps/gd.Tpo -c -o gd.lo ../gd-libgd-2.0_20100119/gd.c ./libtool: line 869: X--tag=CC: command not found ./libtool: line 902: libtool: ignoring unknown tag : command not found : : The I saw /libtool: line 868-871 ************************** case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac ************************* This is the same as line 812-816 of libtool of generated on gc-2.0.36RC1 case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac This can not be fixed by your suggestion # sed -i 's/^ECHO=.\?echo.*/ECHO=echo; echo=echo/' libtool (Perhaps 'sed -e' is correct) I cannot go forward any longer. Any suggestions? Regards Tatsuro -------------------------------------- VANCOUVER 2010 PARALYMPIC GAMES News http://pr.mail.yahoo.co.jp/para/ |
|
From: Tatsuro M. <tma...@ya...> - 2010-03-21 03:51:48
|
Hello I can build gd library by copying libtool by gd-2.0.36RC1 to the current build directory. This is not a correct way but I have done it because I do not have no other idea to overcome the errors. Regards Tatsuro --- Tatsuro MATSUOKA wrote: > Hello Manfred Schwarb > > Thank you for your mail. > Excuse this post is not directly related for gnuplot. > Please allow me. > > --- Manfred Schwarb wrote: > > > In my follow-up mail of march 7, 2010 I indicated how to fix it. You > > have to modify configure.ac. > > > ****************** > I know your follow up. > But ./bootstrap.sh failed at that time. > I have reported to perhaps to 'issues' in > http://bitbucket.org/pierrejoye/gd-libgd-20 > I cannot find it now. > > I have now download gd-libgd-20-tip.tar.gz again. I have tried again. > > After the change you suggested, > ********** > Around line 570 of configure.ac, you have to add > tests/gdimagefilledpolygon/Makefile > tests/gdimageopenpolygon/Makefile > tests/gdimagepolygon/Makefile > *********** > ./bootstrap.sh was carried out. > > The results are > > On cygwin > $ ./bootstrap.sh > configure.ac:64: warning: macro `AM_ICONV' not found in library > configure.ac:64: error: possibly undefined macro: AM_ICONV > If this token and others are legitimate, please use m4_pattern_allow. > See the Autoconf documentation. > Failed > > At that time I have stopped here. > > configure.ac:64: error: possibly undefined macro: AM_ICONV > ****************** > configure.ac:64-67 > > AM_ICONV > # if test -n "$LIBICONV" ; then > # LIBS="$LIBS $LIBICONV" > # fi > **************** > I commented out AM_ICONV like > #AM_ICONV > > The ./bootstrap.sh went well. > > And the I go back Msys+mingw > > cd "C:\usr\tatsu\mingwhome\tools\gd\gd-libgd-2.0_20100119_build" > > CC='gcc -shared-libgcc' \ > CPPFLAGS='-DHAVE_BOOLEAN -I/WinDevTools/include' \ > LDFLAGS='-L/WinDevTools/lib' \ > CFLAGS='-O3 -fomit-frame-pointer' \ > LIB='-liconv' \ > ../gd-libgd-2.0_20100119/configure --disable-libtool-lock --prefix=/WinDevTools > > configure seemed went well but > At the make > > /bin/sh ./libtool --tag=CC --mode=compile gcc -shared-libgcc -DHAVE_CONFIG_H -I. > -I../gd-libgd-2.0_20100119 -I/WinDevTools/include/freetype2 -I/WinDevTools/include > -DHAVE_BOOLEAN > -I/WinDevTools/include -I/WinDevTools/include/libpng14 -O3 -fomit-frame-pointer -MT gd.lo -MD > -MP -MF > .deps/gd.Tpo -c -o gd.lo ../gd-libgd-2.0_20100119/gd.c > ./libtool: line 869: X--tag=CC: command not found > ./libtool: line 902: libtool: ignoring unknown tag : command not found > : > : > > The I saw /libtool: line 868-871 > ************************** > case $arg in > -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; > *) optarg= ;; > esac > ************************* > > This is the same as line 812-816 of libtool of generated on gc-2.0.36RC1 > case $arg in > -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; > *) optarg= ;; > esac > > This can not be fixed by your suggestion > > # sed -i 's/^ECHO=.\?echo.*/ECHO=echo; echo=echo/' libtool > (Perhaps 'sed -e' is correct) > > I cannot go forward any longer. > > Any suggestions? > > Regards > > Tatsuro > > > -------------------------------------- > VANCOUVER 2010 PARALYMPIC GAMES News > http://pr.mail.yahoo.co.jp/para/ > > ------------------------------------------------------------------------------ > Download Intel¢î Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > -------------------------------------- VANCOUVER 2010 PARALYMPIC GAMES News http://pr.mail.yahoo.co.jp/para/ |
|
From: Tatsuro M. <tma...@ya...> - 2010-03-21 03:53:45
|
Hello Sorry! Please ignore the below post. --- Tatsuro MATSUOKA wrote: > Hello > > I can build gd library by copying libtool by gd-2.0.36RC1 to the current build directory. > This is not a correct way but I have done it because I do not have no other idea to overcome > the errors. > > Regards > > Tatsuro -------------------------------------- VANCOUVER 2010 PARALYMPIC GAMES News http://pr.mail.yahoo.co.jp/para/ |
|
From: Tatsuro M. <tma...@ya...> - 2010-03-21 08:33:17
|
Hello Using dirty hacks, I at last have been able to build the gd library from the sourve 2010-01-19(suspect from dates of files) suggested by Manfred Schwarb. Add #Around line 570 of configure.ac, you have to add tests/gdimagefilledpolygon/Makefile tests/gdimageopenpolygon/Makefile tests/gdimagepolygon/Makefile and comment out line 64 AM_ICONV # if test -n "$LIBICONV" ; then # LIBS="$LIBS $LIBICONV" | v # AM_ICONV And ./bootstrap on cygwin to make configure and Makefile. By this change, iconv search library search was not carried out while the header file searches were carried out In config.h, one can find #define HAVE_ICONV_H 1 #define HAVE_ICONV_T_DEF 1 but not #define HAVE_ICONV so that I add -DHAVE_ICONV in the CPPFLAGS. The libtool was failed described previously, I copied the libtool script generated in gd-2.0.36RC1. In this case, the dll build resulted in failure. I generated dll file from static libraries as described the the following page. http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/build_gnuplot_on_mingw.html at 'gd library' This was a dirty example at present. I would like to improve the situation but the improving procedure is beyond my ability. BTW, with this libraries, the problems in libpng-1.4 and of fontconfig linking were of course solved. Regards Tatsuro --- Tatsuro MATSUOKA wrote: > Hello > > Sorry! > Please ignore the below post. > > --- Tatsuro MATSUOKA wrote: > > > Hello > > > > I can build gd library by copying libtool by gd-2.0.36RC1 to the current build directory. > > This is not a correct way but I have done it because I do not have no other idea to overcome > > the errors. > > > > Regards > > > > Tatsuro > > > -------------------------------------- > VANCOUVER 2010 PARALYMPIC GAMES News > http://pr.mail.yahoo.co.jp/para/ > -------------------------------------- VANCOUVER 2010 PARALYMPIC GAMES News http://pr.mail.yahoo.co.jp/para/ |
|
From: Tatsuro M. <tma...@ya...> - 2010-03-23 10:00:33
|
Hello --- Tatsuro MATSUOKA wrote: > And ./bootstrap.sh on cygwin to make configure and Makefile. I carried out ./bootstrap.sh on cygwin because it failed Msys+MinGW Msys(automake+autoconf). Perhaps Msys automake-1.11 does not work correctly I have installed automake-1.11.1 and autoconf-2.65 from source confuring with --prefix=/mingw. ./bootstrap.sh went well on Msys+MinGW system (You need not to use the cygwin) Regards Tatsuro -------------------------------------- Get the new Internet Explorer 8 optimized for Yahoo! JAPAN http://pr.mail.yahoo.co.jp/ie8/ |