diff mbox

[1/1] Allow imagemagick to find ghostscript fonts.

Message ID 1434420746-20199-1-git-send-email-grepper@gmail.com
State Accepted
Headers show

Commit Message

grepper June 16, 2015, 2:12 a.m. UTC
From: Robert Sohn <grepper@gmail.com>

It appears that Imagemagick needs to be configured with
 --with-gs-font-dir=/usr/share/fonts/gs else it will not find
the ghostscript fonts and /etc/ImageMagick-6/type-ghostscript.xml
will contain the wrong font paths. You end up with messages like:
Magick: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1153
They are non-fatal but could get annoying fast if you are using 'convert'
on a lot of files.

Signed-off-by: Robert Sohn <grepper@gmail.com>
---
 package/imagemagick/imagemagick.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Baruch Siach June 16, 2015, 3:39 a.m. UTC | #1
Hi Robert,

On Mon, Jun 15, 2015 at 10:12:26PM -0400, grepper wrote:
> From: Robert Sohn <grepper@gmail.com>
> 
> It appears that Imagemagick needs to be configured with
>  --with-gs-font-dir=/usr/share/fonts/gs else it will not find
> the ghostscript fonts and /etc/ImageMagick-6/type-ghostscript.xml
> will contain the wrong font paths. You end up with messages like:
> Magick: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1153
> They are non-fatal but could get annoying fast if you are using 'convert'
> on a lot of files.
> 
> Signed-off-by: Robert Sohn <grepper@gmail.com>
> ---
>  package/imagemagick/imagemagick.mk | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/package/imagemagick/imagemagick.mk b/package/imagemagick/imagemagick.mk
> index 298d0a8..1abb2a8 100644
> --- a/package/imagemagick/imagemagick.mk
> +++ b/package/imagemagick/imagemagick.mk
> @@ -33,7 +33,8 @@ IMAGEMAGICK_CONF_OPTS = \
>  	--without-dps \
>  	--without-gslib \
>  	--without-fpx \
> -	--without-x
> +	--without-x \
> +	--with-gs-font-dir=/usr/share/fonts/gs

These fonts are only available when the ghostscript-fonts is built, isn't it? 
If so, then this should be

ifeq ($(BR2_PACKAGE_GHOSTSCRIPT_FONTS),y)
IMAGEMAGICK_CONF_OPTS += --with-gs-font-dir=/usr/share/fonts/gs
endif

Or maybe we should use $(GHOSTSCRIPT_FONTS_TARGET_DIR) here, instead of 
duplicating it?

baruch
grepper June 16, 2015, 6:27 p.m. UTC | #2
On 15/06/15 11:39 PM, Baruch Siach wrote:
> Hi Robert,
> 
> On Mon, Jun 15, 2015 at 10:12:26PM -0400, grepper wrote:
>> From: Robert Sohn <grepper@gmail.com>
>>
>> It appears that Imagemagick needs to be configured with
>>  --with-gs-font-dir=/usr/share/fonts/gs else it will not find
>> the ghostscript fonts and /etc/ImageMagick-6/type-ghostscript.xml
>> will contain the wrong font paths. You end up with messages like:
>> Magick: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1153
>> They are non-fatal but could get annoying fast if you are using 'convert'
>> on a lot of files.
>>
>> Signed-off-by: Robert Sohn <grepper@gmail.com>
>> ---
>>  package/imagemagick/imagemagick.mk | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/package/imagemagick/imagemagick.mk b/package/imagemagick/imagemagick.mk
>> index 298d0a8..1abb2a8 100644
>> --- a/package/imagemagick/imagemagick.mk
>> +++ b/package/imagemagick/imagemagick.mk
>> @@ -33,7 +33,8 @@ IMAGEMAGICK_CONF_OPTS = \
>>  	--without-dps \
>>  	--without-gslib \
>>  	--without-fpx \
>> -	--without-x
>> +	--without-x \
>> +	--with-gs-font-dir=/usr/share/fonts/gs
> 
> These fonts are only available when the ghostscript-fonts is built, isn't it? 
> If so, then this should be
> 
> ifeq ($(BR2_PACKAGE_GHOSTSCRIPT_FONTS),y)
> IMAGEMAGICK_CONF_OPTS += --with-gs-font-dir=/usr/share/fonts/gs
> endif
> 
> Or maybe we should use $(GHOSTSCRIPT_FONTS_TARGET_DIR) here, instead of 
> duplicating it?
> 
> baruch
> 

Hm, the problem is that the issue will remain if ghostscript-fonts are
not installed. I don't know the solution to that. It seems strange that
imagemagick can not find a default font when 'convert -list font' shows
many, ttf and otherwise.

