Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

xorgy
Copy link
Member

@xorgy xorgy commented Apr 4, 2021

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

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.
@xorgy
Copy link
Member Author

xorgy commented Apr 4, 2021

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.

Copy link
Member

@cmyr cmyr left a 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");
Copy link
Member

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

@chrissimpkins
Copy link
Collaborator

chrissimpkins commented Jul 23, 2021

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

@chrissimpkins
Copy link
Collaborator

#148

@cmyr
Copy link
Member

cmyr commented Aug 4, 2021

I'm going to close this. As of #148 the user can optionally specify custom whitespace.

@cmyr cmyr closed this Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabs vs. spaces
3 participants