Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incremental packing? #6

Open
xeoshow opened this issue Jan 30, 2014 · 6 comments
Open

Incremental packing? #6

xeoshow opened this issue Jan 30, 2014 · 6 comments

Comments

@xeoshow
Copy link

xeoshow commented Jan 30, 2014

Hi,

If I have already packed some fonts, and now would like to add some other characters to this existing pack file incrementally, how to do? Thanks.

@mrgame64
Copy link

mrgame64 commented Feb 1, 2014

It's somewhat hard and not often used, I doubt it will be implemented, but I'd still wait for the repo's creator word.

@mattdesl
Copy link
Owner

mattdesl commented Feb 1, 2014

I won't have time to implement something like this, but I always accept pull requests !

Sent from my iPhone

On Feb 1, 2014, at 11:49 AM, James Game [email protected] wrote:

It's somewhat hard and not often used, I doubt it will be implemented, but I'd still wait for the repo's creator word.


Reply to this email directly or view it on GitHub.

@xeoshow
Copy link
Author

xeoshow commented Feb 2, 2014

This feature should be quite useful for Asian countries like China, Korea, Japan, etc, which have strong mobile game marketing. Please see this libgdx issue request:
libgdx/libgdx#1154

I would like to try to implement it, while could you pls give any hints where to start from? Thanks!!

@mattdesl
Copy link
Owner

mattdesl commented Feb 2, 2014

Hmm a simple solution would be to parse FNT files and a texture into individual rectangles, then re-pack them into another PixmapPacker.

Ideally the feature should be accessible through code. Maybe it could also be added in the GUI in a file menu.

Good luck ! Let me know if you run into issues.

Sent from my iPhone

On Feb 1, 2014, at 8:04 PM, xeoshow [email protected] wrote:

This feature should be quite useful for Asian countries like China, Korea, Japan, etc, which have strong mobile game marketing. Please see this libgdx issue request:
libgdx/libgdx#1154

I would like to try to implement it, while could you pls give any hints where to start from? Thanks!!


Reply to this email directly or view it on GitHub.

@xeoshow
Copy link
Author

xeoshow commented Feb 16, 2014

Hi mattdesl,

My scenario is having the TTF file as input, so only could use generateFont or generateData of FreeTypeFontGenerator class:


public FreeTypeBitmapFontData generateData (int size, String characters, boolean flip, PixmapPacker packer)

public BitmapFont generateFont (int size, String characters, boolean flip)


So how could I parse FNT files and its texture? I am stucked on this problem and need your further help. Thanks.

@mattdesl
Copy link
Owner

These rely on PixmapPacker. You need to call generateFont with only the new glyphs you need to pack, and not destroy the packer object. There is a demo of custom packing in the LibGDX test bed.

Either way it's going to be an expensive process to do it every key type, since it involves rendering from FreeType to a Pixmap, then packing the new font, then uploading the texture to the GPU.

Also, since you are looking to do this on the fly as the user types, it wouldn't really be useful to add to my offline GUI tool.

Sent from my iPhone

On Feb 16, 2014, at 10:02 AM, xeoshow [email protected] wrote:

Hi mattdesl,

My scenario is to use generateFont or generateData of FreeTypeFontGenerator class:

public FreeTypeBitmapFontData generateData (int size, String characters, boolean flip, PixmapPacker packer)

public BitmapFont generateFont (int size, String characters, boolean flip)

So how could I parse FNT files and its texture? I am stucked on this problem and need your further help. Thanks.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants