Photofont is a registered trademark of Fontlab Ltd.
Format version 2.5
Revision:Rod Detmer March - 2012 - for NON embedded image glyphs
Reason: To install NON embedded phf font files into the FREE Photofont Start Plug-in
Released under the http://creativecommons.org/licenses/by-sa/3.0/
The sample Broken Blue Bevel - also included is FREE with the software and can be used according to the same CCL.
    Introduction - PhotoStart Plugin and Where to get it
	Installing the plugin and how it works
	What is a PhotoFont
    The Header
    Encoding and Kerning
    Glyph Metrics
    Glyph Images
    Putting It All Together
	Disclaimer
	Version History - Updates if any
	The XCF Template
#####################################################################################################
    Introduction - PhotoStart Plugin and Where to get it

The photofont specification is quite simple. Anyone with a text editor and a graphics program 
capable of exporting PNG files can create a photofont. Get the plugin here first!
Photofont Start plug-in which is free - 
FOR WINDOWS
http://www.font.to/downloads/demos/PS2Win.exe -
FOR MAC
http://www.fontlab.com/photofont/photofont-start/ - bottom left of page
MANUAL
http://www.font.to/downloads/manuals/PS2Manual.pdf
and can be used within many opensource apps that support, and will run 8bf plugins.
************************************************************
The plugin is compatible with Adobe Photoshop (possibly CS5), CS4, CS3, CS2 and earlier, as well as other 
Windows applications that support the Photoshop plugin interface.

Graphic Apps that support 8bf plugins
XnVIEW, Gimp (with PSPI) , Paint.dot.net now has an available plugin for running Adobe 8bf filters also.
Just to name a few.
************************************************************
########################################################################################################
	Installing the plugin and how it works
This is for Windows XP - Do a system wide search for the Photofonts folder if you install the plugin on 
other platforms such as Windows 64 bit or Windows 7 or MAC!
Run the installer and place the plugin in your graphics programs plug-in directory.
Restart your program.It will be listed in your filters directory/menu as Fontlab

It works like this: You need to place the PHF file (included with this README), in your 
C:\Documents and Settings\YourUserFolder\My Documents\Photofonts
After you install Photofont Start plugin this directory should already exist.If it doesn't create the folder
Photofonts in your My Documents folder!

All your Cap and symbol glyph images need to go into your
C:\Documents and Settings\YourUserFolder\My Documents\Photofonts\images folder
This directory (images), NEEDS to be created by you! Just create a folder named images in the Photofonts folder.
This will be reflected in the included PHF file as this line of code - <shape system="images/A.png">
You will also need to create another folder in the Photofonts\images folder named nonCaps. This is where all the 
small letters will go.This is reflected in the PHF code as <shape system="images/nonCaps/a.png">

Photofont Start Plug-in looks for all the PHF files in the Photofonts folder, and the PHF file looks for all 
the glyphs in this images directory that you need to create.

IT IS ADVISABLE - 
That you DO NOT EDIT the phf file, and that you use ONE set of image glyphs at a time to save on disc space.
This is how i do it - 
I use a USB drive for all my image/glyph folders.For instance i may have 1gig of all differently named folders 
containing different glyph sets. I then just copy a set from one of the folders, and paste it in the images 
folder replacing the other set if there is one already in there.
DO NOT CUT AND PASTE - just copy and paste from the USB drive. USB flash drives are available for 10 USD for 
4 gigs of space.
This way you keep the PHF file the same (editing that many glyph blocks can be a pain)
And you save space. This way you can also use bigger high res images.
#############################################################################################
	What is a PhotoFont
A photofont is an XML/PHF document and consists of four sections: 
1) header 
2) Unicode encoding & kerning, 
3) glyph metrics, 
4) and glyph images. We'll describe these in detail below.

MAKE A COPY OF THE PHF INCLUDED
OPEN the COPIED PHF file in your favorite (preferably), Notepad ++ editor. Take a close look at it and all 
it's components.
##############################################################################################
<!-- The Header -->

<header>
<version type="string"></version>
<family type="string">AGBlue</family>
<full_name type="string">AGBlue</full_name>
<codepage type="string">MacOS Roman</codepage>
<ascender type="int">34</ascender>
<descender type="int">9</descender>
<upm type="int">36</upm>
</header>

The header begins with a <header> tag, consists of a few lines of descriptive information, called 
attributes, and ends with a </header> tag. attributes have the following format:
<attribute_id type="type_id">data</attribute_id>

where:

attribute_id
identifies the attribute being defined

type_id
specifies what kind of data is stored inside the attribute object

data
is the content of the attribute

In this example the version is blank and the family and full_name are the same. The MacOS Roman 
codepage is specified and the ascender and descender are given in font units. "upm" (units per eM) 
defines the font units.

The possible attributes are:

int: ascender
Ascender height of the font in font units (see below about font units). Optional, but highly 
recommended.

int: base_to_base
Distance between lines in font units. If not specified it is assumed to be the sum of ascender 
and descender.
In this example, the base_to_base attribute is set to 56:
<base_to_base type="int">56</base_to_base>

string: codepage
Defines the codepage for the font.

string: copyright
A string containing font copyright information.

int: descender
The descender depth of the font in font units. Optional, but highly recommended.

string: family
A mandatory attribute. The family attribute defines the family name of the font. It is used to 
combine fonts into families.

string: full_name
Defines the unique name of the font by which it is identified. If absent the family attribute 
value will be used instead. If there are two fonts with the same full name in the system, only 
one of them will be used.

string: style
Specifies the style of the font. If absent it is forced to "Regular".

int: upm
Another mandatory attribute. The font's UPM (units per eM) value. Defines the height of the 
font in logical units that are used to define the geometrical attributes of the font (ascender, 
descender, etc.). The upm is an arbitrary number, but it is convenient to use the pixel height 
of the bitmap. I.e. if you have 32 pixel high bitmaps in the font then a upm of 32 is convenient.
This works just the same way as regular fonts. All distances in the font are measured in abstract 
logical font units. The UPM tells you the size of the font measured in these units. Thus we must 
recalculate these units into real values for specific font point sizes. In photofont the UPM usually 
is equal to the PPM and thus these units are essentially the same as the pixels of the bitmap 
containing the glyph images.string: version
A string with information about the version of the font.
##################################################################################################
<!-- Encoding and Kerning -->

<globals>
<unicode_mapping type="array" subtype="map_unicode">
<map id="A" unc="65" />
<map id="B" unc="66" />
<map id="C" unc="67" />
...etc
...etc
<map id="zero" unc="48" />
</unicode_mapping>

The globals section begins and ends with <globals> tags and contains auxiliary data  particularly 
the Unicode mapping table and kerning table.

The Unicode mapping section begins with the <unicode_mapping> tag and ends with the corresponding 
closing tag. The body consists of a line for each mapping. In our example you see that the character 
with id="A" is mapped to Unicode 65; character "B" is mapped to Unicode 66, etc. Each character in 
the photofont is mapped to its Unicode in this section. In most Western fonts this section will not 
vary much from font to font if the designer sticks to standard names and Unicodes. I.e this code may 
be reusable from font to font.
Kerning Table

Like Unicode Mapping, the kerning table is represented by by an array of kerning pairs and has the 
following format:

<kerning type="array" subtype="kerning_pair">
<pair left="glyph_id" [ left_image="image_id" ]
right="glyph_id" [ right_image="image_id" ]
[ x="x_offset" ]
[ y="y_offset" ] />
...etc.
<kerning> where:

glyph_id
is the identifier of the Glyph

image_id
is the identifier of the Image within the glyph

x_offset
is an integer value representing the horizontal kerning amount (in font units as defined by the upm)

y_offset
is an integer value representing the vertical kerning amount (in font units)

The left and "left_image" attributes specify the first glyph in the kerning pair, while "right" and 
"right_image" define the second glyph. If the Image is not specified then kerning will be applied to 
all the Images of the Glyph. If one of the kerning values is omitted it is assumed to be zero.

For example:
<pair left="A" right="V" right_image="image1" x="-5" />

This pair instructs the browser that the "image1" Image of the Glyph "V" is to be shifted 5 units to 
the left if it follows any image of the Glyph "A".

A typical Kerning table in a photofont looks like this: 
<!-- I DO NOT USE THIS IN THE PHF FILE - YOU CAN IF YOU WISH - BUT IT HAS TO BE PRECISE! -->
<kerning type="array" subtype="kerning_pair">
<pair left="A" right="V" x="-14" />
<pair left="A" right="T" x="-14" />
<pair left="A" right="O" x="-8" />
...etc
...etc
<pair left="V" right="A" x="-14" />
</kerning>
</globals>
#############################################################################################
<!-- Glyph Metrics -->

<glyphs>
<glyph id="A">
<image id="v0" type="photo">
<shape embedded="Image32"> IF not embedded use <shape system="images/image.png">
<ppm int="36" />
<bbox x="0" y="-1" width="27" height="28" />
<base x="0" y="27" />
<delta x="26" y="0" />
</shape>
</image>
</glyph>
...etc
...etc
<glyph id="asciitilde">
<image id="v0" type="photo">
<shape embedded="Image93"> IF not embedded use <shape system="images/image.png">
<ppm int="36" />
<bbox x="2" y="10" width="18" height="6" />
<base x="-2" y="16" />
<delta x="22" y="0" />
</shape>
</image>
</glyph>
</glyphs>

The glyph metrics section is set off by <glyphs> and </glyphs> tags. It contains an "object" for each 
character in which metrics and shape information is given. The glyph id corresponds to the id in the 
previous section. In the image tag, id="v0" identifies a particular image. A character can have more 
than one image in a photofont. Each image has an identifier, which is unique within the glyph. This 
allows specific images or glyphs to be referenced within the font (e.g. in the kerning table). In our 
case the type is always photo, which means a 32 bit bitmap with an alpha channel (like a PNG file). 
The shape (the actual image data) can be embedded, as it is in this font, which means that the graphics 
data for the shape will be found in the next section, or it can be referred, in which casea relative 
path to the graphics data is to be found will be given.
<shape system="images/A.png">
REFERRED is what is happening in our PHF document so there is no need for embedding with expensive software!

************
EXAMPLE GLYPH BLOCK
        <glyph id="E">
   <image id="v0" type="photo">
    <shape system="images/size_test/Candy_Canes/E.png">
     <ppm int="480" />
     <bbox x="20" y="-5" width="500" height="700" />
     <base x="-20" y="500" />
     <delta x="444" y="0" />
    </shape>
   </image>
  </glyph>
************
The other attributes are:

ppm_value
PPeM of this image. ( Photofont Start 8bf Plugin uses 480 )

bbox_x
X offset of the bounding box left border relative to Base Point

bbox_y
Y offset of the bounding box top border relative to Base Point

bbox_width
Width of the bounding box

bbox_height
Height of the bounding box

base_x
X coordinate of the Base Point relative to the top side of the bitmap

base_y
Y coordinate of the Base Point relative to the left side of the bitmap

delta_x
horizontal metric

delta_y
vertical metric
Glyph Images

<data> 

<photo> 
<!---  ONLY NEEDED IF IMAGES ARE EMBEDDED SUCH AS CREATED IN BITFONTER -->WE DONT USE THIS!
<image id="Image32">
Content-Type: image/png; charset=US-ASCII; name=Image3
Content-transfer-encoding: base64
iVBORw0KGgoAAAANSUhEUgAAABsAAAAcCAYAAACQ0cTtAAAFSElEQVR4nIWWW1Ij2RGGP90R
CAlJICRA6IKE9O4tzMPEzNM4gi3MWnoL9hLwEmYL9utAX2jE3dCNoIGmaRjm80OVSkWH7VbE
CVWdypN//n/myXMSKt/7JRKJ/2ukJr7rJDSEpQP6SWkzhvyYPNLmPaur7wEMxqVwKCgLHwRd
ZTf89nc3C5abSAMpcxQuO6e4cgzDx+BdZZVH4B42DgDJbghlKbIXgS2goBmUtMJH2y2dBvPw
CoTSPmQlzw5DnmixD0iOiwCswBg4hswZpD4zbH2BoRFQHmXB4L+nrATAMHY9P4oAOxm7cEQG
meUMOIXem/DzYQC2WZBKGOBM5z3MnIYGk6jHllH4ZBZNonAiHAujGDu380h77XE6ldiDnJAI
ZawW34ZU78kVAqPNEKw4o1QvZEPhxnmUoVK8tobCtczsh57/age75CTBISSPYPUCKjKY5Gyz
OAnuglTvD9rN3YhVgXvhQua0t/peuDFb027tzBaaRpP9eO58VeUM+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/59i2UY1uHkV20hubW7yPDKg8/REa5ngZ3w2c3
O59i0tzY4Yw6O8ARnXlZ4Znu3AhKh7TWPgdH1MS+di8zminvmooFne4/vYpF9N9HG/dYuqWf
FZaE7BWUhNwuJA8Yrj5T3dj9rp/+/NNvyeDqvPd+qXAFwwsYCNVn5pDk5i4J+BdzM7x9BO52
If+BwSegMGD4Z5LdZ7jcSwImKj3/Qf8Y2CO/IIOuzKQCvLvbdPc/D7U8SA5jwKcAAAAASUVO </image>
<image>
...etc
...etc
</image>
...etc
...etc

