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,8 +50,12 @@ class Letter(TransformableContainer):
Point(base_point.x + p.x + (p.y * skew / 100.0),
base_point.y + p.y, base_point.z)
for line in self.lines:
new_line = Line(get_skewed_point(line.p1),
get_skewed_point(line.p2))
skewed_p1 = get_skewed_point(line.p1)
skewed_p2 = get_skewed_point(line.p2)
# 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
......
......@@ -173,7 +173,7 @@ def import_font(filename, callback=None):
try:
parsed_font = CXFParser(infile, callback=callback)
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))
return None
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