freetype-gl icon indicating copy to clipboard operation
freetype-gl copied to clipboard

makefont.c : "Multiple --texture parameters"

Open sasmaster opened this issue 6 years ago • 10 comments

Hi. I am trying to run makefont to generate sdf texture. My cmd arguments look like this:

--font fonts/arial.ttf --header arial.h --size 32 --texture 512 --rendermode 'sdf'

But I am getting "Multiple --texture parameters"

For some reason the code compares my texture size to the default (128.0) inside --rendermode loop and exists with this strange error. Am I missing anything in my cmd arguments?

sasmaster avatar Jun 10 '18 09:06 sasmaster

Just checked the source and I don't quite understand either. It seems you cannot have a texture size != 128 and this is quite weird.

rougier avatar Jun 12 '18 06:06 rougier

Changed by @gustafsson but no idea why. Best would be to disable the test and see if it works. If so, can you make a PR to fix the problem?

rougier avatar Jun 12 '18 06:06 rougier

Nope, not by me. But it seems @adrianbroher copied the block for parsing --texture arguments when he created the block for parsing --rendermode arguments here: https://github.com/rougier/freetype-gl/commit/75a05c4db4ea6a6db70f30d7a81d2a5626689ebf

gustafsson avatar Jun 12 '18 07:06 gustafsson

I tested without that check and it works fine. Looks like someone forgot to remove it ))

On Tue, Jun 12, 2018, 10:06 Johan [email protected] wrote:

Nope, not by me. But it seems @adrianbroher https://github.com/adrianbroher copied the block for parsing --texture arguments when he created the block for parsing --rendermode arguments here: 75a05c4 https://github.com/rougier/freetype-gl/commit/75a05c4db4ea6a6db70f30d7a81d2a5626689ebf

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rougier/freetype-gl/issues/187#issuecomment-396487683, or mute the thread https://github.com/notifications/unsubscribe-auth/AAawgDyp-FoByTZfATvpbzQAXyYGuQKhks5t72hbgaJpZM4UhpNi .

sasmaster avatar Jun 12 '18 07:06 sasmaster

@gustafsson Sorry @sasmaster an you make a PR?

rougier avatar Jun 12 '18 11:06 rougier

I will.Need to fork this project first. because currently I use your code in a completely different project

https://github.com/sasmaster/FMG

sasmaster avatar Jun 12 '18 12:06 sasmaster

Btw,I forgot to mention it, if I put the commands in this order:

--font "fonts/arial.ttf" --header "data/arial.h" --size 32 --rendermode "sdf" --texture 512

So that --texture is put last, then the cmd passes ok.

Anyway,I guess that chunk should be removed from the second place.

sasmaster avatar Jun 12 '18 12:06 sasmaster

Nice project indeed

rougier avatar Jun 12 '18 13:06 rougier

--texture must come after --rendermode because for some reason when --rendermode is passed there is a check that demads texture size to be 128

ghost avatar Jul 11 '18 15:07 ghost

Fixed this here in this PR along with a few other improvements: https://github.com/rougier/freetype-gl/pull/213

einsteinx2 avatar Aug 23 '19 18:08 einsteinx2