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

glyph/contents.plist is not normalised #5

Closed anthrotype closed 9 years ago

anthrotype commented 9 years ago

Hello, thanks for making this available!

I tried the normalisation tool on some test UFOs.

I noticed that the contents.plist file inside UFO2 glyphs layer directory is not being normalised, unlike with the other plist files, despite being updated with new glyph to file name mappings.

The function subpathWritePlist is called to update the layer directory's contents.plist file; this uses the built-in plistlib module in order to write the input data. However, no normalisation is then applied to the generated contents.plist file.

I would expect the _normalizePlistFile function to be run on the file, like it happens with the other plist files in the UFO.

For example, when plistlib writes a file, the DOCTYPE declaration no longer contains the string "Apple Computer", but just "Apple" -- this may be correct nowadays, though it is inconsistent with the rest of the normalised plist files in the UFO which all bear "Apple Computer".

Here is my contents.plist before and after running ufonormalizer:

 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">

Cheers,

Cosimo

typesupply commented 9 years ago

Thanks! I just pushed a change that should fix this. Please let me know if it doesn't.

anthrotype commented 9 years ago

Thank you!