Check it out. Want to use the font of your own? No problem. Want to use
Chinese font? No problem, there is even an example right using Chinese
font. Want to use a font without registering to ImageMagick? No problem.
Check it out, the answers are all there.

An *extremely* helpful mlist. Well worth the trouble of the email
registration. you will find Anthony answering questions there
himself. You throw in a question to the mlist, no matter how hard
it is, an answer will (magically) come out… :-)

As you can see, I tried to fix the problem myself, eg, adding the 1st
redundant-but-wide line, use -size 800x, etc. but the problem is still
there.

2nd, suppose the problem is fixed, there is still another problem. Since
most fonts are not mono-spaced, the converted result does not align well.
So, the ultimate question is, is it possible to document fonts using
ImageMagick?

thanks a lot

Use ImageMagick to document font

| So, the ultimate question is, is it possible to document fonts using
| ImageMagick?

If you read a font file as a image. IM will generate a standard 'font
description' image…

convert arial.ttf arial_index.jpg

Note nether your method or the above will document all the acpects of a
font, particualrly some 'interesting' symbol fonts.

Basically many modern fonts have unicode characters implemented making
the number of characters in common fonts extrememly large!

As for mono-spacing. The only suggestion is do each character as a
seperate image and "montage" all the characters together. That will
probably need a looped script of some form.

Very good. Though as I mentioned, rather than using label, it may be
better to use a undercolor box with -annotate on a larger canavs.

You may also like to add a '-trim +repage' to the generating commands.

You could also change the perl script to convert a input text file to
appropriate convert commands, (one for each character), then output
'null' padding charcaters to bring lines up to 80 characters (or some
other pre-determine line length) before executing and feeding the result
to montage, with a "-tile 80x" setting.

The montage basically is used to convert the individual proportional
characters into a table of fixed width characters.

By change it to be a line filter you are not limiting the command to a
single table. Instead allowing you to use the table output of commands
like

Use ImageMagick to document font

| hmm... one problem, I notice that not all number characters are shown.

I wrote a script as I had described, and processed the output
of the whole latin unicode character range.

Charcaters I had problems with…

controls 0x00 to 0x20
space proportional fonts produce a very large space!
single quote does not wrap in shell single quotes
at symbol IM treats a first '@' symbol in a string as special.
Code 0xA0 I think IM treats this meta-@ like an '@' symbol

The Script is in..
http://www.imagemagick.org/Usage/scripts/text2img_fixed

try… (using the graphics_utf script also in same directory)

graphics_utf 0020 0080 | text2img_fixed -l 60 output.gif

which is basically what you were trying to achieve :-)

Replace output.gif with x: for a on screen display.
Could take some time as lots of commands are being processed.

Line length is fixed to 70 unicode characters.

Anthony Thyssen

Print a sample of all fonts

Newsgroups: gmane.linux.debian.user
Date: Sun, 27 Jan 2008

> is there a way to have gimp or whatever print a sample of each
> font on the system without manually writing them all out? tia.

Both answers so far seem to me only allow you to view the font one by
one, which involves a lot of clicking if you want to see each font on
the system. Check out

Controlling line spacing

Newsgroups: gmane.comp.video.image-magick.user
Date: Mon, 25 Jun 2007

| I use the "-shade" operator to create beveled fonts. Ref:
| http://www.imagemagick.org/Usage/fonts/#bevel[]
|
| The problem is that I need the text to be on 2 lines, but the line spacing
| is too wide for me, since my image is small:
| http://xpt.sourceforge.net/images/xpt.gif[]
|
| I'm wondering if there is any way to reduce the line spacing in this case?

Controlling line spacing

| > The problem is that I need the text to be on 2 lines, but the line spacing
| > is too wide for me, since my image is small:
|
| Forgot to say, this is how I did it:
|
| convert -size 220x25 xc:black -font Candice -pointsize 14 -fill white \
| -gravity center -annotate 0 'line1\nline2' -shade \
| 140x60 xpt.gif
|
| Candice is a symlink to a ttf font file.

Why? define it properly in IM…
See the top level IM example page.
http://www.imagemagick.org/Usage/#font

You can then add all your fonts into IM with nice names.

| The result is at,
|
| > http://xpt.sourceforge.net/images/xpt.gif[]
| >
| > I'm wondering if there is any way to reduce the line spacing in this
| > case?

The pointsize of a font represents its line spaceing. that is its
actual defination!!!!

It is then up to the font designers on how you want to fill that space.
And most of them do a horrible job of using that space!

But I knwo what you want.
If you are always using the same font and pointsize, you can
'-chop' out the extra space….

Alternatively in a couple of days a new script will be up in
http://www.imagemagick.org/Usage/scripts/
called "divide-horiz" Which is a quick script I wrote on the weekend
to solve a problem I was having. The script works, but does not check
that each line also has the same color :-(

This divides an image into multiple images divided by lines of constant
color. That is the 'gaps' in an image, That is images
will become a list of images of the form

blanks, stuff, blanks, stuff,....

which if you -append would re-form the original image.
Note if the image was 'trimmed' the first image would not be 'blank'.

You only need to remove or 'fix' the size of the blank 'gap' images.

I am wanting to get the funcationality of this script built into IM as a
-divide-horiz option. Which along with a -layers RemoveBlank
operation can be used to delete the blank images that are all one color.