Jump to content

Create font files for Bootloader GUI's

font typeface PNG Clover Chameleon GUI Design

  • Please log in to reply
121 replies to this topic

#21
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,771 posts
  • Gender:Male
  • Location:UK

Hi Slice

 
Apologies. Yes it does look like you have ImageMagick installed correctly.
The problem lies with the ImageMagick command generated by my script which was highlighted by the errors you posted.
 
./createFont.sh: line 131: [: -gt: unary operator expected
..
./createFont.sh: line 40: printf: .5: invalid number
 
This results in a malformed command.
 
What version of OS X have you run the script?
 
EDIT:
To test your ImageMagick you can paste the following to a text file, save with name like makefont.command to the createfont script dir, chmod +x and double click it.
convert -size 384x448 -background "RGBA(100,100,100,1)" -font "FUTURA.TTF" -pointsize 22 -fill "RGBA(255,255,255,1)" -draw "text 9,20 '.'" -draw "text 32,20 ' '" -draw "text 56,20 ' '" -draw "text 80,20 ' '" -draw "text 104,20 ' '" -draw "text 128,20 ' '" -draw "text 152,20 ' '" -draw "text 176,20 ' '" -draw "text 200,20 ' '" -draw "text 224,20 ' '" -draw "text 248,20 ' '" -draw "text 272,20 ' '" -draw "text 296,20 ' '" -draw "text 320,20 ' '" -draw "text 344,20 ' '" -draw "text 368,20 ' '" -draw "text 8,48 ' '" -draw "text 32,48 ' '" -draw "text 56,48 ' '" -draw "text 80,48 ' '" -draw "text 104,48 ' '" -draw "text 128,48 ' '" -draw "text 152,48 ' '" -draw "text 176,48 ' '" -draw "text 200,48 ' '" -draw "text 224,48 ' '" -draw "text 248,48 ' '" -draw "text 272,48 ' '" -draw "text 296,48 ' '" -draw "text 320,48 ' '" -draw "text 344,48 ' '" -draw "text 368,48 ' '" -draw "text 8,76 ' '" -draw "text 33,76 '!'" -draw "text 55,76 '\"'" -draw "text 77,76 '#'" -draw "text 101,76 '$'" -draw "text 123,76 '%'" -draw "text 148,76 '&'" -draw "text 177,76 '’'" -draw "text 201,76 '('" -draw "text 225,76 ')'" -draw "text 247,76 '*'" -draw "text 269,76 '+'" -draw "text 297,76 ','" -draw "text 320,76 '-'" -draw "text 345,76 '.'" -draw "text 366,76 '/'" -draw "text 5,104 '0'" -draw "text 30,104 '1'" -draw "text 53,104 '2'" -draw "text 77,104 '3'" -draw "text 101,104 '4'" -draw "text 125,104 '5'" -draw "text 149,104 '6'" -draw "text 173,104 '7'" -draw "text 197,104 '8'" -draw "text 221,104 '9'" -draw "text 249,104 ':'" -draw "text 273,104 ';'" -draw "text 293,104 '<'" -draw "text 317,104 '='" -draw "text 341,104 '>'" -draw "text 367,104 '?'" -draw "text 2,132 '@'" -draw "text 27,132 'A'" -draw "text 54,132 'B'" -draw "text 76,132 'C'" -draw "text 100,132 'D'" -draw "text 127,132 'E'" -draw "text 151,132 'F'" -draw "text 171,132 'G'" -draw "text 196,132 'H'" -draw "text 226,132 'I'" -draw "text 247,132 'J'" -draw "text 269,132 'K'" -draw "text 295,132 'L'" -draw "text 314,132 'M'" -draw "text 339,132 'N'" -draw "text 362,132 'O'" -draw "text 6,160 'P'" -draw "text 26,160 'Q'" -draw "text 54,160 'R'" -draw "text 78,160 'S'" -draw "text 102,160 'T'" -draw "text 124,160 'U'" -draw "text 148,160 'V'" -draw "text 168,160 'W'" -draw "text 197,160 'X'" -draw "text 221,160 'Y'" -draw "text 245,160 'Z'" -draw "text 272,160 '['" -draw "text 294,160 '\\\'" -draw "text 320,160 ']'" -draw "text 341,160 '^'" -draw "text 366,160 '_'" -draw "text 9,188 '’'" -draw "text 30,188 'a'" -draw "text 54,188 'b'" -draw "text 79,188 'c'" -draw "text 102,188 'd'" -draw "text 126,188 'e'" -draw "text 152,188 'f'" -draw "text 174,188 'g'" -draw "text 198,188 'h'" -draw "text 225,188 'i'" -draw "text 249,188 'j'" -draw "text 271,188 'k'" -draw "text 297,188 'l'" -draw "text 315,188 'm'" -draw "text 342,188 'n'" -draw "text 365,188 'o'" -draw "text 6,216 'p'" -draw "text 30,216 'q'" -draw "text 56,216 'r'" -draw "text 80,216 's'" -draw "text 105,216 't'" -draw "text 126,216 'u'" -draw "text 150,216 'v'" -draw "text 171,216 'w'" -draw "text 197,216 'x'" -draw "text 222,216 'y'" -draw "text 246,216 'z'" -draw "text 272,216 '{'" -draw "text 295,216 '|'" -draw "text 320,216 '}'" -draw "text 341,216 '~'" -draw "text 369,216 '.'" -draw "text 8,244 ' '" -draw "text 32,244 ' '" -draw "text 56,244 ' '" -draw "text 80,244 ' '" -draw "text 104,244 ' '" -draw "text 128,244 ' '" -draw "text 152,244 ' '" -draw "text 176,244 ' '" -draw "text 200,244 ' '" -draw "text 224,244 ' '" -draw "text 248,244 ' '" -draw "text 272,244 ' '" -draw "text 296,244 ' '" -draw "text 320,244 ' '" -draw "text 344,244 ' '" -draw "text 368,244 ' '" -draw "text 8,272 ' '" -draw "text 32,272 ' '" -draw "text 56,272 ' '" -draw "text 80,272 ' '" -draw "text 104,272 ' '" -draw "text 128,272 ' '" -draw "text 152,272 ' '" -draw "text 176,272 ' '" -draw "text 200,272 ' '" -draw "text 224,272 ' '" -draw "text 248,272 ' '" -draw "text 272,272 ' '" -draw "text 296,272 ' '" -draw "text 320,272 ' '" -draw "text 344,272 ' '" -draw "text 368,272 ' '" -draw "text 8,300 ' '" -draw "text 32,300 ' '" -draw "text 56,300 ' '" -draw "text 80,300 ' '" -draw "text 104,300 ' '" -draw "text 128,300 ' '" -draw "text 152,300 ' '" -draw "text 176,300 ' '" -draw "text 200,300 ' '" -draw "text 224,300 ' '" -draw "text 248,300 ' '" -draw "text 272,300 ' '" -draw "text 296,300 ' '" -draw "text 320,300 ' '" -draw "text 344,300 ' '" -draw "text 368,300 ' '" -draw "text 8,328 ' '" -draw "text 32,328 ' '" -draw "text 56,328 ' '" -draw "text 80,328 ' '" -draw "text 104,328 ' '" -draw "text 128,328 ' '" -draw "text 152,328 ' '" -draw "text 176,328 ' '" -draw "text 200,328 ' '" -draw "text 224,328 ' '" -draw "text 248,328 ' '" -draw "text 272,328 ' '" -draw "text 296,328 ' '" -draw "text 320,328 ' '" -draw "text 344,328 ' '" -draw "text 368,328 ' '" -draw "text 8,356 ' '" -draw "text 32,356 ' '" -draw "text 56,356 ' '" -draw "text 80,356 ' '" -draw "text 104,356 ' '" -draw "text 128,356 ' '" -draw "text 152,356 ' '" -draw "text 176,356 ' '" -draw "text 200,356 ' '" -draw "text 224,356 ' '" -draw "text 248,356 ' '" -draw "text 272,356 ' '" -draw "text 296,356 ' '" -draw "text 320,356 ' '" -draw "text 344,356 ' '" -draw "text 368,356 ' '" -draw "text 8,384 ' '" -draw "text 32,384 ' '" -draw "text 56,384 ' '" -draw "text 80,384 ' '" -draw "text 104,384 ' '" -draw "text 128,384 ' '" -draw "text 152,384 ' '" -draw "text 176,384 ' '" -draw "text 200,384 ' '" -draw "text 224,384 ' '" -draw "text 248,384 ' '" -draw "text 272,384 ' '" -draw "text 296,384 ' '" -draw "text 320,384 ' '" -draw "text 344,384 ' '" -draw "text 368,384 ' '" -draw "text 8,412 ' '" -draw "text 32,412 ' '" -draw "text 56,412 ' '" -draw "text 80,412 ' '" -draw "text 104,412 ' '" -draw "text 128,412 ' '" -draw "text 152,412 ' '" -draw "text 176,412 ' '" -draw "text 200,412 ' '" -draw "text 224,412 ' '" -draw "text 248,412 ' '" -draw "text 272,412 ' '" -draw "text 296,412 ' '" -draw "text 320,412 ' '" -draw "text 344,412 ' '" -draw "text 368,412 ' '" -draw "text 9,440 '.'" -draw "text 32,440 ' '" -draw "text 56,440 ' '" -draw "text 80,440 ' '" -draw "text 104,440 ' '" -draw "text 128,440 ' '" -draw "text 152,440 ' '" -draw "text 176,440 ' '" -draw "text 200,440 ' '" -draw "text 224,440 ' '" -draw "text 248,440 ' '" -draw "text 272,440 ' '" -draw "text 296,440 ' '" -draw "text 320,440 ' '" -draw "text 344,440 ' '" -draw "text 368,440 ' '"  label:"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                " "/Users/slice/Downloads/createFont_v0.78/type2_FUTURA_22pt_Cell_0x2.png"


#22
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,509 posts
  • Gender:Male
  • Location:Moscow

I am on 10.7.5.

What is the size of your convert utility? my is 29700 bytes. Looks like too small.



#23
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,771 posts
  • Gender:Male
  • Location:UK
$ ls -al /Volumes/SnowLeopard/usr/local/Cellar/imagemagick/6.9.1-3/bin/
total 480
drwxr-xr-x  18 nick  admin    612  2 Jun 13:33 .
drwxr-xr-x  14 nick  admin    476  2 Jun 13:33 ..
-r-xr-xr-x   1 nick  admin   1290  2 Jun 13:33 Magick++-config
-r-xr-xr-x   1 nick  admin   1256  2 Jun 13:33 Magick-config
-r-xr-xr-x   1 nick  admin   1264  2 Jun 13:33 MagickCore-config
-r-xr-xr-x   1 nick  admin   1504  2 Jun 13:33 MagickWand-config
-r-xr-xr-x   1 nick  admin   1251  2 Jun 13:33 Wand-config
-r-xr-xr-x   1 nick  admin  17416  2 Jun 13:33 animate
-r-xr-xr-x   1 nick  admin  17600  2 Jun 13:33 compare
-r-xr-xr-x   1 nick  admin  17424  2 Jun 13:33 composite
-r-xr-xr-x   1 nick  admin  17416  2 Jun 13:33 conjure
-r-xr-xr-x   1 nick  admin  17416  2 Jun 13:33 convert
-r-xr-xr-x   1 nick  admin  17416  2 Jun 13:33 display
-r-xr-xr-x   1 nick  admin  17480  2 Jun 13:33 identify
-r-xr-xr-x   1 nick  admin  17416  2 Jun 13:33 import
-r-xr-xr-x   1 nick  admin  17416  2 Jun 13:33 mogrify
-r-xr-xr-x   1 nick  admin  17416  2 Jun 13:33 montage
-r-xr-xr-x   1 nick  admin  17416  2 Jun 13:33 stream

 

Attached File  convert.zip   1.63KB   7 downloads


#24
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,771 posts
  • Gender:Male
  • Location:UK

Updated to v0.79

- Final PNG image for Clover (type 2) fonts will now automatically include extended ASCII and cyrillic glyphs, if they exist in the font.

EDIT:

For a bit of fun and to show it working.

 
Downloaded the transformers_movie font from http://www.dafont.co...eme.php?cat=303
 
./createFont.sh -t2 -f/Users/blackosx/Desktop/transformers_movie/Transformers\ Movie.ttf -s24 -o -l4
 
Made PNG file
type2_Transformers Movie_24pt_Cell_22x23.png
Attached File  type2_Transformers Movie_24pt_Cell_22x23.png   11.05KB   2 downloads
 
Threw it in Shield theme, changing theme.plist to font path and CharWidth to 22.
 
Attached File  screenshot.jpg   46.48KB   2 downloads
Attached File  screenshot_help.jpg   57.07KB   2 downloads
 
* In this example, the text is too big as the help page type is truncated. Other pages, Options, About will also be truncated.
Maybe Clover can be changed to not truncate the text if the monitor width is wide enough?
 
EDIT2:
I forgot to enable Clover's proportional spacing. Here are images with that enabled.
Attached File  screenshot_proportional_enabled.jpg   46.23KB   2 downloads
Attached File  screenshot_proportional_enabled_help.jpg   53.05KB   2 downloads
Attached File  screenshot_proportional_enabled_about.jpg   55.28KB   2 downloads


#25
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,509 posts
  • Gender:Male
  • Location:Moscow

Hi blackosx,

May be you upload non-corrected script?

Sergeys-iMac:createFont_v0.79 slice$ ./createFont.sh -t2 -s14 -f./arial.ttf  -b 100,150,24 -o
./createFont.sh: line 140: [: -gt: unary operator expected
Canvas=0x32 | Char cell=0x2
Building ImageMagick code sequence
./createFont.sh: line 40: printf: .5: invalid number
Running ImageMagick to create image
/Users/slice/Downloads/createFont_v0.79/IM_Command.command: line 1: 85300 Illegal instruction: 4  convert -size 0x32 -background "RGBA(100,150,24,1)" -font "./arial.ttf" -pointsize 14 -fill "RGBA(255,255,255,1)" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,2 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,4 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,6 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,8 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,10 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,12 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,14 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,16 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,18 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,20 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,22 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,24 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,26 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,28 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,30 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" -draw "text 0,32 ''" label:"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                " "/Users/slice/Downloads/createFont_v0.79/type2_arial_14pt_Cell_0x2.png"
Sergeys-iMac:createFont_v0.79 slice$ 


It's a pity my ImageMagick always get "Illegal instruction 4" with any fonts.

Working with images fine

Attached File  logo.png   26.76KB   1 downloads



#26
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,771 posts
  • Gender:Male
  • Location:UK

Hi Slice

 

I didn't make any changes to the script as I still think there's a problem with your ImageMagick.

Plus, the script doesn't do much error checking.

 

What does the following command give you?

convert -debug annotate  xc: -font PATH/TO/FONT -pointsize 24 -annotate 0 "A" null

This is what I see here:

$ convert -debug annotate  xc: -font /Users/nick/Library/Fonts/Futura\ ADOBE/Futur -pointsize 24 -annotate 0 "A" null
2015-06-03T09:34:04+01:00 0:00.000 0.000u 6.9.0 Annotate convert[17024]: annotate.c/RenderFreetype/1253/Annotate
  Font /Users/nick/Library/Fonts/Futura ADOBE/Futur; font-encoding none; text-encoding none; pointsize 24
2015-06-03T09:34:04+01:00 0:00.000 0.000u 6.9.0 Annotate convert[17024]: annotate.c/GetTypeMetrics/824/Annotate
  Metrics: text: A; width: 19.1875; height: 31; ascent: 25; descent: -7; max advance: 27; bounds: -0.1875,0  17.0938,19.7344; origin: 17,0; pixels per em: 24,24; underline position: -2.34375; underline thickness: 1.17188
2015-06-03T09:34:04+01:00 0:00.000 0.000u 6.9.0 Annotate convert[17024]: annotate.c/RenderFreetype/1253/Annotate
  Font /Users/nick/Library/Fonts/Futura ADOBE/Futur; font-encoding none; text-encoding none; pointsize 24
convert: no encode delegate for this image format `XC' @ error/constitute.c/WriteImage/1164.


#27
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,509 posts
  • Gender:Male
  • Location:Moscow

I created new ImageMagick compiling from sources

./configure --prefix=/opt/local --with-quantum-depth=16 \
	--with-apple-font-dir=/System/Library/Fonts \
	--without-magick-plus-plus \
	--with-windows-font-dir=/WinFonts --with-rsvg --with-png --with-jpeg --with-openjp2 --with-openexr --with-tiff --with-wmf\
	--enable-zero-configuration --disable-assert --without-threads \
      --disable-dependency-tracking --with-x=yes \
      --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib/ \
      --without-perl CC=clang CFLAGS="-Wno-attributes"

and now I have some success: I created an image without chars.

And your test

Sergeys-iMac:createFont_v0.78 slice$ convert -debug annotate  xc: -font ./arial.ttf -pointsize 24 -annotate 0 "A" null
2015-06-03T14:24:50+03:00 0:00.000 0.000u 6.9.1 Annotate convert[87602]: annotate.c/RenderFreetype/1253/Annotate
  Font ./arial.ttf; font-encoding none; text-encoding none; pointsize 24
2015-06-03T14:24:50+03:00 0:00.000 0.000u 6.9.1 Annotate convert[87602]: annotate.c/GetTypeMetrics/824/Annotate
  Metrics: text: A; width: 18.0312; height: 28; ascent: 22; descent: -5; max advance: 48; bounds: -0.03125,0  16.0469,18; origin: 16,0; pixels per em: 24,24; underline position: -4.5625; underline thickness: 2.34375
2015-06-03T14:24:50+03:00 0:00.000 0.000u 6.9.1 Annotate convert[87602]: annotate.c/RenderFreetype/1253/Annotate
  Font ./arial.ttf; font-encoding none; text-encoding none; pointsize 24
convert: no encode delegate for this image format `XC' @ error/constitute.c/WriteImage/1167.
Sergeys-iMac:createFont_v0.78 slice$ 

and with file name

Sergeys-iMac:createFont_v0.78 slice$ convert -debug annotate  xc: -font ./arial.ttf -pointsize 24 -annotate 0 "A" probe.png
2015-06-03T14:27:20+03:00 0:00.000 0.000u 6.9.1 Annotate convert[87621]: annotate.c/RenderFreetype/1253/Annotate
  Font ./arial.ttf; font-encoding none; text-encoding none; pointsize 24
2015-06-03T14:27:20+03:00 0:00.000 0.000u 6.9.1 Annotate convert[87621]: annotate.c/GetTypeMetrics/824/Annotate
  Metrics: text: A; width: 18.0312; height: 28; ascent: 22; descent: -5; max advance: 48; bounds: -0.03125,0  16.0469,18; origin: 16,0; pixels per em: 24,24; underline position: -4.5625; underline thickness: 2.34375
2015-06-03T14:27:20+03:00 0:00.000 0.000u 6.9.1 Annotate convert[87621]: annotate.c/RenderFreetype/1253/Annotate
  Font ./arial.ttf; font-encoding none; text-encoding none; pointsize 24
Sergeys-iMac:createFont_v0.78 slice$ 

output is empty png file.


Wow! I have success!

Sergeys-iMac:createFont_v0.78 slice$ convert -size 320x100 xc:black -font Arial -pointsize 70 \
>           -fill white   -annotate +5+70 'Anthony' \
>           -gamma 2  +level 0,1000 -white-threshold 999 \
>           -morphology Distance Chebyshev:1,1000 -auto-level \
>           -shade 135x30 -auto-level +level 10,90% font_chebyshev.png
Sergeys-iMac:createFont_v0.78 slice$ 

Attached File  font_chebyshev.png   28.03KB   1 downloads


Checking script 0.79


Sergeys-iMac:createFont_v0.79 slice$ ./createFont.sh -t2 -s14 -f./arial.ttf -b 150,100,4 -o
./createFont.sh: line 40: printf: 13.0625: invalid number
./createFont.sh: line 40: printf: 14.8281: invalid number
Canvas=0x256 | Char cell=0x16
Building ImageMagick code sequence
./createFont.sh: line 40: printf: 4.5: invalid number
./createFont.sh: line 40: printf: 2.67188: invalid number
 

...
./createFont.sh: line 40: printf: 7.09375: invalid number ./createFont.sh: line 40: printf: 6.625: invalid number ./createFont.sh: line 40: printf: 7.67188: invalid number ./createFont.sh: line 40: printf: 9.9375: invalid number ./createFont.sh: line 40: printf: 10.0625: invalid number ./createFont.sh: line 40: printf: 6.64062: invalid number ./createFont.sh: line 40: printf: 7.78125: invalid number Running ImageMagick to create image Optimising /Users/slice/Downloads/createFont_v0.79/type2_arial_14pt_Cell_0x16.png Opening /Users/slice/Downloads/createFont_v0.79/type2_arial_14pt_Cell_0x16.png Sergeys-iMac:createFont_v0.79 slice$

Attached File  Screen Shot 2015-06-03 at 14.37.01.png   51.12KB   1 downloads



#28
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,771 posts
  • Gender:Male
  • Location:UK

Hi Slice

 

Good progress :D

 

Just need to figure out why the script has problems with rounding the numbers on your system.

Here I see

$ printf %0.f 13.0625
13

what version of bash are you using?

$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)
Copyright (C) 2007 Free Software Foundation, Inc.

Please try:

$ LC_NUMERIC="en_US.UTF-8" printf %0.f 13.0625


#29
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,509 posts
  • Gender:Male
  • Location:Moscow
Sergeys-iMac:createFont_v0.79 slice$ bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)
Copyright (C) 2007 Free Software Foundation, Inc.
Sergeys-iMac:createFont_v0.79 slice$ 
Sergeys-iMac:createFont_v0.79 slice$ LC_NUMERIC="en_US.UTF-8" printf %0.f 13.0625
-bash: printf: 13.0625: invalid number
0Sergeys-iMac:createFont_v0.79 slice$ 

