Commit e41dcffa authored by sumpfralle's avatar sumpfralle

don't show an error window, but just a warning for a partially failed font import

ignore zero-length lines that are part of some font files (prevents problems with Polygon objects)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@852 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent add9d1eb
...@@ -50,9 +50,13 @@ class Letter(TransformableContainer): ...@@ -50,9 +50,13 @@ class Letter(TransformableContainer):
Point(base_point.x + p.x + (p.y * skew / 100.0), Point(base_point.x + p.x + (p.y * skew / 100.0),
base_point.y + p.y, base_point.z) base_point.y + p.y, base_point.z)
for line in self.lines: for line in self.lines:
new_line = Line(get_skewed_point(line.p1), skewed_p1 = get_skewed_point(line.p1)
get_skewed_point(line.p2)) skewed_p2 = get_skewed_point(line.p2)
result.append(new_line) # Some triplex fonts contain zero-length lines
# (e.g. "/" in italict.cxf). Ignore these.
if skewed_p1 != skewed_p2:
new_line = Line(skewed_p1, skewed_p2)
result.append(new_line)
return result return result
......
...@@ -173,7 +173,7 @@ def import_font(filename, callback=None): ...@@ -173,7 +173,7 @@ def import_font(filename, callback=None):
try: try:
parsed_font = CXFParser(infile, callback=callback) parsed_font = CXFParser(infile, callback=callback)
except _CXFParseError, err_msg: except _CXFParseError, err_msg:
log.error("CFXImporter: Skipped font defintion file '%s'. Reason: %s" \ log.warn("CFXImporter: Skipped font defintion file '%s'. Reason: %s." \
% (filename, err_msg)) % (filename, err_msg))
return None return None
charset = Charset(**parsed_font.meta) charset = Charset(**parsed_font.meta)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment