Additional fonts on shared host

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Additional fonts on shared host

Post by Bonzo »

That code is for the php API called Imagick which interacts with Imagemagick.
That explains why you can not see convert.
doyley3
Posts: 23
Joined: 2014-02-11T09:52:48-07:00
Authentication code: 6789

Re: Additional fonts on shared host

Post by doyley3 »

Even more confused now then. So there's only reference to Imagick and not Imagemagick itself. Is there anyway for me to call a font folder that exists outside of the root of the shared server?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Additional fonts on shared host

Post by fmw42 »

see http://www.php.net/manual/en/imagick.setformat.php and jut put the full path to your font as the argument
doyley3
Posts: 23
Joined: 2014-02-11T09:52:48-07:00
Authentication code: 6789

Re: Additional fonts on shared host

Post by doyley3 »

I've added the path to the font folder:

$image = setFont("/fonts");

But no dice...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Additional fonts on shared host

Post by fmw42 »

It must be the full path to where you put your fonts on your account including the font filename and suffix. I assume you did not put your fonts in root
doyley3
Posts: 23
Joined: 2014-02-11T09:52:48-07:00
Authentication code: 6789

Re: Additional fonts on shared host

Post by doyley3 »

My hosts finally agreed to create a .magick directory for me at $HOME, so I'm now able to see my custom fonts when I run convert -list font. BUT on svg to png convert the font always defaults to arial. I've tested with a system font too and the same occurs.

I've seen a few posts about this but no solutions. Does anyone have any ideas?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Additional fonts on shared host

Post by fmw42 »

What svg delegate are you using for rendering? IM MSVG (xml), RSVG or Inkscape. The internal IM MSVG is not a good as the other two. Check your delegates and see what is being used.
doyley3
Posts: 23
Joined: 2014-02-11T09:52:48-07:00
Authentication code: 6789

Re: Additional fonts on shared host

Post by doyley3 »

My output for svg delegates is :

svg => "rsvg" "%i" "%o"
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Additional fonts on shared host

Post by fmw42 »

what delegates show from

convert -version

or

convert -list configure

on the line starting with Delegates
doyley3
Posts: 23
Joined: 2014-02-11T09:52:48-07:00
Authentication code: 6789

Re: Additional fonts on shared host

Post by doyley3 »

convert -version shows:

Version: ImageMagick 6.6.0-4 2012-05-03 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP

convert -list configure shows:

DELEGATES bzlib djvu fontconfig freetype gvc jpeg jng jp2 lcms lqr openexr png rsvg tiff x11 xml wmf zlib
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Additional fonts on shared host

Post by fmw42 »

I am at a loss. Perhaps you should post a link to your svg file so others can see if it is valid. Also post your full command?

Can you test using PHP exec() rather than Imagick. Perhaps there is an issue with Imagick. exec() is more direct and uses the command line syntax.
doyley3
Posts: 23
Joined: 2014-02-11T09:52:48-07:00
Authentication code: 6789

Re: Additional fonts on shared host

Post by doyley3 »

I've put an example svg in dropbox (with courier-bold font embedded)
https://www.dropbox.com/s/kgfd2daeqxbqr ... atBack.svg

My developer is going to try PHP exec() I think, though shared hosting may mean this isn't possible.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Additional fonts on shared host

Post by fmw42 »

This works fine for me, though I do not have the font referenced or it is a bad reference in the svg file. I am not an expert on svg. But it still makes the output image

Code: Select all

convert BirdBoxClaretFlatBack.svg -resize 600x600 BirdBoxClaretFlatBack.png
convert: non-conforming drawing primitive definition `Courier-Bold''' @ error/draw.c/DrawImage/3164.
doyley3
Posts: 23
Joined: 2014-02-11T09:52:48-07:00
Authentication code: 6789

Re: Additional fonts on shared host

Post by doyley3 »

I'm not sure if I've saved the svg correctly as the only reference is <text transform="matrix(1 0 0 1 52.4165 279.9727)" fill="#2B2A2B" font-family="'Courier-Bold'" font-size="11">Simon & Tim - 42 Greenwood Way, Manchester, MC5 7UH</text>

I've tried saving the svg with options - Fonts/Type - SVG and no subsetting - but no change
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Additional fonts on shared host

Post by snibgo »

BirdBoxClaretFlatBack.svg contains:
font-family="'Courier-Bold'"
Unless you have a font family named 'Courier-Bold' (including the quotes), this will fail.
snibgo's IM pages: im.snibgo.com
Post Reply