This is a spritefont plugin I roughly wrote up for a project my company is working on and now it is working as needed so I would like to share it and if anyone has any comment on the coding that I can improve on could feel free to let me know and I can improve it (Especially the rendering part).
Here is the sample dropbox.com/s/ki4gz37nl5s7mx3/spritefont.capx.
Here is the plugin dropbox.com/s/2i7tjhxf5g59a7a/EPICreationZ_Spritefont.zip
Preparation of image:
To start, you have to export the fonts with mono spacing as shown in the capx, sprite object "FontSheet".
Afterwhich, create the spritefont plugin "EPICreationZ_Spritefont".
In the "EPICreationZ_Spritefont" image editor, import as spritesheet. Find the fontsheet you have exported earlier and load into the editor.
Delete all the empty frames.
Go to the 1st frame (Which normally will be alphabet "A") and set the origin imagepoint to the base of the letter (Not the base of the image box).
Apply the origin imagepoint to all animation frames.
Crop all animation frame.
*For spacing, create a new frame and set the width to the spacing width you want.
**Origin imagepoint X is not taken into account for calculation of placement.
***Only the 1st animation will be used. So even if you create another animation, it will not be loaded.
Plugin properties:
Text: The text to show.
Character set: The characters as in the animation frames. (If any of the frames is missing, it will cause error.)
Scale: The size of the characters.
Word wrap: Wrapping of words by word or character.
Line height: The height in pixels of each line. (Normally if the origin imagepoint is set to the base, I would set line height to the height of alphabet "A")
Vertical Spacing: The amount of space in pixel in between the lines.
Horizontal Spacing: The amount of space in pixel between the characters.
Horizontal Alignment: Horizontal align to Left,Center or Right.
Vertical Alignment: Vertical align to Top or Center.
*Color: Ignore this properties, leave it as White. (Used as a quick fix for my company project)
Linear Sampling: Linear or point sampling.
Hotspot: The origin of the font box.
Debug: To show a red box if set to true.