As you all know PhotoFont Start is already available in Adobe plug-in format or 8bf.
The problem is it costs way too much money to buy the software to perform the transition of image glyph to PHF font so PhotoFont Start can use them.
Well i found 3 possible answers to this dilemma.
1)- FREE
A LISP program written in 2005 by Max-Gerd Retzlaff. -
http://blog.matroid.org/display/63;;; photofont.lisp - A program to generate photofonts
;;; Dec 5, 2008 by Max-Gerd Retzlaff <m.retzlaff@gmx.net>
;;; Version 1
;;;
;;; See http://www.photofont.com/ for more information.
;;; The "Photofont format specification" is here:
;;; http://www.photofont.com/photofont/devel/
;;;
;;; Example call:
;;; (photofont "Teelichter256" "font-spec-256" "Teelichter256.phf" :indent nil)
;;;
;;; The font-spec file is expected to contain lines like this one:
;;; ! Teelichter-256/!_dscf5475.jpg.png
;;; (single character, a single space, filename with relative path, newline character)
(require :xmls)
(require :cl-mime)
(require :s-base64)
(require :png) ;; cl-png
(defun png->mime (pathname)
(with-output-to-string (mime-out)
(let ((png (with-open-file (in pathname
:element-type '(unsigned-byte 8))
(with-output-to-string (out)
(s-base64:encode-base64 in out)))))
(mime:print-mime mime-out
(make-instance 'mime:text-mime
:type "image"
:subtype "png"
:charset "US-ASCII"
:content-encoding :base64
:encoding :base64
:content png)
t nil))))
;; (png->mime "Teelichter/256/A_dscf5380.jpg.png")
(defun png-dimensions (pathname)
(let ((png (with-open-file (in pathname
:element-type '(unsigned-byte 8))
(png:decode in))))
(values (png:image-width png)
(png:image-height png))))
(defun root (children)
(xmls:make-node :name "PhF" :attrs '(("version" "1.0"))
:children children))
#+(or)
(defun header ()
(xmls:make-node :name "header"
(make-node :name "version" :attrs (xmls:make-node :name "type" :attrs "string"))
(make-node :name)
))
(defun header (fontname &key (encoding "ISO 8859- 1 Latin 1 (Western)")
(ascender 256)
(descender 51)
(internal-leading 77)
(upm 256))
`("header" NIL ("version" (("type" "string")))
("family" (("type" "string")) ,fontname)
("full_name" (("type" "string")) ,fontname)
("codepage" (("type" "string")) ,(princ-to-string encoding))
("ascender" (("type" "int")) ,(princ-to-string ascender))
("descender" (("type" "int")) ,(princ-to-string descender))
("internal_leading" (("type" "int")) ,(princ-to-string internal-leading))
("upm" (("type" "int")) ,upm)))
(defun letter->id (letter)
"More or less a bugfix, as the photofont plug-in for Adobe Photoshop CS3 (Windows),
seems to have a problem with XML encodings like \"§\"... Otherwise I would just
use STRING."
(let ((code (char-code letter)))
(if (< 127 code)
(char-name letter)
;; (format nil "~a+0x80" (code-char (- code 128)))
(string letter))))
(defun mapping (letter)
`("map" (("unc" ,(princ-to-string (char-code letter))) ("id" ,(letter->id letter)))))
(defun all-mappings (letters)
(mapcar #'mapping letters))
(defun globals (all-mappings)
`("globals" NIL
("unicode_mapping" (("subtype" "map_unicode") ("type" "array"))
,@all-mappings)))
;; (globals (all-mappings (coerce "ABCDß!§$" 'list)))
(defun glyph (letter pathname)
(multiple-value-bind (width height)
(png-dimensions pathname)
(let ((width-string (princ-to-string width))
(height-string (princ-to-string height)))
`("glyph" (("id" ,(letter->id letter)))
("image" (("type" "photo")
("id" "v0"))
("shape" (("embedded" ,(file-namestring pathname)))
("ppm" (("int" ,height-string)))
("bbox" (("height" ,height-string) ("width" ,width-string)
("y" "0") ("x" "0")))
("base" (("y" ,height-string) ("x" "0")))
("delta" (("y" "0") ("x" ,(princ-to-string (- width 2)))))))))))
(defun all-glyphs (list)
(xmls:make-node :name "glyphs"
:children (mapcar (lambda (glyph-spec)
(apply #'glyph glyph-spec))
list)))
#+(or)
(all-glyphs '((#\A #p"Teelichter/256/A_dscf5380.jpg.png")
(#\B #p"Teelichter/256/B_dscf5702.jpg.png")))
(defun image (pathname)
(xmls:make-node :name "image" :attrs `(("id" ,(file-namestring pathname)))
:children (list (png->mime pathname))))
;; (image "Teelichter/256/A_dscf5380.jpg.png")
(defun all-images (pathnames)
(xmls:make-node :name "data"
:children (list (xmls:make-node :name "photo"
:children (mapcar #'image pathnames)))))
#+(or)
(all-images (list "Teelichter/256/A_dscf5380.jpg.png"
"Teelichter/256/B_dscf5702.jpg.png"))
(defun parse-fontspec (pathname)
(let ((glyph-specs))
(with-open-file (file pathname)
(do ((line (read-line file nil 'eof)
(read-line file nil 'eof)))
((eq line 'eof))
(push (list (elt line 0)
(subseq line 2))
glyph-specs)))
(nreverse glyph-specs)))
(defun generate-photofont (fontname pathname)
(let ((glyph-specs (parse-fontspec pathname)))
(multiple-value-bind (width height)
(png-dimensions (second (first glyph-specs)))
(declare (ignore height))
(root
(list
(header fontname
:ascender (princ-to-string width)
:upm (princ-to-string width))
(globals (all-mappings (mapcar #'car glyph-specs)))
(all-glyphs glyph-specs)
(all-images (mapcar #'second glyph-specs)))))))
(defun photofont (fontname source target &key indent)
(with-open-file (out target :direction :output :if-exists :overwrite :if-does-not-exist :create)
(princ "<?xml version=\"1.0\" ?>
" out)
(xmls:write-xml (generate-photofont fontname source) out :indent indent)))
;; (photofont "Teelichter256" "font-spec-256" "Teelichter256.phf" :indent nil)
;; (princ (xmls:toxml * :indent t))
If anyone can figure out how to use this i am all ears.
2)- NOT FREE - cost is 63 USD - formally called CoffeeCup Photo Object - no longer offered or supported by them.
Hence the reason i had to order through the parent company Hemera the original creator.
A program i found online by BMSoftware that will use a texture to fill in the font outlines and export it as an PHF font called Hemera Photo Objects. (i have ordered this and am awaiting delivery)
I ordered the 25,000 photo objects and 500 extra PHF texture version ...see what that looks like later.
Here is the CoffeCup version TRIAL only so it has 10 textures and no PHF export.
3)- FREE (if i ever release it)
My own version of a Photofont program which consists only of a PHF/XML file.
My aim is to be able to take this one PHF file and drop it into your image glyph folder and run the PhotoFont installer through the 8bf within Gimp.
I have gotten the TEST phf to install..however it can not find the images i have referenced.
I have all my TEST glyphs in a directory in C under grassy.
ie... F:///C:/grassy/image.png
This is how i am trying to reference them but it doesn't seem to work.The error keeps telling me PhotoFont Start can not install as the font file is invalid.
<?xml version="1.0" ?>
<PhF version="1.0">
<header>
<version type="string"></version>
<family type="string">Grassy-Vine_RD4</family>
<full_name type="string">Grassy-Vine_RD4</full_name>
<codepage type="string">MS Windows 1252 Western (ANSI)</codepage>
<ascender type="int">443</ascender>
<descender type="int">96</descender>
<internal_leading type="int">107</internal_leading>
<upm type="int">480</upm>
</header>
<globals>
<unicode_mapping type="array" subtype="map_unicode">
<map id="A" unc="65" />
<map id="B" unc="66" />
<map id="C" unc="67" />
<map id="D" unc="68" />
<map id="E" unc="69" />
<map id="F" unc="70" />
<map id="G" unc="71" />
<map id="a" unc="97" />
<map id="b" unc="98" />
<map id="c" unc="99" />
<map id="d" unc="100" />
<map id="e" unc="101" />
<map id="f" unc="102" />
<map id="g" unc="103" />
</unicode_mapping>
</globals>
<glyphs>
<glyph id="A">
<image id="v0" type="photo" href=”file:///C:/grassy/ABCD.png">
<shape embedded="file:///C:/grassy/ABCD.png">
<ppm int="480" />
<bbox x="20" y="-5" width="404" height="403" />
<base x="-20" y="398" />
<delta x="444" y="0" />
</shape>
</image>
</glyph>
<glyph id="B">
<image id="v0" type="photo" href=”file:///C:/grassy/EFGH.png">
<shape embedded="file:///C:/grassy/EFGH.png">
<ppm int="480" />
<bbox x="30" y="-5" width="337" height="393" />
<base x="-30" y="388" />
<delta x="393" y="0" />
</shape>
</image>
</glyph>
<glyph id="C">
<image id="v0" type="photo" href=”file:///C:/grassy/IJKL.png">
<shape embedded="file:///C:/grassy/IJKL.png">
<ppm int="480" />
<bbox x="25" y="-5" width="357" height="415" />
<base x="-25" y="410" />
<delta x="405" y="0" />
</shape>
</image>
</glyph>
<glyph id="D">
<image id="v0" type="photo" href=”file:///C:/grassy/MNOP.png">
<shape embedded="file:///C:/grassy/MNOP.png">
<ppm int="480" />
<bbox x="30" y="-5" width="341" height="398" />
<base x="-30" y="393" />
<delta x="396" y="0" />
</shape>
</image>
</glyph>
<glyph id="E">
<image id="v0" type="photo" href=”file:///C:/grassy/QRST.png">
<shape embedded="file:///C:/grassy/QRST.png">
<ppm int="480" />
<bbox x="30" y="-5" width="327" height="419" />
<base x="-30" y="414" />
<delta x="386" y="0" />
</shape>
</image>
</glyph>
<glyph id="F">
<image id="v0" type="photo" href=”file:///C:/grassy/UVWX.png">
<shape embedded="file:///C:/grassy/UVWX.png">
<ppm int="480" />
<bbox x="30" y="-5" width="295" height="413" />
<base x="-30" y="408" />
<delta x="340" y="0" />
</shape>
</image>
</glyph>
<glyph id="G">
<image id="v0" type="photo" href=”file:///C:/grassy/YZ.png">
<shape embedded="file:///C:/grassy/YZ.png">
<ppm int="480" />
<bbox x="25" y="-5" width="379" height="413" />
<base x="-25" y="408" />
<delta x="430" y="0" />
</shape>
</image>
</glyph>
<glyph id="a">
<image id="v0" type="photo" href=”file:///C:/grassy/ABCD.png">
<shape embedded="file:///C:/grassy/ABCD.png">
<ppm int="480" />
<bbox x="20" y="-5" width="404" height="403" />
<base x="-20" y="398" />
<delta x="444" y="0" />
</shape>
</image>
</glyph>
<glyph id="b">
<image id="v0" type="photo" href=”file:///C:/grassy/EFGH.png">
<shape embedded="file:///C:/grassy/EFGH.png">
<ppm int="480" />
<bbox x="30" y="-5" width="337" height="393" />
<base x="-30" y="388" />
<delta x="393" y="0" />
</shape>
</image>
</glyph>
<glyph id="c">
<image id="v0" type="photo" href=”file:///C:/grassy/IJKL.png">
<shape embedded="file:///C:/grassy/IJKL.png">
<ppm int="480" />
<bbox x="25" y="-5" width="357" height="415" />
<base x="-25" y="410" />
<delta x="405" y="0" />
</shape>
</image>
</glyph>
<glyph id="d">
<image id="v0" type="photo" href=”file:///C:/grassy/MNOP.png">
<shape embedded="file:///C:/grassy/MNOP.png">
<ppm int="480" />
<bbox x="30" y="-5" width="341" height="398" />
<base x="-30" y="393" />
<delta x="396" y="0" />
</shape>
</image>
</glyph>
<glyph id="e">
<image id="v0" type="photo" href=”file:///C:/grassy/QRST.png">
<shape embedded="file:///C:/grassy/QRST.png">
<ppm int="480" />
<bbox x="30" y="-5" width="327" height="419" />
<base x="-30" y="414" />
<delta x="386" y="0" />
</shape>
</image>
</glyph>
<glyph id="f">
<image id="v0" type="photo" href=”file:///C:/grassy/UVWX.png">
<shape embedded="file:///C:/grassy/UVWX.png">
<ppm int="480" />
<bbox x="30" y="-5" width="295" height="413" />
<base x="-30" y="408" />
<delta x="340" y="0" />
</shape>
</image>
</glyph>
<glyph id="g">
<image id="v0" type="photo" href=”file:///C:/grassy/YZ.png">
<shape embedded="file:///C:/grassy/YZ.png">
<ppm int="480" />
<bbox x="25" y="-5" width="379" height="413" />
<base x="-25" y="408" />
<delta x="430" y="0" />
</shape>
</image>
</glyph>
</glyphs>
<data>
<photo>
</photo>
</data>
</PhF>
If i use this one it installs but no images are located.
<?xml version="1.0" ?>
<PhF version="1.0">
<header>
<version type="string"></version>
<family type="string">Grassy-Vine_RD8</family>
<full_name type="string">Grassy-Vine_RD8</full_name>
<codepage type="string">MS Windows 1252 Western (ANSI)</codepage>
<ascender type="int">443</ascender>
<descender type="int">96</descender>
<internal_leading type="int">107</internal_leading>
<upm type="int">480</upm>
</header>
<globals>
<unicode_mapping type="array" subtype="map_unicode">
<map id="A" unc="65" />
<map id="B" unc="66" />
<map id="C" unc="67" />
<map id="D" unc="68" />
<map id="E" unc="69" />
<map id="F" unc="70" />
<map id="G" unc="71" />
<map id="a" unc="97" />
<map id="b" unc="98" />
<map id="c" unc="99" />
<map id="d" unc="100" />
<map id="e" unc="101" />
<map id="f" unc="102" />
<map id="g" unc="103" />
</unicode_mapping>
</globals>
<glyphs>
<glyph id="A">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/ABCD.png">
<ppm int="480" />
<bbox x="20" y="-5" width="404" height="403" />
<base x="-20" y="398" />
<delta x="444" y="0" />
</shape>
</image>
</glyph>
<glyph id="B">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/EFGH.png">
<ppm int="480" />
<bbox x="30" y="-5" width="337" height="393" />
<base x="-30" y="388" />
<delta x="393" y="0" />
</shape>
</image>
</glyph>
<glyph id="C">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/IJKL.png">
<ppm int="480" />
<bbox x="25" y="-5" width="357" height="415" />
<base x="-25" y="410" />
<delta x="405" y="0" />
</shape>
</image>
</glyph>
<glyph id="D">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/MNOP.png">
<ppm int="480" />
<bbox x="30" y="-5" width="341" height="398" />
<base x="-30" y="393" />
<delta x="396" y="0" />
</shape>
</image>
</glyph>
<glyph id="E">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/QRST.png">
<ppm int="480" />
<bbox x="30" y="-5" width="327" height="419" />
<base x="-30" y="414" />
<delta x="386" y="0" />
</shape>
</image>
</glyph>
<glyph id="F">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/UVWX.png">
<ppm int="480" />
<bbox x="30" y="-5" width="295" height="413" />
<base x="-30" y="408" />
<delta x="340" y="0" />
</shape>
</image>
</glyph>
<glyph id="G">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/YZ.png">
<ppm int="480" />
<bbox x="25" y="-5" width="379" height="413" />
<base x="-25" y="408" />
<delta x="430" y="0" />
</shape>
</image>
</glyph>
<glyph id="a">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/ABCD.png">
<ppm int="480" />
<bbox x="20" y="-5" width="404" height="403" />
<base x="-20" y="398" />
<delta x="444" y="0" />
</shape>
</image>
</glyph>
<glyph id="b">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/EFGH.png">
<ppm int="480" />
<bbox x="30" y="-5" width="337" height="393" />
<base x="-30" y="388" />
<delta x="393" y="0" />
</shape>
</image>
</glyph>
<glyph id="c">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/IJKL.png">
<ppm int="480" />
<bbox x="25" y="-5" width="357" height="415" />
<base x="-25" y="410" />
<delta x="405" y="0" />
</shape>
</image>
</glyph>
<glyph id="d">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/MNOP.png">
<ppm int="480" />
<bbox x="30" y="-5" width="341" height="398" />
<base x="-30" y="393" />
<delta x="396" y="0" />
</shape>
</image>
</glyph>
<glyph id="e">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/QRST.png">
<ppm int="480" />
<bbox x="30" y="-5" width="327" height="419" />
<base x="-30" y="414" />
<delta x="386" y="0" />
</shape>
</image>
</glyph>
<glyph id="f">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/UVWX.png">
<ppm int="480" />
<bbox x="30" y="-5" width="295" height="413" />
<base x="-30" y="408" />
<delta x="340" y="0" />
</shape>
</image>
</glyph>
<glyph id="g">
<image id="Version-2" type="photo">
<shape id="file:///C:/grassy/YZ.png">
<ppm int="480" />
<bbox x="25" y="-5" width="379" height="413" />
<base x="-25" y="408" />
<delta x="430" y="0" />
</shape>
</image>
</glyph>
</glyphs>
<data>
<photo>
</photo>
</data>
</PhF>
Here is the code if someone can tell me how to get the xml to reference the image glyph locations i would be most greatfull.
According to PHF specifications a embedded image in the data>photo>image area of the xml doc isnt needed IF the images are referenced like this.
<image href="F:///C:/grassy/image.png">
So i am stuck there. :\
It would be nice to get this to work so everyone would have a FREE resource to make transparency supported PHF glyphs.
Not everyone can afford 499 dollars to be able to do it.
Bitfonter has informed a few of us at Filter Forge -
http://www.filterforge.com/forum/read.p ... 2#postform that they may release a online RENTABLE service for just making or converting glyphs to PHF bitmap fonts.Still not FREE like i would like to see.
So any help would be appreciated.
Thanks