vladimirgamalyan / fontbm

BMFont compatible, cross-platform (Linux/macOS/Windows) command line bitmap font generator (FreeType2 based).
MIT License
241 stars 38 forks source link

Feature Request: Dynamic height #14

Closed 0xDC00 closed 2 years ago

0xDC00 commented 2 years ago

Automatically increase the height accordingly.

vladimirgamalyan commented 2 years ago

Do you mean output textures height? (crop unused space)

0xDC00 commented 2 years ago

I mean increase the height (instead split to new file). Crop unused space also good (but size must be power of two)

vladimirgamalyan commented 2 years ago

I added a new --texture-size argument, the list of allowed texture sizes, the first suitable size will be used for output textures. For example: --texture-size 256x256,512x512,1024x1024

0xDC00 commented 2 years ago

512x128,512x256,512x512,.. 512x* <= Can it be shortened like this? Height is calculated automatically?

vladimirgamalyan commented 2 years ago

As I understand, the texture size you need should be power of two (128, 256, 512, 1024 and so on), so you can just use the row like 512x64,512x128,512x256,512x512,512x1024

0xDC00 commented 2 years ago

You're right, 512x* <=> 512x64,... Hmm, also allow non-power-of-two too? (for save space)

vladimirgamalyan commented 2 years ago

New flags (in the last release) --texture-crop-width and --texture-crop-height crop output textures, you can use --texture-size 512x65536 (the height is set to maximum supported texture size in your hardware/software) and --texture-crop-height to get 512 width and automatic height (non-power-of-two).

vladimirgamalyan commented 2 years ago

@0xDC00 As I understand it, the goal:

automatically increase the height accordingly

can be achieved using the new flags, do you mind that this issue can be closed?

vladimirgamalyan commented 2 years ago

I have closed the issue for now, feel free to reopen it if necessary.