gif transparented background & text

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?".
Post Reply
RetroJ
Posts: 108
Joined: 2006-10-25T08:12:50-07:00

Post by RetroJ »

Only by giving up transparency. Gif supports only binary transparency, so you cannot blend a color with transparency.

If, however, you know that the gif will be displayed on a white background, you can get an antialiased effect with a command like the following. But now white jaggies will show up if the image is on a non-white background.

Code: Select all

convert -background white -fill blue -pointsize 25 -gravity center label:1234567890 -transparent white foo.gif
RetroJ
Posts: 108
Joined: 2006-10-25T08:12:50-07:00

Post by RetroJ »

You need quotes around Times New Roman so that the shell will treat it as a single string.

I don't know the answer to your question about why some fonts cannot be found. I have that problem too.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Post by Bonzo »

The fonts are called Times-Roman & Helvetica-Bold etc. on my server.

convert -list type should give you the names and available fonts ?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

Other fonts can be specifyed directly by giving a font filename

Code: Select all

   convert -font /path/to/the/font/file/myfont.ttf  ...
Or you can add fonts to the list IM knows about by creating a personal ".magick/type.xml" file in your home directory. A linux script to do this is pointed to from the top level IM Examples web page.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

1. Not from the command line

2. the fonts are defined to a set assumed to be present for the Im installation
That is ghostscript fonts under UNIX and windows fonts under windows.

However that does not mean the other oS can't use the other font sets, it just means that they need to be found and configured into the appropriate 'type.xml' file, or referenced dirertly using a filepath.

3. Underlines is a 'decoration', and can be specified using a little used MVG drawing setting -draw 'decorate UnderLine text ...'

See IM Examples 'text to image' draw, 3rd example...
http://www.cit.gu.edu.au/~anthony/graph ... text/#draw

However it is probably better to DIY the underline yourself anyway.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

No it doesn't. It only has the fonts for ghostscript, and is included into the system "type.xml" file.

You can create a personal "type.xml". under linux, This can be filled in using the program referenced from the top level page of IM Examples, call "im_type_gen"
http://www.cit.gu.edu.au/~anthony/graph ... ick6/#font

This is what I use to fine and define ALL the fonts (mostly TTF) that are present on my machine. Especially the ones I collected for personal use.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

If you have a modern version of the fontconfig library, recent versions of ImageMagick will pick up all your Linux system defined fonts autoomatically.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

Going back to the original error

The 'pfb' is the file that the 'type.xml' declared is present for a particualr font.
It is a Type 1 Postscript font and as such is probably a ghostscript font.

It is probably caused by ghostscript not being installed (though it s fonts were declared to IM) or installed in a place different to where it was when IM was compiled.

Check taht your system type-ghostscript.xml file referes to the correct locatons,
or recompile IM specifically for your current system.

Allturnativeally, use the im_type_gen script to generate a new system-wide type.xml
file, and replace the incorrect system file completely. I suggest this as IM will always
give preference to the system defined font than a personal one, for security reasons.
As such an incorrect system definition may not be easily 'fixed' by a personal one.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply