caryll / otfcc

Optimized OpenType builder and inspector.
Apache License 2.0
422 stars 63 forks source link

Pretty-print contours as well #30

Open RoelN opened 7 years ago

RoelN commented 7 years ago

When using --pretty it would be nice to see a newline for each contour value.

"contours": [[{"x":-16383,"y":16383,"on":true},{"x":16383,"y":16383,"on":true},{"x":16383,"y":-16383,"on":true},{"x":-16383,"y":-16383,"on":true}]]

to

"contours": [[
    {"x":-16383,"y":16383,"on":true},
    {"x":16383,"y":16383,"on":true},
    {"x":16383,"y":-16383,"on":true},
    {"x":-16383,"y":-16383,"on":true}
]]
be5invis commented 7 years ago

Hmmm. There IS an option, lies in premake5.lua, removing _CARYLL_USE_PRE_SERIALIZED WILL enable formatting contours, but it will damage the performance.

RoelN commented 7 years ago

I suppose most editors/IDEs are capable or pretty-printing JSON, or there are plugins to do that. To me it would be convenient and worth the drop in performance, as --pretty is probably used for human eyes as opposed to output meant for another script to work with, but it's a non-urgent enhancement.

be5invis commented 7 years ago

@RoelN I use jq often. It has a built-in formatter, so everything is OK.

RoelN commented 7 years ago

So are you going to leave it to and outside tool, or build it into otfcc?

be5invis commented 7 years ago

@RoelN Maybe external, though there is an option to trigger. otfcc is focused on the font part, performs serialization and optimizations.