:(

My bash doesn't know floating numbers... Is there any other way to round values?



#30
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,771 posts
  • Gender:Male
  • Location:UK

It must do...How about this?

LC_ALL=C printf %0.f 13.0625

or this:

LC_ALL=C /usr/bin/printf "%0.f" 13.0625

 

or this:

echo "13.0625" | awk '{printf("%d\n",$1)}'


#31
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,509 posts
  • Gender:Male
  • Location:Moscow

 

It must do...How about this?

LC_ALL=C printf %0.f 13.0625

or this:

LC_ALL=C /usr/bin/printf "%0.f" 13.0625

or this:

echo "13.0625" | awk '{printf("%d\n",$1)}'
Sergeys-iMac:createFont_v0.79 slice$ LC_ALL=C printf %0.f 13.0625
-bash: printf: 13.0625: invalid number
0Sergeys-iMac:createFont_v0.79 slice$ LC_ALL=C /usr/bin/printf "%0.f" 13.0625
13Sergeys-iMac:createFont_v0.79 slice$ echo "13.0625" | awk '{printf("%d\n",$1)}'
13
Sergeys-iMac:createFont_v0.79 slice$ echo "13.79" | awk '{printf("%d\n",$1)}'
13
Sergeys-iMac:createFont_v0.79 slice$ 



#32
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,771 posts
  • Gender:Male
  • Location:UK

Great.

Please try this version of the script.

 

EDIT: v.80 moved to first post.



#33
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,509 posts
  • Gender:Male
  • Location:Moscow

Great.

Please try this version of the script.

 

attachicon.gifcreateFont_v0.80.zip

Almost great

Sergeys-iMac:createFont_v0.80 slice$ ./createFont.sh -t2 -s22 -fCambria -b 100,150,24 -c 254,254,254 -o
Canvas=352x416 | Char cell=22x26
Building ImageMagick code sequence
Running ImageMagick to create image
Optimising /Users/slice/Downloads/createFont_v0.80/type2_Cambria_22pt_Cell_22x26.png
Opening /Users/slice/Downloads/createFont_v0.80/type2_Cambria_22pt_Cell_22x26.png
Sergeys-iMac:createFont_v0.80 slice$ 

Attached File  type2_Cambria_22pt_Cell_22x26.png   7.8KB   1 downloads   <-- created font file



#34
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,771 posts
  • Gender:Male
  • Location:UK

WTF?

Can you try without the colour options?

 

EDIT: It should work.

Your command with different font here:

./createFont.sh -t2 -s22 -fTrebuchet\ MS.ttf -b 100,150,24 -c 254,254,254 -o

Attached File  type2_Trebuchet MS_22pt_Cell_20x26.png   18.73KB   1 downloads



#35
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,509 posts
  • Gender:Male
  • Location:Moscow

This test made me empty file

#!/bin/bash

convert -size 352x416 -background "RGBA(100,150,24,1)" -font Cambria -pointsize 24 -fill "RGBA(254,254,254,1)" -draw "text 8,19 'W'" \
label:"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                " "/Users/slice/Downloads/createFont_v0.80/type2_Cambria_22pt_test.png"


#36
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,771 posts
  • Gender:Male
  • Location:UK

hmm.

Here I get a W

convert -size 352x416 -background "RGBA(100,150,24,1)" -font showguide.TTF -pointsize 24 -fill "RGBA(254,254,254,1)" -draw "text 8,19 'W'" \
label:"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                " "test.png"

Attached File  test.png   3.03KB   1 downloads

Try a different font?



#37
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,509 posts
  • Gender:Male
  • Location:Moscow

I have a success when I disabled rm "$imageMagickCommandFile"

 

and then manually edit the file: remove -fill "...."

Attached File  type2_Cambria_18pt_Cell_18x21.png   77.6KB   1 downloads


background also wrong



#38
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,771 posts
  • Gender:Male
  • Location:UK

Well done!

 

Interesting.. so what exactly did you have to change in the IM_Command.command file?

Just remove: 

-fill "RGBA(254,254,254,1)"

?



#39
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,509 posts
  • Gender:Male
  • Location:Moscow

This works

convert -size 288x336 -background lightblue -fill yellow -font "Cambria" 

Attached File  type2_Cambria_18pt_Cell_18x21.png   74.08KB   1 downloads



#40
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,771 posts
  • Gender:Male
  • Location:UK

Okay. So there's an issue with interpreting "RGBA(n,n,n,n)"

I wonder why it works here and not with you?







Also tagged with one or more of these keywords: font, typeface, PNG, Clover, Chameleon, GUI, Design


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2017 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy