Difference between revisions of "How to Add Characters and Icons to the Font"
vanquish349 (talk | contribs) (Text formating and fixed some of my bad grammer) |
(→Adding an Icon to menus) |
||
Line 1: | Line 1: | ||
− | ==''' Adding an Icon to menus''' == | + | <nowiki>Insert non-formatted text here</nowiki>==''' Adding an Icon to menus''' == |
If you downloaded the source from github you would have a folder called font if you look in side you will see that there is packer.c, unpacker.c and editor.c, if you don't see it then you either downloaded the source code off the website powdertoy.co.uk or you deleted it somehow, if this is the case re-download it from here [https://github.com/FacialTurd/The-Powder-Toy The-Powder-Toy] | If you downloaded the source from github you would have a folder called font if you look in side you will see that there is packer.c, unpacker.c and editor.c, if you don't see it then you either downloaded the source code off the website powdertoy.co.uk or you deleted it somehow, if this is the case re-download it from here [https://github.com/FacialTurd/The-Powder-Toy The-Powder-Toy] | ||
− | '''1)''' | + | '''1)''' Copy font.h from /includes and paste it into /font. |
− | '''2)''' compile the editor | + | '''2)''' Navigate into /font, and open a terminal or command prompt here, compile the font editor tools using the following commands: |
+ | On Linux or other *NIX operating systems: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | make unpacker | ||
+ | make packer | ||
+ | make editor | ||
+ | </syntaxhighlight> | ||
− | + | On Windows: | |
− | + | <syntaxhighlight lang="bash"> | |
− | + | make unpacker.exe | |
+ | make packer.exe | ||
+ | make editor.exe | ||
+ | </syntaxhighlight> | ||
− | ''' | + | '''3)''' In the same terminal run the following command to create a font.bin file the editor can read: |
+ | On Linux or other *NIX: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | ./unpacker | ||
+ | </syntaxhighlight> | ||
− | '''5)''' | + | On Windows: |
+ | <syntaxhighlight lang="bash"> | ||
+ | unpacker.exe | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | '''5)''' Run the editor from the terminal and then use the "+" and "-" keys to go the end and find an empty character, empty characters look like thermometers, although be careful not to confuse it with the actual thermometer if it is just erase it via right clicking and left clicking in the drawing field. now draw you character and look in cmd/terminal and the last number you will see there is the char id and it corresponds to what icon you drew, on Windows, you will have to find this information in the stdout.txt file in the same directory. | ||
'''6)''' close down the editor and delete the font.h then run: | '''6)''' close down the editor and delete the font.h then run: | ||
− | + | Linux and other *NIX: | |
− | + | <syntaxhighlight lang="bash"> | |
+ | ./packer > font.h | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Windows: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | packer.exe > font.h | ||
+ | </syntaxhighlight> | ||
'''7)''' copy the new font.h into /includes replacing the old one. | '''7)''' copy the new font.h into /includes replacing the old one. | ||
'''8)''' for your new menu set the char id to what i told you to remember before. | '''8)''' for your new menu set the char id to what i told you to remember before. | ||
− | + | <syntaxhighlight lang="c"> | |
− | FF is the | + | {"\xFF", "new menu ftw", 0, 1}, |
+ | </syntaxhighlight> | ||
+ | Where FF is the new character ID. | ||
− | '''9)''' | + | '''9)''' Recompile The Powder Toy and you should be ready to go. |
Revision as of 13:01, 31 January 2012
Insert non-formatted text here== Adding an Icon to menus ==
If you downloaded the source from github you would have a folder called font if you look in side you will see that there is packer.c, unpacker.c and editor.c, if you don't see it then you either downloaded the source code off the website powdertoy.co.uk or you deleted it somehow, if this is the case re-download it from here The-Powder-Toy
1) Copy font.h from /includes and paste it into /font.
2) Navigate into /font, and open a terminal or command prompt here, compile the font editor tools using the following commands: On Linux or other *NIX operating systems:
make unpacker
make packer
make editor
On Windows:
make unpacker.exe
make packer.exe
make editor.exe
3) In the same terminal run the following command to create a font.bin file the editor can read: On Linux or other *NIX:
./unpacker
On Windows:
unpacker.exe
5) Run the editor from the terminal and then use the "+" and "-" keys to go the end and find an empty character, empty characters look like thermometers, although be careful not to confuse it with the actual thermometer if it is just erase it via right clicking and left clicking in the drawing field. now draw you character and look in cmd/terminal and the last number you will see there is the char id and it corresponds to what icon you drew, on Windows, you will have to find this information in the stdout.txt file in the same directory.
6) close down the editor and delete the font.h then run: Linux and other *NIX:
./packer > font.h
Windows:
packer.exe > font.h
7) copy the new font.h into /includes replacing the old one.
8) for your new menu set the char id to what i told you to remember before.
{"\xFF", "new menu ftw", 0, 1},
Where FF is the new character ID.
9) Recompile The Powder Toy and you should be ready to go.