Robert
Baruch Siach June 16, 2015, 8:01 p.m. UTC | #3
Hi Robert,

On Tue, Jun 16, 2015 at 02:27:23PM -0400, grepper wrote:
> On 15/06/15 11:39 PM, Baruch Siach wrote:
> > On Mon, Jun 15, 2015 at 10:12:26PM -0400, grepper wrote:
> >> From: Robert Sohn <grepper@gmail.com>
> >>
> >> It appears that Imagemagick needs to be configured with
> >>  --with-gs-font-dir=/usr/share/fonts/gs else it will not find
> >> the ghostscript fonts and /etc/ImageMagick-6/type-ghostscript.xml
> >> will contain the wrong font paths. You end up with messages like:
> >> Magick: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1153
> >> They are non-fatal but could get annoying fast if you are using 'convert'
> >> on a lot of files.
> >>
> >> Signed-off-by: Robert Sohn <grepper@gmail.com>
> >> ---
> >>  package/imagemagick/imagemagick.mk | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/package/imagemagick/imagemagick.mk b/package/imagemagick/imagemagick.mk
> >> index 298d0a8..1abb2a8 100644
> >> --- a/package/imagemagick/imagemagick.mk
> >> +++ b/package/imagemagick/imagemagick.mk
> >> @@ -33,7 +33,8 @@ IMAGEMAGICK_CONF_OPTS = \
> >>  	--without-dps \
> >>  	--without-gslib \
> >>  	--without-fpx \
> >> -	--without-x
> >> +	--without-x \
> >> +	--with-gs-font-dir=/usr/share/fonts/gs
> > 
> > These fonts are only available when the ghostscript-fonts is built, isn't it? 
> > If so, then this should be
> > 
> > ifeq ($(BR2_PACKAGE_GHOSTSCRIPT_FONTS),y)
> > IMAGEMAGICK_CONF_OPTS += --with-gs-font-dir=/usr/share/fonts/gs
> > endif
> > 
> > Or maybe we should use $(GHOSTSCRIPT_FONTS_TARGET_DIR) here, instead of 
> > duplicating it?
> 
> Hm, the problem is that the issue will remain if ghostscript-fonts are
> not installed. I don't know the solution to that.

The usual way to set a dependency package is to add a 'select' statement for 
that package in Config.in. In this case ghostscript-fonts is not a hard 
dependency, because imagemagick is quite functional without it, and its size 
is non negligible. Maybe adding a comment to the help text in Config.in would 
suffice.

What do others think?

> It seems strange that imagemagick can not find a default font when 'convert 
> -list font' shows many, ttf and otherwise.

baruch
Thomas Petazzoni Dec. 29, 2015, 4:45 p.m. UTC | #4
Hello Robert,

Sorry for the long delay in replying to your patch.

On Mon, 15 Jun 2015 22:12:26 -0400, grepper wrote:

> It appears that Imagemagick needs to be configured with
>  --with-gs-font-dir=/usr/share/fonts/gs else it will not find
> the ghostscript fonts and /etc/ImageMagick-6/type-ghostscript.xml
> will contain the wrong font paths. You end up with messages like:
> Magick: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1153
> They are non-fatal but could get annoying fast if you are using 'convert'
> on a lot of files.

Could you give a specific example use of imagemagick that triggers this
problem, so that we can reproduce the problem on our side and
investigate the possible solutions?

Thanks a lot!

Thomas
Peter Korsgaard July 4, 2016, 3:50 p.m. UTC | #5
On Tue, Jun 16, 2015 at 4:12 AM, grepper <grepper@gmail.com> wrote:

Sorry for the slow response!

> It appears that Imagemagick needs to be configured with
>  --with-gs-font-dir=/usr/share/fonts/gs else it will not find
> the ghostscript fonts and /etc/ImageMagick-6/type-ghostscript.xml
> will contain the wrong font paths. You end up with messages like:
> Magick: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1153
> They are non-fatal but could get annoying fast if you are using 'convert'
> on a lot of files.
>
> Signed-off-by: Robert Sohn <grepper@gmail.com>

Committed after extending the commit message, thanks!

--
Bye, Peter Korsgaard
diff mbox

Patch

diff --git a/package/imagemagick/imagemagick.mk b/package/imagemagick/imagemagick.mk
index 298d0a8..1abb2a8 100644
--- a/package/imagemagick/imagemagick.mk
+++ b/package/imagemagick/imagemagick.mk
@@ -33,7 +33,8 @@  IMAGEMAGICK_CONF_OPTS = \
 	--without-dps \
 	--without-gslib \
 	--without-fpx \
-	--without-x
+	--without-x \
+	--with-gs-font-dir=/usr/share/fonts/gs
 
 IMAGEMAGICK_DEPENDENCIES = host-pkgconf