|
From: Mojca M. <moj...@gm...> - 2012-04-18 20:50:31
|
Dear Gnuplot developers,
I'm still experiencing a problem with
> set term png
Terminal type set to 'png'
Could not find/open font when opening font "arial", using internal
non-scalable font
> show fontpath
fontpath is
system fontpath is "/System/Library/Fonts" "/Library/Fonts"
"/Users/myusername/Library/Fonts"
on Mac OS X. After some experiments I came to conclusion that the
reason might have been Microsoft Office which installed the file
/Library/Fonts/Microsoft/Arial.ttf
and removed
/Library/Fonts/Arial.ttf
and I guess that GD2 is unable to search recursively in font
directories. fc-list finds the font without problems and could be used
to search for fonts, but last time Ethan had concerns about enabling
FontConfig:
> There seem to be bugs in the libgd function gdFTUseFontConfig(), in that
> once you turn it on you can never turn it off again. Unless that is fixed,
> it means that gnuplot scripts using a mixture of self-supplied fonts and
> fontconfig-installed fonts will fail. That would break most of my
> web tools, for example, which provide private font files.
Assuming that font-config isn't/won't be enabled (it doesn't look very
promissing that gd team will release a new version in any reasonable
time), I have the following questions:
1.) What is (or should be) the exact algorithm to search for arial?
How could I convince gnuplot (gd2) to automatically find Arial.ttf
even when it resides in /Library/Fonts/Microsoft/Arial.ttf, without my
manual intervention? How should I tell gnuplot (gd2) to search
recursively through all the three font paths mentioned above?
2.) What is the difference between "fontpath" and "system fontpath"
mentioned above?
Thank you,
Mojca
|
|
From: <pl...@pi...> - 2012-04-18 22:18:15
|
On 18/04/12 22:50, Mojca Miklavec wrote: > Dear Gnuplot developers, > > I'm still experiencing a problem with > >> set term png > Terminal type set to 'png' > Could not find/open font when opening font "arial", using internal > non-scalable font >> show fontpath > fontpath is > system fontpath is "/System/Library/Fonts" "/Library/Fonts" > "/Users/myusername/Library/Fonts" > > on Mac OS X. After some experiments I came to conclusion that the > reason might have been Microsoft Office which installed the file > /Library/Fonts/Microsoft/Arial.ttf > and removed > /Library/Fonts/Arial.ttf > and I guess that GD2 is unable to search recursively in font > directories. fc-list finds the font without problems and could be used > to search for fonts, but last time Ethan had concerns about enabling > FontConfig: > >> There seem to be bugs in the libgd function gdFTUseFontConfig(), in that >> once you turn it on you can never turn it off again. Unless that is fixed, >> it means that gnuplot scripts using a mixture of self-supplied fonts and >> fontconfig-installed fonts will fail. That would break most of my >> web tools, for example, which provide private font files. > > Assuming that font-config isn't/won't be enabled (it doesn't look very > promissing that gd team will release a new version in any reasonable > time), I have the following questions: > > 1.) What is (or should be) the exact algorithm to search for arial? > How could I convince gnuplot (gd2) to automatically find Arial.ttf > even when it resides in /Library/Fonts/Microsoft/Arial.ttf, without my > manual intervention? How should I tell gnuplot (gd2) to search > recursively through all the three font paths mentioned above? > > 2.) What is the difference between "fontpath" and "system fontpath" > mentioned above? > > Thank you, > Mojca > I've been seeing something similar on x86 linux, but have not looked into it. I build using cairo , so AFAIK that means no gdlib. Peter. |
|
From: Allin C. <cot...@wf...> - 2012-04-18 22:22:32
|
On Wed, 18 Apr 2012, Mojca Miklavec wrote: > I'm still experiencing a problem with > >> set term png > Terminal type set to 'png' > Could not find/open font when opening font "arial", using internal > non-scalable font Urgh. Why on earth are you using libgd (whose font handling is beyond redemption) rather than the cairo-based PNG terminal? Allin Cottrell |
|
From: Mojca M. <moj...@gm...> - 2012-04-18 22:35:01
|
On Wed, Apr 18, 2012 at 23:55, Allin Cottrell wrote: > On Wed, 18 Apr 2012, Mojca Miklavec wrote: > >> I'm still experiencing a problem with >> >>> set term png >> >> Terminal type set to 'png' >> Could not find/open font when opening font "arial", using internal >> non-scalable font > > Urgh. Why on earth are you using libgd (whose font handling is beyond > redemption) rather than the cairo-based PNG terminal? I'm not. I'm just annoyed by the error and I would like to fix it. Or - more precisely - macports builds gnuplot with gd2 by default, so "set term png" ends up with gd2 instead of cairo. On default gnuplot install this would use cairo when available. Maybe gnuplot on macports should be changed, so that gd2 would not be built by default (if that is the preference/recommendation of gnuplot developers)? (Independent of that I would also like to know how font searching works in PostScript, but that has a lower priority.) Mojca |
|
From: Allin C. <cot...@wf...> - 2012-04-18 23:23:42
|
On Thu, 19 Apr 2012, Mojca Miklavec wrote: > On Wed, Apr 18, 2012 at 23:55, Allin Cottrell wrote: >> On Wed, 18 Apr 2012, Mojca Miklavec wrote: >> >>> I'm still experiencing a problem with >>> >>>> set term png >>> >>> Terminal type set to 'png' >>> Could not find/open font when opening font "arial", using internal >>> non-scalable font >> >> Urgh. Why on earth are you using libgd (whose font handling is beyond >> redemption) rather than the cairo-based PNG terminal? > > I'm not. I'm just annoyed by the error and I would like to fix it. > > Or - more precisely - macports builds gnuplot with gd2 by default, so > "set term png" ends up with gd2 instead of cairo. On default gnuplot > install this would use cairo when available. > > Maybe gnuplot on macports should be changed, so that gd2 would not be > built by default (if that is the preference/recommendation of gnuplot > developers)? I don't have the status of a gnuplot developer, but as a gnuplot user and occasional patch-submitter I would strongly recommend treating libgd as "legacy" and concentrating on the cairo-based terminals. > (Independent of that I would also like to know how font searching > works in PostScript, but that has a lower priority.) PostScript is a page description language, and as such it knows absolutely nothing about font-searching. It's happy to use any compatible font that is fed to it by some other piece of software that does know about font-searching. The latest gnuplot has an "epscairo" terminal which presumably combines fontconfig font-searching (cairo and fontconfig being linked) with PostScript generation. This sounds very nice but I haven't yet experimented with it much myself. Allin Cottrell |
|
From: Mojca M. <moj...@gm...> - 2012-04-19 13:23:07
|
On Thu, Apr 19, 2012 at 01:23, Allin Cottrell <cot...@wf...> wrote: > On Thu, 19 Apr 2012, Mojca Miklavec wrote: > >> On Wed, Apr 18, 2012 at 23:55, Allin Cottrell wrote: >>> >>> On Wed, 18 Apr 2012, Mojca Miklavec wrote: >>> >>>> I'm still experiencing a problem with >>>> >>>>> set term png >>>> >>>> >>>> Terminal type set to 'png' >>>> Could not find/open font when opening font "arial", using internal >>>> non-scalable font >>> >>> >>> Urgh. Why on earth are you using libgd (whose font handling is beyond >>> redemption) rather than the cairo-based PNG terminal? >> >> I'm not. I'm just annoyed by the error and I would like to fix it. ... but I'm still curious how exactly the fonts are searched, more precisely, if there is any way to convince gd2 to search recursively. > I don't have the status of a gnuplot developer, but as a gnuplot user and > occasional patch-submitter I would strongly recommend treating libgd as > "legacy" and concentrating on the cairo-based terminals. Thank you. I guess that others are sharing the same view? > PostScript is a page description language, and as such it knows absolutely > nothing about font-searching. Oh, thanks for clarifying. I see now that it only writes the font name into file, no matter whether that font exists anywhere. It doesn't try to do any embedding of fonts. I thought that PostScript terminal would also embed fonts, but I was apparently wrong. > The latest gnuplot has an "epscairo" terminal which presumably combines > fontconfig font-searching (cairo and fontconfig being linked) with > PostScript generation. ... and creates bitmap images embded inside PostScript which is not why one would want to use PostScript in the first place. (Most probably the image is composed out of multiple smaller bitmap images since I see some ugly artifacts all over the place.) Mojca |
|
From: Allin C. <cot...@wf...> - 2012-04-19 14:34:29
|
On Thu, 19 Apr 2012, Mojca Miklavec wrote: > On Thu, Apr 19, 2012 at 01:23, Allin Cottrell <cot...@wf...> wrote: > >> PostScript is a page description language, and as such it knows absolutely >> nothing about font-searching. > > Oh, thanks for clarifying. I see now that it only writes the font name > into file, no matter whether that font exists anywhere. It doesn't try > to do any embedding of fonts. I thought that PostScript terminal would > also embed fonts, but I was apparently wrong. I guess by "it" you mean the traditional gnuplot postscript terminal. Yes, it just passes through any font request given by the user, without any check on the availablility of the font. It's then up to the PostScript interpreter to find the font or substitute a default. By contrast, the epscairo terminal does check for a specified font via fontconfig. If it's found, the font is embedded (subsetted); if not, a default font is embedded instead. (There's no error message or warning if the specified font is not found and the default is used -- maybe there should be?) You say that the epscairo terminal > ... creates bitmap images embded inside PostScript which is not > why one would want to use PostScript in the first place. Eh? Could you give an example of that? Some EPS files contain a bitmapped "preview" but I'm not seeing that with files generated by epscairo, and the PS content itself is in pure vector form. For example set term epscairo font "cmr10,12" set output 'test.eps' plot sin(x) Allin Cottrell |
|
From: Mojca M. <moj...@gm...> - 2012-04-19 16:01:54
|
On Thu, Apr 19, 2012 at 16:12, Allin Cottrell <cot...@wf...> wrote: > On Thu, 19 Apr 2012, Mojca Miklavec wrote: > > You say that the epscairo terminal > >> ... creates bitmap images embded inside PostScript which is not >> >> why one would want to use PostScript in the first place. > > > Eh? Could you give an example of that? Some EPS files contain a bitmapped > "preview" but I'm not seeing that with files generated by epscairo, and the > PS content itself is in pure vector form. For example It might be that I have accidentally tried an example with transparency and cairo automatically generates a bitmap when transparency is involved. I was testing with the latest demo file which draws transparent arrows. Mojca |
|
From: Ethan A M. <sf...@us...> - 2012-04-19 16:10:56
|
On Thursday, April 19, 2012 07:12:16 am Allin Cottrell wrote: > On Thu, 19 Apr 2012, Mojca Miklavec wrote: > > > On Thu, Apr 19, 2012 at 01:23, Allin Cottrell <cot...@wf...> wrote: > > > >> PostScript is a page description language, and as such it knows absolutely > >> nothing about font-searching. > > > > Oh, thanks for clarifying. I see now that it only writes the font name > > into file, no matter whether that font exists anywhere. It doesn't try > > to do any embedding of fonts. I thought that PostScript terminal would > > also embed fonts, but I was apparently wrong. > > I guess by "it" you mean the traditional gnuplot postscript > terminal. Yes, it just passes through any font request given > by the user, without any check on the availablility of the > font. It's then up to the PostScript interpreter to find the > font or substitute a default. It is possible to embed a font in the PostScript output if you want to, using the "fontfile" option. See the "fontfile.dem" demo. But this is not the default. |
|
From: Mojca M. <moj...@gm...> - 2012-04-19 16:21:28
|
On Thu, Apr 19, 2012 at 18:10, Ethan A Merritt wrote:
>
> It is possible to embed a font in the PostScript output if you want to,
> using the "fontfile" option. See the "fontfile.dem" demo.
> But this is not the default.
Thank you I was actually looking for exactly this topic:
help post fontfile
I'll test and ask in case that I will have any more questions left.
Mojca
|