You are not logged in.

Dear visitor, welcome to Skin Consortium. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

SLoB

SLoB

  • "SLoB" started this thread

Posts: 4,064

Location: UK

Occupation: Designer and Software Engineer

  • Send private message

1

Tuesday, June 13th 2006, 12:10pm

Photoshop Script - Create bitmap font (works in cs 1&2)

this is a handy script i did a while back, rohan added cs2 fix, number as i use and test this with cs1

this will create a bitmap font from the list of fonts available

a little tweaking here and there may be necessary but its a damn site quicker than doing bitmap fonts by hand!!

grab it HERE

enjoy :)
p.s. full instructions are included in the header section of the javascript file, open with notepad

2

Sunday, July 9th 2006, 6:21am

Hey man, I'm having some problems with the script.

I want to create a pixel (very small) font with no antialiasing at all, and it applys antialiasing every time I run it. I'm not sure what to do in order for it to stop doing this, help?

/edit: Or, rather, I'd like it to run the script at size 8 font without resizing.

SLoB

SLoB

  • "SLoB" started this thread

Posts: 4,064

Location: UK

Occupation: Designer and Software Engineer

  • Send private message

3

Sunday, July 9th 2006, 11:27am

heh, feel free to edit the script ;)
its based off 24pixel font size so you will need to alter values if you wanted to run the script without the slider value, in some ways i cant really see any benefit going to such a small font size inside the script, the resize should be just as good a quality going down that small, i could understand it if you wanted a larger font size but it should scale down nicely
anyways as everything is based on 24 you will need to change values if wanting to run script at size 8

you can change lines
[code:1]
iFontSize=18;
to iFontSize=8;
var iSetFontSize=24; //main working fontsize, do not modify
to 8 also

if(dlg.btnPnl.numericBool.value == true) {
var docRef = app.documents.add(384, 72, 72, "Winamp Bitmap Font", NewDocumentMode.RGB, DocumentFill.TRANSPARENT); //TRANSPARENT, WHITE, BLACK
} else {
var docRef = app.documents.add(744, 72, 72, "Winamp Bitmap Font", NewDocumentMode.RGB, DocumentFill.TRANSPARENT); //TRANSPARENT, WHITE, BLACK
}

you will need to replace values 384, 72, 72 with something like
248, 24, 24 for text
128, 24, 24 numeric

in function addtextlayer
change
textProperty.antiAliasMethod = AntiAlias.SMOOTH; // Anti-alias mode (options: NONE, CRISP, SHARP, etc - same as palette)

your also going to have to change the values in createbitmapfont function so that the rows are placed accordingly

also comment out
//resize to desired font size
if(dlg.btnPnl.numericBool.value == true)
{
//numeric bitmap
activeDocument.resizeImage(16*iFontSize, 3*iFontSize);
}
else
{
//normal bitmap
activeDocument.resizeImage(31*iFontSize, 3*iFontSize);
}

and possibly (if you still want access to all layers)
activeDocument.mergeVisibleLayers();

[/code:1]

looks like too much hassle for this, if i remember rightly it does fontsize 6 to 36, which should scale without issue in cs
anyways its your time, the script saves time in creating bitmap fonts, it wasnt meant to increase the time but its editable to suit individual needs, it was a quick prototype to prove the concept but should suffice for most things

perhaps you could post 2 pngs for comparison, 1 with the original script on resize to 8
and one with the script running @ 8 once youve changed all the values/lines

4

Sunday, July 9th 2006, 11:04pm

Thanks slob for the code, will try it and see if it works. If not I'll just do it by hand. I spent about an hour sifting through the code last night and almost ripped my hair out :D

Rate this thread