<!--- *********************************************************************** -->
</photo>
</data>

The glyph images section (which is unnecessary if all the glyphs are referred) starts with <data> and <photo> 
tags. Then follows a series of <image> "objects" which contain the actual graphics data for the photofont 
glyphs. They start with an <image> tag in which the image is identified, and then have two lines of 
information which is usually always the same except for the name, which references the image name assigned 
in the previous section. So in our example you see that the image (and we have shown only one of the images 
here because of space considerations) is image32, which we know is the character "A" from the previous 
sections. Then follows the MIME-encoded data for the PNG bitmap of the glyph and then the closing </image> tag. 
Every embedded glyph should have an image in this section . Note that several glyphs can refer to the same 
bitmap. Also some of images may be embedded and some may be specified as separate resources.
#######################################################################################################

<!-- Putting It All Together -->

Finally the whole font needs to be wrapped in a couple tags, and the end product looks something like this:

<?xml version="1.0" ?>
<PhF version="1.0">
<header>
...etc
</header>
<globals>
...etc
</globals>
<glyphs>
...etc
</glyphs>
 <data>

  <photo>
  <!--  IF EMBEDDED USE IMAGE TAGS - IF NOT OMIT THEM-->
  <image>
  </image>

  
  <image>
  </image>
  
  </photo>

 </data>

</PhF>

<!--- ALL images and phf files must go in these directories to work -->
The phf file itself (Windows XP)
C:\Documents and Settings\YourUserNameFolder\My Documents\Photofonts
 - I am not sure of other systems - look for or search for Photofonts folder.
*********************************************************************************
The images/glyphs for the phf file 
C:\Documents and Settings\UserNameFolder\My Documents\Photofonts\images
(this can be edited within the PHF file)-just change this line - 
<shape system="images/E.png">
Example of a change for a different directory NOTE: this has to be done for EVERY glyph block!
<shape system="images/MyNewFolder/image.png">
#################################################################################################
DISCLAIMER
I take no responsibility for your sytem or state of it after you install the Photofont Start plugin 
and use my PHF installer file. It is assumed you KNOW how to install software and have READ this readme file.

Thanks for trying the FREE PHF Photofont installer version 1.0 for Photofont Start version 2.0

-Rod - 
Contact me - http://www.gimpchat.com (send PM)
My Blog - http://simplysignage.110mb.com/blog/blog/
*************************************************************************
	Version History - Updates if any

 March 8th 2012
Photofont Start/PHF Photofont installer 1.0 (PSPPI-1.0) official release.

 March 12th
Added asterisk, numbersign, and at to the code. Added free font glyph sample. 
(PSPPI-1.5)
##################################################################################################
XCF TEMPLATE
The included XCF workspace template can be opened using GIMP a free opensource image manipulation program.
Get it here - www.gimp.org
The template is setup 500x700 to edit/stroke path with a image hose or brush.The paths for each commonly 
used glyph are already made for you.The guides are set and you should stay within those guides for the 
glyphs to be seen by the Photofont Start plugin. Otherwise parts of the image may get cut off.
YOU CAN EDIT THE IMAGE SIZE by editing this line of code within EVERY glyph block.
     <bbox x="20" y="-5" width="500" height="700" />
	 If you decide to use say 2000x2000 for image size and a 1000x1000 size glyph just edit the 
	 code accordingly
     <bbox x="20" y="-5" width="1000" height="1000">
	 Then set your guides within Gimp for the new text layers.
	 
You can also use any system installed font in the template.I used a default one Sans Bold i think.  :)
Just make all the other T-ext layers invisable (shift click the eye next to a layer)
Go to the paths dialog and do the same for the paths layers.
Now just select each text layer you create and go to select to path. Select none.
Repeat for each text layer.
OR delete everything and set up your own template. (to save on XCF size)

The template consists of 26 letters, 10 numbers, and a few commonly used symbols such as 
exclamation point, period, comma, and question mark.

