Allow setting 'raw' attrs on XML for tables to be loaded from hex
Previously one had to set the 'ERROR' attribute. Accept raw also.
So, for example one can say:
<cmap raw="1">
<!-- Hand-coded format13 table mapping all Unicode
characters to .notdef glyph. -->
<hexdata>
0000 0001 <!-- version numTables -->
0000 0006 <!-- platformID encodingID -->
0000000C <!-- offset -->
000D 0000 <!-- format reserved -->
0000001C <!-- length -->
00000000 <!-- language -->
00000001 <!-- nGroups -->
00000001 <!-- startCharCode -->
0010FFFE <!-- endCharCode -->
00000001 <!-- glyphID -->
</hexdata>
</cmap>
diff --git a/Lib/fontTools/misc/xmlReader.py b/Lib/fontTools/misc/xmlReader.py
index 581039d..85dd441 100644
--- a/Lib/fontTools/misc/xmlReader.py
+++ b/Lib/fontTools/misc/xmlReader.py
@@ -79,7 +79,7 @@
print(msg)
if tag == "GlyphOrder":
tableClass = ttLib.GlyphOrder
- elif "ERROR" in attrs:
+ elif "ERROR" in attrs or ('raw' in attrs and safeEval(attrs['raw'])):
tableClass = DefaultTable
else:
tableClass = ttLib.getTableClass(tag)