Hello together,
by entering "identify -list font" I can print a list of fonts, IM knows by name.
I get about 35 which I have installed togehther with ghostscript.
Is there any collection of (free) fonts available for download?
I am particularly interested in the fonts used in the examples of Anthony's website.
On Mac OS X I have a collection of truetype fonts locatet in /System/Library/Fonts and /Library/Fonts.
These have filenames with the extension .ttf.
I can use this fonts by entering the fullpathname e.g
-font /Library/Fonts/Arial.ttf
Is there any way to use these just by name (without path and extension)?
questions about fonts
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: questions about fonts
I name a couple of free to download font libraries on the top level page of IM ExamplesIs there any collection of (free) fonts available for download?
Same place, the top level page of IM Examples.Is there any way to use these just by name (without path and extension)?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: questions about fonts
Thank you very much. You made my day.
I have read this, but I didn't remember .
The 'imagick_type_gen'- works quite well on Mac OS X but there is one little problem.
There are a lot of fonts in "/Library/Fonts" with spaces in their filename e.g "Andale Mono.ttf" or "Arial Narrow Bold Italic.ttf".
The script does not seem to process those.
However, I found a workaround for this problem which might be helpfult to other Mac OS X Users.
I quoted line 352 ‘map { glob "$_" }‘ inside the 'locate' subroutine.
I didn't notice any negative sideeffects by now.
btw: I really appreciate your "IM Examples" webiste. It's very, very helpful.
I have read this, but I didn't remember .
The 'imagick_type_gen'- works quite well on Mac OS X but there is one little problem.
There are a lot of fonts in "/Library/Fonts" with spaces in their filename e.g "Andale Mono.ttf" or "Arial Narrow Bold Italic.ttf".
The script does not seem to process those.
However, I found a workaround for this problem which might be helpfult to other Mac OS X Users.
I quoted line 352 ‘map { glob "$_" }‘ inside the 'locate' subroutine.
I didn't notice any negative sideeffects by now.
btw: I really appreciate your "IM Examples" webiste. It's very, very helpful.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: questions about fonts
That is strange. I would not have expected quotes in a glob argument to have been necessary. Good pickup.
I have fixed the script as per your suggestion, though it may take a day or so to appear in the main IM Examples web pages
I have fixed the script as per your suggestion, though it may take a day or so to appear in the main IM Examples web pages
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: questions about fonts
No wait.
I said this wrong. (My English is not the best)
The quoting was my first try. But it didn't work.
I finally commented out the whole line. This worked for me but it might not be helpful in other environments.
I said this wrong. (My English is not the best)
The quoting was my first try. But it didn't work.
I finally commented out the whole line. This worked for me but it might not be helpful in other environments.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: questions about fonts
What exactly did you comment out?
I myself do not use MacOSX so I have to rely on others to get this to work right with the very limited version of the "locate" command that Mac's use.
Specifically the use of '-r' so as to avoid the use of 'grep', and that the lack of '-0' for handling special characters such as a space, or return charcater in the file name (preventing the need for 'glob' to handle '?' in the output of 'locate'. (see the commented line in the script)
Any help from a MacOSX user that is in the know would be appreciated.
Ditto for Windows users!
I myself do not use MacOSX so I have to rely on others to get this to work right with the very limited version of the "locate" command that Mac's use.
Specifically the use of '-r' so as to avoid the use of 'grep', and that the lack of '-0' for handling special characters such as a space, or return charcater in the file name (preventing the need for 'glob' to handle '?' in the output of 'locate'. (see the commented line in the script)
Any help from a MacOSX user that is in the know would be appreciated.
Ditto for Windows users!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: questions about fonts
I changed the locate subroutine to
btw. as of Mac OS X 10.5 (which I use) the locate command has '-0' but it still lacks '-r' and '-e'
I can do some further testing on Mac OS X 10.2, 10.3, 10.4 to find a way to handle all those systems properly. I don't think there are very many 10.1 and 10.0 users arround any more.
I will, however, need a few days because I have to install 10.3 and 10.2 on my Apple notebook for this.
I have still another question:
In which cases you expect '?' in locate output? I don't have any '?' in locate output (at least not in Mac OS X 10.5).
Edit: I found out that this can happen (depending on the setup of the shell) when filenames contain multibyte characters.
On Windows I think the script will not run because there is no locate command at all. It might only be available if cygwin is installed.
Code: Select all
sub locate {
# This fails under MacOSX
#return split('\0', `locate -0er '\\.$_[0]\$'`);
# Use perl to 'glob' expand '?' in locate output on MacOSX
return grep { /\.$_[0]$/ && -f $_ }
# map { glob "$_" }
split "\n", `locate '.$_[0]'`;
}
I can do some further testing on Mac OS X 10.2, 10.3, 10.4 to find a way to handle all those systems properly. I don't think there are very many 10.1 and 10.0 users arround any more.
I will, however, need a few days because I have to install 10.3 and 10.2 on my Apple notebook for this.
I have still another question:
In which cases you expect '?' in locate output? I don't have any '?' in locate output (at least not in Mac OS X 10.5).
Edit: I found out that this can happen (depending on the setup of the shell) when filenames contain multibyte characters.
On Windows I think the script will not run because there is no locate command at all. It might only be available if cygwin is installed.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: questions about fonts
Thanks maceis Please keep me informed of you progress. And yes it probably is multi-byte characters than cause the problem.
The perl script looks at TTF files directly without relying on any other programs to parse the files, as such it should be a good guide to either modifying it for direct windows (or cygwin) usage, OR to create a windows specific version.
In any case thanks for looking into this for Mac Users.
I was hoping there was a windows equivelent but didn't think there was. However if windows has a specific setup I was thinking that perhaps a text can be made for a specific directory and just look for fonts in that directory. The location for the output file also needs to be updated in the scripts opening comments.maceis wrote:On Windows I think the script will not run because there is no locate command at all. It might only be available if cygwin is installed.
The perl script looks at TTF files directly without relying on any other programs to parse the files, as such it should be a good guide to either modifying it for direct windows (or cygwin) usage, OR to create a windows specific version.
In any case thanks for looking into this for Mac Users.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/