ps-script create winamp bitmap font (wip)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • SLoB
    Major Dude
    • Jul 2003
    • 1316

    ps-script create winamp bitmap font (wip)

    here's a crude photoshop script (CS tested only) to create a bitmap font, its still wip but is working enough for you guys to have a play with it
    has slider to select font, also colour and rotation value
    suggest merging text layers and boshing a style on that layer when yer happy with the layout

    but at least this takes out most of the work in creating a bitmap font



    thers a readme bit at the top of the script
    its not 100% there yet and is a prototype script atm

    put in presets/scripts folder and call from the scripts menu
    it cycles through each letter and adds a layer per character so they can be adjusted if need be

    its based on 18pt font atm, i tend to create one font such as an 18pt and then scale it up/down to suit further options of reducing text size from a menu sort of thing, all you need to do is to scale it down by a factor of 31, 3 by fontsize
    ie default image size is 558*54 = 31*18 by 3*18

    no doubt i'll be tweaking this more, its not perfect by any means but its a start
    L8r
    SLoB

    Web Design | Web Design Hampshire | Web Development Hampshire
  • QuadHeliX
    Major Dude
    • Jan 2003
    • 1133

    #2
    great Idea!! I will test this!

    edit: just did, works great! how do you get it on a transparent layer?

    SkinConsortium.com Join us in making these skins, Artist and coders wanted!

    Comment

    • SLoB
      Major Dude
      • Jul 2003
      • 1316

      #3
      Cheers Quad

      it should create layer1 with a white fill, in the code just find the line where it says DocumentFill and replace white with transparent, transparent is commented out on the end of the line
      i tried it both ways, the white is there to see the letters being added(of course except if you choose white as the font colour )
      not sure if the colour option is needed, it will take out a step too, i normally merge visible layers (thats also in the script but commented out) and then apply a style across the whole layer

      it still needs some tweaking, for example on some fonts the horizontal spacing is fubard due to the height of the font occupying the width of the character, so some reshaping of the font will need to be added to cope with this
      also might add variable size font creation, altho as i said its quicker to create one font and scale the image down accordingly
      also looking at the modern skin it has some foreign chars on the bottom line which PS didnt like to process

      its a start tho
      L8r
      SLoB

      Web Design | Web Design Hampshire | Web Development Hampshire

      Comment

      • hammerhead
        The Shark
        (Forum King)
        • Jul 2002
        • 2537

        #4
        this'll be useful

        i'll give it a spin
        .:SharkWork::Deviantart::Breed:.

        Comment

        • SLoB
          Major Dude
          • Jul 2003
          • 1316

          #5
          cool hh
          it certainly takes the donkey work out of creating them and gives enough control afterwards
          not had time to tweak the output yet but will in the next few weeks
          90 odd views and only a few replies, thought this would be well handy for winamp skinners even as is, it probably works on cs2 with no modification as its only a few simple steps

          need to resize the width of text when rotating -90/90 degrees for those vertical songticker workaround but that wont take long to sort out
          will probably remove colour option in next version as that can be done on the final layer style, the rotation idea is the main thing and trying to sort out the odd alignment issue on some fonts, once thats sorted an option to merge visible layers(with transparent bg as layer1) and ya got 1 layer all sorted with a font to add fx too

          generally its not far off the mark
          L8r
          SLoB

          Web Design | Web Design Hampshire | Web Development Hampshire

          Comment

          • SLoB
            Major Dude
            • Jul 2003
            • 1316

            #6
            sorted the alignment now (needs more testing but looks good so far ), so expect the next version to bosh out a range of font sizes
            that was the limiting factor, get the alignment right and we can output a range of font sizes right out the bag

            will go for font sizes between approx 6pt to 28 pt which seem bout the right amount of options for most skins, any other sizes than that and you can scale the final image to suit

            next thing to work on rotation, reduce width of font approx percent size to fit within the confines of the character width when rotated 90/-90 degrees, so vertical reading from top to bottom & vice versa looks ok

            all going well this script should create the bitmap font and leave you with 1 layer with which to add layer fx and the bitmap is done should require minimal tweaking to output
            L8r
            SLoB

            Web Design | Web Design Hampshire | Web Development Hampshire

            Comment

            • rohan_pwln
              Major Dude
              • Aug 2002
              • 736

              #7
              Well, I was tweaking your script a bit and here are two things I have come up with:

              1. In Photoshop CS2 (which i am using), when the rotation is 0, the script gives an error while making the second or first layer and quits abnormally. I've fixed it.

              2. Now, there is another option in the dialog box, throgh which you can create a bitmap font meant for numeric values only.

              That's all...

              P.S: hey, SLoB, I hope u don't mind me tinkering with ur script...
              Attached Files
              My MAKI contribs.: STONE
              My WebSite My Blog My Skins: fnk 32 Rioport v1 Sienna Burning Steel
              My Saying: Eat healthy, Stay fit... Die Anyway

              Comment

              • SLoB
                Major Dude
                • Jul 2003
                • 1316

                #8
                nps rohan ,
                there is no validation in the script, it was a prototype script, didnt have time for validation as i was just trying things out, it was merely to get the idea across too but I will be sorting out a final script which should do the whole thing, dont get the error with zero on rotation tho in cs so will make sure the final version supports cs2 also with your help

                the final version will have validation, might even have sliders with default values so there will be no user input to validate

                I've now got the font to auto align regardless of font, now i need to reduce the width of the font (by percentage) when rotated 90 degs so that they dont overlap
                the dialog will be rebuilt into a function

                i think the 3 main things to choose will be
                1.font
                2.font size (probably between 6pt & 28pt)
                3.rotation 0->359 degrees either way
                4.document fill (i.e. 1st layer white or transparent or black)
                i dont think we need any more options, other than maybe to merge visible layers (except background layer1 ) once the script has done its thing

                the thing i like about having a white background on layer 1 is you can see the layer style better when you add fx to the upper layer, then switch off that layer and save as png

                cool that u got cs2, perhaps u can be bugfixer on it for cs2
                L8r
                SLoB

                Web Design | Web Design Hampshire | Web Development Hampshire

                Comment

                • rohan_pwln
                  Major Dude
                  • Aug 2002
                  • 736

                  #9
                  BTW, SLoB, I have already fixed the bug in CS2 which I have mentioned. Did u see the numeric font generator too? I don't whether it works in CS or not...
                  My MAKI contribs.: STONE
                  My WebSite My Blog My Skins: fnk 32 Rioport v1 Sienna Burning Steel
                  My Saying: Eat healthy, Stay fit... Die Anyway

                  Comment

                  • SLoB
                    Major Dude
                    • Jul 2003
                    • 1316

                    #10
                    yea saw it, a cool addition!
                    i see no reason why it shouldnt work, when i recode it i'll add that back in

                    i was thinking about the font size idea with scaling, rather than go the calculated route i was also toying with the idea of scaling the image at the end which would also work quite well
                    the idea of scaling the image at the end to produce a specific font size minimises any scaling issues & reduces code needed, so could base it on 28pt font size to begin with which is a fairly large font size and then just scale the image to suit, this would be the quicker workaround and save any hassle

                    the script would create the 28pt font, merge visible layers and then rescale to suit the font size required, a lot neater solution i think

                    it will certainly cut down the amount of time needed to create bitmap fonts for either numerical or normal and also makes bitmap fonts creation accessible to everyone (well those that use ps )
                    L8r
                    SLoB

                    Web Design | Web Design Hampshire | Web Development Hampshire

                    Comment

                    • rohan_pwln
                      Major Dude
                      • Aug 2002
                      • 736

                      #11
                      Not necessarily, for those who use PS. I am making a script-fu for use in GIMP...
                      My MAKI contribs.: STONE
                      My WebSite My Blog My Skins: fnk 32 Rioport v1 Sienna Burning Steel
                      My Saying: Eat healthy, Stay fit... Die Anyway

                      Comment

                      • SLoB
                        Major Dude
                        • Jul 2003
                        • 1316

                        #12
                        cool
                        L8r
                        SLoB

                        Web Design | Web Design Hampshire | Web Development Hampshire

                        Comment

                        • skryingbreath
                          Post initializing...
                          • Sep 2005
                          • 3065

                          #13
                          This probably wont work with PS7 right? :-\ yar...
                          Ahh well. thanks for putting in the effort slob

                          Comment

                          • hammerhead
                            The Shark
                            (Forum King)
                            • Jul 2002
                            • 2537

                            #14
                            Seems to work great, my only problem is that my font got cut off slightly, attaching an example

                            Also another idea would be to pop up a form containing a textbox, and this could be filled with the XML for the font definition.

                            -hammerhead
                            Attached Files
                            .:SharkWork::Deviantart::Breed:.

                            Comment

                            • SLoB
                              Major Dude
                              • Jul 2003
                              • 1316

                              #15
                              check this version guys, updated to auto align any font, changed text layer to use paragraph and justification which allows for proper alignment and no cutoff

                              points to note:
                              1.creates bitmapfont or numeric font(thnks Rohan)
                              2.has font choice
                              3.has font size 6pt to 36 pt (should cater for most skins), resizes image at end

                              still needs some work on rotational text but its getting there, negative rotation is not implemented in this script, will be in next




                              this version resizes image to desired font size at the end of the script, the working fontsize is 24, you can see it center aligning itself within the 3 squares as each character is added, depending on the fontsize chosen (6pt to 36pt for the now)

                              this is saving so much time to create a bitmap font, you can bosh out a good looking font in less than a minute

                              skryingbreath - dont have ps7 anymore, you could try it, i dont mind making it work with ps7 if you want to do some bugtesting on it?

                              hammerhead - yea good idea, altho for the now i just want to get this up and running and yer pretty much at a given with characters to put in for the now

                              done in less than 2 minutes


                              couple of minutes, rotational text needs a little more work on alignment, need to test with more fonts for non overlap too


                              enjoy
                              L8r
                              SLoB

                              Web Design | Web Design Hampshire | Web Development Hampshire

                              Comment

                              Working...
                              X