TTF error

Peter Sagerson <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <[email protected]>
Hello,

I just tried instantiating a TTFont object and got this error: "psName='\xf8' contains invalid character '\xf8’”. I stepped through TTFontFile.extractInfo and found that the names dict ended up with this rather unpromising set of values:

{1: '\xf8', 2: '\xf8', 3: '\xf8', 4: 'venti-cf-medium WebFont', 6: '\xf8’}

Just to push past it, I added a hack to replace all of the ‘\xf8’ values with None and everything worked fine from there.

I don’t know anything about TrueType, so I don’t know if we can call this a malformed font or if it’s more properly considered a bug in reportlab. Either way, there may be an opportunity to be a little more robust here. For instance, using the invalid-character test to quietly ignore bogus names instead of raising an exception.

Any thoughts about the most appropriate course here?

Thanks,
Peter

_______________________________________________
reportlab-users mailing list
[email protected]
https://pairlist2.pair.net/mailman/listinfo/reportlab-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.