Changeset 197

Show
Ignore:
Timestamp:
04/14/09 08:41:04 (3 years ago)
Author:
erik
Message:

SetMaskToGlyph? now uses FLPointContourPen which ignores any components the source glyph might have. In FontLab? components do not work in the background and cause the application to suffer from premature and unexpected cessation of activities.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Lib/robofab/objects/objectsFL.py

    r175 r197  
    1111                BasePostScriptFontHintValues, postScriptHintDataLibKey, BasePostScriptGlyphHintValues 
    1212from fontTools.misc import arrayTools 
    13 from robofab.pens.flPen import FLPointPen 
     13from robofab.pens.flPen import FLPointPen, FLPointContourPen 
    1414from robofab import RoboFabError 
    1515import os 
     
    417417        wrapped = FL_RGlyph(flGlyph)    # rf wrapper for FL glyph 
    418418        if not clear: 
    419                        # copy the existing mask data first 
    420                        existingMask = getGlyphFromMask(targetGlyph) 
    421                        pen = wrapped.getPointPen()             # get a pen for the wrapper 
    422                        existingMask.drawPoints(pen) 
    423         pen = wrapped.getPointPen()            # get a pen for the wrapper 
     419                # copy the existing mask data first 
     420                existingMask = getGlyphFromMask(targetGlyph) 
     421                pen = FLPointContourPen(existingMask) 
     422                existingMask.drawPoints(pen) 
     423        pen = FLPointContourPen(wrapped) 
    424424        maskGlyph.drawPoints(pen)               # draw the data 
    425425        targetGlyph.naked().mask = wrapped .naked()