-
Notifications
You must be signed in to change notification settings - Fork 13
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
Use two spaces instead of a tab per indent level. #102
Conversation
Most UFO editing/processing tools output XML with two-space indents, so Norad should do the same so that people don't need to use external xml formatting tools to merge work between tools using Norad and tools using ufoLib or FontForge.
My motivation for this change was seeing this PR eliheuer/baby-shark#3 where there is a clear disagreement between tabs and spaces causing almost every line in the font to be modified, rather than just inserting one clean line into each glif file. Two-space indents seem to be the most popular with UFO tools, despite ufonormalizer favoring tabs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm.... really not sure what to think about this.
UfoNormalizer may be in the majority, but it is still the accepted... normalizer of UFOs.
a single tab also uses 50% fewer bytes! which okay, whatever, but I was just on a call with some folks who have VF projects using UFO where they're regularly manipulating 400MB of UFO, so it ain't nothing.
So I guess currently I'm feeling the pull of inertia on this one?
@@ -106,7 +106,7 @@ fn write_lib_section<T: Write>(lib: &Plist, writer: &mut Writer<T>) -> Result<() | |||
let as_value: plist::Value = lib.to_owned().into(); | |||
let mut out_buffer = Vec::with_capacity(256); // a reasonable min size? | |||
as_value.to_writer_xml(&mut out_buffer)?; | |||
let lib_xml = String::from_utf8(out_buffer).expect("xml writer writs valid utf8"); | |||
let lib_xml = String::from_utf8(out_buffer).expect("XML writer writes valid UTF-8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
geez was I drunk or what
Here are production Noto UFO source comparisons across other commonly used UFO serializers: https://github.com/chrissimpkins/ufo-format-diff Each tool has its own branch/PR |
I'm going to close this. As of #148 the user can optionally specify custom whitespace. |
AFAIK:
Most UFO editing/processing tools output XML with two-space indents,
so Norad should do the same so that people don't need to use external
xml formatting tools to merge work between tools using Norad and tools
using defcon or FontForge.
Resolves #101