If you decide to use the included template just 
1) open the XCF in Gimp, and 
2) make all the layers invisable.
to do this just click the eye next to each layer or shift click an eye tp make them all invisable except the 
one you click. Now just click it to make it invisable. Just a quicker way to do it.
3) create a new layer on top
4) select your image hose or brush
5) go to the paths dialog and right click The letter A path and go to Edit>stroke path - be sure to select 
use paintbrush and select a stroke tool. Click ok and the path will get stroked.
6) right click that path and choose path to selection - 
7) go to select>shrink by 7 and 
8) edit>stroke with paintbrush again
Repeat this until your font looks good to you.

You can also just open images in Gimp and make letters/glyphs from them.  :)
Just resize them to fit inside the guides!

To see what the image NAMES need to be saved as look in the phf file itself. For instance 
exclamation point image needs to be named exclam.png and so on. Numbers are zero.png, one.png, two.png and so on.
Be sure to name these correctly or the plugin will not see them.

NOTE: Some of the image id's included in the PHF file i did not include in the XCF workspace file.You will have 
to create those layers and paths yourself. Such as dollar, bracketright, ect ect ect...
I did however include them in the PHF code so just create the image glyphs name them correctly 
and they will work.
Unicodes i did not include in the phf code are hash and asterick as i do not know those unicodes.
Perhaps someone can enlighten me?  :)

IMAGE NAME GUIDE - MAP ID IS ALSO IMAGE NAME - just add the png extension.
For instance 
map id="A" means this images name is A.png (it IS case sensitive!)
map id="bracketright" means this images name is bracketright.png

   <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="H" unc="72" />
   <map id="I" unc="73" />
   <map id="J" unc="74" />
   <map id="K" unc="75" />
   <map id="L" unc="76" />
   <map id="M" unc="77" />
   <map id="N" unc="78" />
   <map id="O" unc="79" />
   <map id="P" unc="80" />
   <map id="Q" unc="81" />
   <map id="R" unc="82" />
   <map id="S" unc="83" />
   <map id="T" unc="84" />
   <map id="U" unc="85" />
   <map id="V" unc="86" />
   <map id="W" unc="87" />
   <map id="X" unc="88" />
   <map id="Y" unc="89" />
   <map id="Z" unc="90" />
   <map id="a" unc="97" />
   <map id="ampersand" unc="38" />
   <map id="asterisk" unc="42" />
   <map id="at" unc="64" />   
   <map id="b" unc="98" />
   <map id="braceleft" unc="123" />
   <map id="braceright" unc="125" />
   <map id="bracketleft" unc="91" />
   <map id="bracketright" unc="93" />
   <map id="c" unc="99" />
   <map id="colon" unc="58" />
   <map id="comma" unc="44" />
   <map id="d" unc="100" />
   <map id="degree" unc="176" />
   <map id="dollar" unc="36" />
   <map id="e" unc="101" />
   <map id="eight" unc="56" />
   <map id="equal" unc="61" />
   <map id="exclam" unc="33" />
   <map id="f" unc="102" />
   <map id="five" unc="53" />
   <map id="four" unc="52" />
   <map id="g" unc="103" />
   <map id="greater" unc="62" />
   <map id="h" unc="104" />
   <map id="hyphen" unc="45" />
   <map id="i" unc="105" />
   <map id="j" unc="106" />
   <map id="k" unc="107" />
   <map id="l" unc="108" />
   <map id="less" unc="60" />
   <map id="m" unc="109" />
   <map id="multiply" unc="215" />
   <map id="n" unc="110" />
   <map id="numbersign" unc="35" />   
   <map id="nine" unc="57" />
   <map id="o" unc="111" />
   <map id="one" unc="49" />
   <map id="p" unc="112" />
   <map id="parenleft" unc="40" />
   <map id="parenright" unc="41" />
   <map id="percent" unc="37" />
   <map id="period" unc="46" />
   <map id="plus" unc="43" />
   <map id="q" unc="113" />
   <map id="question" unc="63" />
   <map id="quoteleft" unc="8216" />
   <map id="quoteright" unc="8217" />
   <map id="quotesingle" unc="39" />
   <map id="r" unc="114" />
   <map id="s" unc="115" />
   <map id="semicolon" unc="59" />
   <map id="seven" unc="55" />
   <map id="six" unc="54" />
   <map id="slash" unc="47" />
   <map id="space" unc="32" />
   <map id="t" unc="116" />
   <map id="three" unc="51" />
   <map id="two" unc="50" />
   <map id="u" unc="117" />
   <map id="v" unc="118" />
   <map id="w" unc="119" />
   <map id="x" unc="120" />
   <map id="y" unc="121" />
   <map id="z" unc="122" />
   <map id="zero" unc="48" />

The End