Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (601)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  gdx-fontpack - Yet Another Font Packer  (Read 1298 times)
0 Members and 1 Guest are viewing this topic.
Offline davedes
« Posted 2013-07-27 21:43:45 »



https://github.com/mattdesl/gdx-fontpack

I felt there wasn't a wide selection of robust and open-source bitmap font tools for OSX and Linux, so I decided to write my own. It uses FreeType (through Gdx-Freetype) under the hood, and has a few extra features to boot:

  • Packing multiple fonts and sizes into a single texture atlas
  • Outer glow and drop shadow
  • OpenGL testing view
  • Export as plain-text or XML (for other frameworks, like Pixi.js)

    You can also use the codebase or command-line tool for some other features, like per-font settings. See the test here for example.

    TODO:
    • More effects, like outline and gradients
    • Supersampling
    • JSON file and "FontMap" utility for LibGDX games
    • Distance field generation
    • ... other ideas?

    Offline Nate

    « JGO Bitwise Duke »


    Medals: 158
    Projects: 4
    Exp: 14 years


    Esoteric Software


    « Reply #1 - Posted 2013-07-27 23:52:52 »

    Cool! It looks nice.

    Padding is extra pixels around glyphs for effects? What is spacing? Seems to do the same, so I think you only need padding.

    What about x-advance and y-advance adjustment? Often you set the padding to make glyphs bigger so you can have effects, then set the advance to the inverse of the padding, so the padding doesn't affect the distance between glyphs when text is drawn. Sometimes you need a pixel or two extra in the advance so effects don't overlap neighboring glyphs.

    It uses the guillotine (aka black pawn) packing algorithm? I wonder the difference between TexturePacker2's maxrects+brute force algorithm. TexturePacker2 can also compute the smallest size image that fits all regions, even for non-POT.

    Does it have kerning?

    C:\windows\fonts doesn't show any fonts in the FileDialog, I guess because it isn't a real directory. A list of system fonts would be nice. For Sun VMs you can get the font file with some reflection (see Hiero or my recent JGO post about it). Maybe you could only show the system fonts if the reflection hack succeeds.

    Test fonts screen is nice. Could scroll. Cheesy

    People might want to have multiple fonts with different size for each. Oh, I see you have a Java API for this, nice!

    Offline davedes
    « Reply #2 - Posted 2013-07-28 00:14:50 »

    Thanks for the suggestions. Smiley

    I will probably remove Spacing since it does the same as padding. (They are a bit different in the API.)

    I will look into advance; shouldn't be too tricky to implement.

    It uses PixmapPacker (so black pawn) since that's what FreeTypeFontGenerator uses. Using TexturePacker2 would be a bit more involved but I could add that as a future TODO. It would be nice to auto-trim the pages to the correct size.

    The output FNT file includes kerning.

    Thanks for testing on Windows. I will fix the path bug shortly. A list of fonts would indeed be nice.

    In future I hope to have a "settings override" button for each font; this way you can select one font and give it a certain size or setting.

    Games published by our own members! Check 'em out!
    Legends of Yore - The Casual Retro Roguelike
    Offline Cero
    « Reply #3 - Posted 2013-07-28 00:44:31 »

    I'm using BMFont primarily.
    I would be in the market for a new tool since BMFont is a little non-intuitive and strange, but it has the most features.

    Pages: [1]
      ignore  |  Print  
     
     
    You cannot reply to this message, because it is very, very old.

     

    Add your game by posting it in the WIP section,
    or publish it in Showcase.

    The first screenshot will be displayed as a thumbnail.

    rwatson462 (30 views)
    2014-12-15 09:26:44

    Mr.CodeIt (20 views)
    2014-12-14 19:50:38

    BurntPizza (42 views)
    2014-12-09 22:41:13

    BurntPizza (76 views)
    2014-12-08 04:46:31

    JscottyBieshaar (37 views)
    2014-12-05 12:39:02

    SHC (50 views)
    2014-12-03 16:27:13

    CopyableCougar4 (48 views)
    2014-11-29 21:32:03

    toopeicgaming1999 (114 views)
    2014-11-26 15:22:04

    toopeicgaming1999 (102 views)
    2014-11-26 15:20:36

    toopeicgaming1999 (30 views)
    2014-11-26 15:20:08
    Resources for WIP games
    by kpars
    2014-12-18 10:26:14

    Understanding relations between setOrigin, setScale and setPosition in libGdx
    by mbabuskov
    2014-10-09 22:35:00

    Definite guide to supporting multiple device resolutions on Android (2014)
    by mbabuskov
    2014-10-02 22:36:02

    List of Learning Resources
    by Longor1996
    2014-08-16 10:40:00

    List of Learning Resources
    by SilverTiger
    2014-08-05 19:33:27

    Resources for WIP games
    by CogWheelz
    2014-08-01 16:20:17

    Resources for WIP games
    by CogWheelz
    2014-08-01 16:19:50

    List of Learning Resources
    by SilverTiger
    2014-07-31 16:29:50
    java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
    Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!