Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (804)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (867)
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 4185 times)
0 Members and 1 Guest are viewing this topic.
Offline davedes
« Posted 2013-07-27 21:43:45 »

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.

    • 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: 167
    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  

    Riven (463 views)
    2019-09-04 15:33:17

    hadezbladez (5323 views)
    2018-11-16 13:46:03

    hadezbladez (2249 views)
    2018-11-16 13:41:33

    hadezbladez (5599 views)
    2018-11-16 13:35:35

    hadezbladez (1164 views)
    2018-11-16 13:32:03

    EgonOlsen (4600 views)
    2018-06-10 19:43:48

    EgonOlsen (5474 views)
    2018-06-10 19:43:44

    EgonOlsen (3138 views)
    2018-06-10 19:43:20

    DesertCoockie (4033 views)
    2018-05-13 18:23:11

    nelsongames (4782 views)
    2018-04-24 18:15:36
    A NON-ideal modular configuration for Eclipse with JavaFX
    by philfrei
    2019-12-19 19:35:12

    Java Gaming Resources
    by philfrei
    2019-05-14 16:15:13

    Deployment and Packaging
    by philfrei
    2019-05-08 15:15:36

    Deployment and Packaging
    by philfrei
    2019-05-08 15:13:34

    Deployment and Packaging
    by philfrei
    2019-02-17 20:25:53

    Deployment and Packaging
    by mudlee
    2018-08-22 18:09:50

    Java Gaming Resources
    by gouessej
    2018-08-22 08:19:41

    Deployment and Packaging
    by gouessej
    2018-08-22 08:04:08 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‑
    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!