Bitmap Fonts

This topic contains 10 replies, has 4 voices, and was last updated by  Mark Sibly 4 months, 4 weeks ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #13952

    arpie
    Participant

    IIRC Monkey 1 had built-in support for bitmap fonts (as generated by http://www.kvazars.com/littera/ or the like).  I loved it.

    Does Monkey2 have any similar support?  If not, could it be added?  Or are there any 3rd party modules that would be able to do this?

    I’m not necessarily after bitmap fonts but I am looking for a way to produce multi-coloured text with gradient fills and coloured outlines… is that realistically possible using truetype fonts?

    #13953

    Mark Sibly
    Keymaster

    No, there is no built-in support for ‘grid’ based bitmap fonts, but it wouldn’t be hard to add, it’ll put it on the todo list.

    #14010

    Mark Sibly
    Keymaster

    I have simple image based fixed width/height fonts going, is there some kind of file format for bitmap fonts I should also support?

    #14011

    Diffrenzy
    Keymaster

    My 2 cents are:

    I use https://www.bmglyph.com/

    It supports the format Beaker used in Angelfont in Monkey-X. That has nice kerning pairs, which are important to make text look pro/nice/readable. I  *think* it is one of the text variant from http://www.angelcode.com/products/bmfont/

    I much prefer the xml/text versions over a binary format.

    #14012

    Mark Sibly
    Keymaster

    Is this useful for coloful fonts? Seems to be a ttf->bitmap font convertor system…

    #14014

    Ethernaut
    Participant

    I used BmGlyph+AngelFont module in the past, and it got the job done.

    As an aside, TTF fonts + Shaders are a possible route in M2 if you want gradients and stuff like that! I mean, that’s basically what BMGlyph is doing internally before “baking” it. The main upside of using shaders in M2 would be the possibility of animating the shader, not to mention skipping one step to get the font.

    #14015

    Mark Sibly
    Keymaster

    Ooerrr, bmGlyph looks nice, shame it’s macos only. I have only been using a rather more limited windows one…

    I will try and sort out the kerning everywhere too.

    #14028

    arpie
    Participant

    I’ve only ever used the text-based .fnt format that was supported by Monkey1 (and output by the littera online tool I linked to in the first post).  Is this the same format as bmglyph? (no macos here).  It got the job done but IIRC doesn’t support kerning.  Kerning support would be great if it’s not too much work.

    One major advantage of bitmap fonts is that (unless I’ve misunderstood something, which is quite possible) most font licences allow them to be distributed (more) freely as baked bitmaps but don’t allow you to distribute the TTF/OTF file with your app.

    #14029

    Mark Sibly
    Keymaster

    Just added support for the .fnt bitmap font formats and pushed the changes to the develop branch.

    .fnt does seem to be the popular format for bitmap fonts so I’ve added this (the simple text format only) and called it ‘AngelFont’ as I believe it originated at the ‘angel code’ site? Please correct me if I’m wrong here.

    I’ve also added experimental kerning support but this probably wont work quite right in mojox just yet as it makes it trickier to split text into chunks eg: for syntax highlighting.

    Note that the bitmap loaders pick the correct shader to use based on image format. Images should either be 8 bit greyscale/alpha or 32 bit rgba.

    Here’s the new banana showing how all the font types are used. In addition, Font.Load() will pick the right loader for you from filetype extension. Except for ImageFont, ‘coz it has lots parameters:

    #14037

    arpie
    Participant

    Mark, what can I say?  Thank you!  I was expecting this to end up at the end of your probably-already-enormous-to-do list.  But you had to go and implement it immediately!  What were you thinking??  Now I have to find some time to try it out…

    #14068

    Mark Sibly
    Keymaster

    No problemo, let me know if there are any issues with the implementation. I also never actually realized how widely recognized the .fnt format is either…

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.