-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
whitespace and empty tags #53
Comments
I believe that the whitespace preferences came from the older version of plistlib that the ufoLib used to use. However, this is the reason for the normalizer, so that the writing libs can change, but you still get meaningful diffs (see the optional use of lxml writer in UFOlib now, etc). It serves as a benchmark, not the only way to write out XML, but one that can be relied on over time to produce the same result, no matter the tool, so the whitespace and empty element preferences are set as they are. |
But how did you pick that particular preference? Wouldn’t it make sense to follow the dtd? Why deviate from several reference implementations? |
@schriftgestalt To be very clear, I did not write the code for this. My best recollection/guess is that the preference was set by how ufoLib wrote out UFOs in 2016, which is a reference standard and implementation. I don't think that there is much value is arguing about whitespace and empty elements: many folks use the normalizer in production workflows, so changing the preference now would mean a lot of noise in version control, the very thing that the normalizer is made to avoid. |
actually, ufoNormalizer uses its own XMLWriter class, ElementTree is only used for parsing. ufoNormalizer/src/ufonormalizer.py Line 1151 in ea37f45
|
@anthrotype my bad, memory failed me and I didn't double check closely enough. |
Regardless, you provided an excellent description of the main goal of the normalizer:
I'm inclined to close this issue. |
That's probably the same reason <array>
+ <string>New entry</string>
</array> … as opposed to: - <array/>
+ <array>
+ <string>New entry</string>
+ </array> |
Maybe adding a second profile that collects all the cleanup an synchronizations. So people can choose when or if they switch. |
How did you decide how the intendation and empty elements are handled.
I compared the .plist files generated by the Normalizer and what macOS (Xcode) would produce and found significantly differences. RoboFont agrees in this points with macOS.
from the Normalizer:
from Xcode
from the Normalizer:
from Xcode:
I tested this in Xcode on 10.9 and 10.13.
The text was updated successfully, but these errors were encountered: