googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
151 stars 43 forks source link

instructionCompiler: "Number of components" message should be toned down #743

Closed madig closed 1 year ago

madig commented 1 year ago

I'm getting flooded with these messages when using the flattening filter. Maybe the warning shouldn't be fired then or made a debug message.

jenskutilek commented 1 year ago

Do the UFOs have explicit composite flags? Probably the InstructionCompiler shouldn't care about the number of components changing if it the flags are set automatically.

anthrotype commented 1 year ago

it seems like InstructionCompiler currently issues that warning regardless of whether we are setting the flags automatically or not. I think we should only issue the warning when we are setting the flags manually (autoUseMyMetrics is not True)

jenskutilek commented 1 year ago

I think it's not only USE_MY_METRICS. The original components may have had other flags that cannot be set in the TTF when the number of components has changed.

anthrotype commented 1 year ago

hm but the warning is issued just before calling autoUseMyMetrics on that component... I thought it'd make sense to not issue any warning when autoUseMyMetrics=True (the default, hence most common case), but only issue when one has deliberately disabled it.. If you think the logic in #766 should be modified please send a PR, thanks!

anthrotype commented 1 year ago

I'd also be ok to just completely remove the logging message or demote it to DEBUG

jenskutilek commented 1 year ago

+1 for removing it, I'll make a PR.

jenskutilek commented 1 year ago

Thinking about it again, I came to the conclusion that a debug message makes more sense. In case anyone wonders why the flags are set differently than expected ...