unified-font-object / ufoNormalizer

A tool that will normalize the XML and other data inside of a UFO.
Other
51 stars 19 forks source link

Normalize horizontal and vertical guidelines #66

Closed madig closed 4 years ago

madig commented 4 years ago

If the guideline angle is zero, the guideline is horizontal and it should be enough to keep just the y parameter. If the angle is 90 or 270, it is vertical and it's enough to keep just the x parameter.

anthrotype commented 4 years ago

/cc @typesupply @benkiel @miguelsousa

typesupply commented 4 years ago

Looks good to me.

colinmford commented 4 years ago

Hi, why is this necessary? Isn't it better for all the values to be explicit in the UFO, instead of removing information?

This merge normalizes this:

<guideline x="270" y="506" angle="0"/>

into this

<guideline y="506"/>

I would not say that the x or angle is superfluous. I think the normalizer should do the opposite... if x or angle are missing, it should add them.

benkiel commented 4 years ago

Agree, please revert @madig

anthrotype commented 4 years ago

Angle 0 means that guideline is parallel to the X axis. What does x="270" even mean?

anthrotype commented 4 years ago

Anyway feel free to revert, I don't use the tool myself.

justvanrossum commented 4 years ago

Angle 0 means that guideline is parallel to the X axis. What does x="270" even mean?

It means that if the user decides to rotate the guideline, there is a center for rotation available, at the place where the user originally placed the guideline. It makes sense to keep both coordinates (and therefore the angle) from a UI standpoint.

anthrotype commented 4 years ago

Makes sense now, thanks for the clarification

belluzj commented 4 years ago

@justvanrossum Ok, I get that we can't remove the x value even if the guideline is horizontal, but can we add it if it's missing, as @colinmford suggests? Would x=0 be an OK default value?

Or do you mean that there's an intentional difference in the UI between an horizontal guideline with an x coordinate and one without?

justvanrossum commented 4 years ago

I don't know, really. But if you add x or y, sure, 0 would be good. (I'm not an active user of the normalizer, either)

benkiel commented 4 years ago

I’m considering a change to the ufo spec to make x, y, and angle all required. It’s verbose but explicit

On Apr 17, 2020, at 11:02 AM, Just van Rossum notifications@github.com wrote:

 I don't know, really. But if you add x or y, sure, 0 would be good. (I'm not an active user of the normalizer, either)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

madig commented 4 years ago

It would also simplify validation, although you'd have to add an upgrade path so it would be more code net...

benkiel commented 4 years ago

@madig I think it may be worth it. This has popped up in other spots (fontParts?) before, and it's worth the extra verbosity to make things explicit.