本文整理汇总了Python中mojo.extensions.getExtensionDefault函数的典型用法代码示例。如果您正苦于以下问题:Python getExtensionDefault函数的具体用法?Python getExtensionDefault怎么用?Python getExtensionDefault使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getExtensionDefault函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, constructions, font, parentWindow):
self.font = font
self.constructions = constructions
self.w = Sheet((300, 120), parentWindow=parentWindow)
getExtensionDefault, setExtensionDefault, getExtensionDefaultColor, setExtensionDefaultColor
y = 15
self.w.overWrite = CheckBox((15, y, 200, 22), "Overwrite Existing Glyphs", value=getExtensionDefault(self.overWriteKey, True))
y += 35
self.w.markGlyphs = CheckBox((15, y, 200, 22), "Mark Glyphs", value=getExtensionDefault(self.overWriteKey, True), callback=self.markGlyphsCallback)
self.w.markGlyphColor = ColorWell((130, y-5, 50, 30), color=getExtensionDefaultColor(self.markColorKey, NSColor.redColor()))
self.w.markGlyphColor.enable(getExtensionDefault(self.overWriteKey, True))
self.w.okButton = Button((-70, -30, -15, 20), "Build", callback=self.buildCallback, sizeStyle="small")
self.w.setDefaultButton(self.w.okButton)
self.w.closeButton = Button((-140, -30, -80, 20), "Cancel", callback=self.closeCallback, sizeStyle="small")
self.w.closeButton.bind(".", ["command"])
self.w.closeButton.bind(unichr(27), [])
self.w.open()
开发者ID:br-niko,项目名称:GlyphConstruction,代码行数:25,代码来源:glyphConstructionUI.py
示例2: __init__
def __init__(self, parentWindow):
data = getExtensionDefault(self.identifier, dict())
self.w = Sheet((470, 580), parentWindow=parentWindow)
self.w.tabs = Tabs((10, 10, -10, -40), ["TTF AutoHint", "HTML Preview"])
self.w.tabs[0].settings = self.settings = TTFAutoHintGroup((0, 0, -0, -0))
self.settings.set(data)
y = 10
self.w.tabs[1].htmlText = TextBox((10, y, 100, 22), "HTML preview:")
y += 30
self.w.tabs[1].html = self.html = CodeEditor((10, y, -10, 250), getExtensionDefault("%s.htmlPreview" % settingsIdentifier, htmlPreviewDefault), lexer="html")
self.html.showLineNumbers(False)
y += 260
self.w.tabs[1].globalCssText = TextBox((10, y, 100, 22), "CSS Style:")
y += 30
self.w.tabs[1].globalCss = self.globalCss = CodeEditor((10, y, -10, -10), getExtensionDefault("%s.globalCSSPreview" % settingsIdentifier, ""), lexer="css")
self.globalCss.showLineNumbers(False)
self.w.saveButton = Button((-100, -30, -10, 20), "Save settings", callback=self.saveCallback, sizeStyle="small")
self.w.setDefaultButton(self.w.saveButton)
self.w.closeButton = Button((-190, -30, -110, 20), "Cancel", callback=self.closeCallback, sizeStyle="small")
self.w.closeButton.bind(".", ["command"])
self.w.closeButton.bind(unichr(27), [])
self.w.resetButton = Button((-280, -30, -200, 20), "Reset", callback=self.resetCallback, sizeStyle="small")
self.w.open()
开发者ID:typemytype,项目名称:batchRoboFontExtension,代码行数:29,代码来源:__init__.py
示例3: __init__
def __init__(self):
self.w = FloatingWindow((220, 240), "2 Twitter")
left = 100
y = 10
userName = getExtensionDefault("%s.%s" %(defaultKey, "userName"), "")
password = getExtensionDefault("%s.%s" %(defaultKey, "password"), "")
self.w.userNameText = TextBox((10, y, left, 22), "User name:")
self.w.userName = EditText((left, y, -10, 22), userName)
y += 30
self.w.passwordText = TextBox((10, y, left, 22), "Password:")
self.w.password = SecureEditText((left, y, -10, 22), password)
y += 30
self.w.message = TextEditor((10, y, -10, 70), callback=self._textEditorCallback)
y += 80
self._viewNames = ["Glyph View", "Space Center"]
self.w.view = RadioGroup((10, y, -10, -40), self._viewNames)
self.w.view.set(0)
self.w.okButton = Button((-70, -30, -15, 20), "Post", callback=self.okCallback, sizeStyle="small")
self.w.setDefaultButton(self.w.okButton)
self.w.closeButton = Button((-140, -30, -80, 20), "Cancel", callback=self.closeCallback, sizeStyle="small")
self.w.closeButton.bind(".", ["command"])
self.w.closeButton.bind(unichr(27), [])
self.w.open()
开发者ID:Hofstede,项目名称:RoboFontExtensions,代码行数:32,代码来源:send2twitter.py
示例4: load
def load(self):
self.onOff = getExtensionDefault(onOffKey, self._fallbackOnOff)
self.lineWidth = getExtensionDefault(lineWidthKey, self._fallbackStrokeWidth)
self.lineColor = getExtensionDefaultColor(lineColorKey, self._fallbackStrokeColor)
self.fillColor = getExtensionDefaultColor(fillColorKey, self._fallbackFillColor)
self.lineRGBA = getExtensionDefault(lineRGBA, self._fallbackStrokeRGBA)
self.fillRGBA = getExtensionDefault(fillRGBA, self._fallbackFillRGBA)
开发者ID:thomgb,项目名称:ContoursLock,代码行数:7,代码来源:contourLockData.py
示例5: __init__
def __init__(self):
addObserver(self, "_curvePreview", "draw")
addObserver(self, "_curvePreview", "drawInactive")
addObserver(self, "_currentGlyphChanged", "currentGlyphChanged")
self.methods = {
0: "fl",
4: "free",
}
self.methodNames = [
"Tension:"
]
height = 80
self.w = vanilla.FloatingWindow((300, height), "Hobby's Spline")
y = -200
self.w.hobbyMethodSelector = vanilla.RadioGroup((10, y, -10, 108),
titles = "Circle",
callback=self._changeMethod,
sizeStyle="small"
)
y = 10
self.w.HobbySlider = Slider((15, y, -15, 25),
tickMarkCount=4,
callback=self._changetension,
minValue=0.5,
maxValue=1.0,
sizeStyle="small",
continuous=True
)
y = height - 32
self.w.hobbycurveButton = vanilla.Button((60, y , -60, 25), "transform selected curves",
callback=self._hobbycurve,
sizeStyle="small",
)
self.w.hobbyMethodSelector.set(getExtensionDefault("%s.%s" %(extensionID, "method"), 0))
self.method = self.methods[self.w.hobbyMethodSelector.get()]
self._checkSecondarySelectors()
self.w.HobbySlider.set(getExtensionDefault("%s.%s" %(extensionID, "tension"), 0.5))
self.tension = self.w.HobbySlider.get()
self.tmp_glyph = RGlyph()
UpdateCurrentGlyphView()
self.setUpBaseWindowBehavior()
self.w.open()
开发者ID:davelab6,项目名称:hobbyspline,代码行数:58,代码来源:hobbyspline.py
示例6: run
def run(self, destDir, progress):
progress.update("Converting...")
paths = self.controller.get()
report = Report()
report.css = CSSWriter()
report.html = HTMLWriter(cssFileName="font.css", style=getExtensionDefault("%s.globalCSSPreview" % settingsIdentifier, ""))
report.writeTitle("Web Fonts:")
report.newLine()
saveOTF = self.save_otf.get()
saveTTF = self.save_ttf.get()
saveWOFF = self.save_woff.get()
saveWOFFFormat = self.save_woff_format.get()
saveWOFF2 = self.save_woff2.get()
saveWOFF2Format = self.save_woff2_format.get()
saveEOT = self.save_eot.get()
saveSVG = self.save_svg.get()
suffix = self.webSuffix.get()
suffix = time.strftime(suffix)
preserveTTFhints = self.preserveTTFhints.get()
progress.setTickCount(len(paths))
for path in paths:
txt = os.path.basename(path)
progress.update(txt)
report.writeTitle(os.path.basename(path), "-")
report.write("source: %s" % path)
report.newLine()
try:
self._convertPath(path, destDir=destDir, saveOTF=saveOTF, saveTTF=saveTTF, saveWOFF=saveWOFF, saveWOFFFormat=saveWOFFFormat, saveWOFF2=saveWOFF2, saveWOFF2Format=saveWOFF2Format, saveEOT=saveEOT, saveSVG=saveSVG, suffix=suffix, report=report, preserveTTFhints=preserveTTFhints)
except:
import traceback
message = traceback.format_exc()
report.write("Failed:")
report.write(message)
report.indent(0)
report.newLine()
report.newLine()
report.writeTitle("TTFAutohint options:")
autohintOptions = getExtensionDefault(settingsIdentifier, defaultOptions)
report.writeDict(autohintOptions)
reportPath = os.path.join(destDir, "WebFonts Report.txt")
report.save(reportPath)
if self.generateHTML.get():
cssPath = os.path.join(destDir, "font.css")
report.css.save(cssPath)
htmlPath = os.path.join(destDir, "preview.html")
report.html.save(htmlPath)
开发者ID:typemytype,项目名称:batchRoboFontExtension,代码行数:57,代码来源:__init__.py
示例7: __init__
def __init__(self):
self.filters = PenBallFiltersManager()
# self.filters.loadFiltersFromJSON('/'.join([LOCALPATH, JSONFILE]))
filtersList = getExtensionDefault('{0}.filtersList'.format(PENBALLWIZARD_EXTENSIONKEY), [])
self.filters.loadFiltersList(filtersList)
self.glyphNames = []
self.observedGlyphs = []
self.currentFont = CurrentFont()
self.initCachedFont()
filtersList = self.filters.keys()
if len(filtersList) > 0:
self.currentFilterName = filtersList[0]
else:
self.currentFilterName = None
self.fill = True
self.observers = [
('fontChanged', 'fontBecameCurrent'),
('fontChanged', 'fontDidOpen'),
('fontChanged', 'fontDidClose'),
]
self.displaySettingsRecord = {
1: (u'✓ Fill', True),
2: (u'Stroke', False),
3: (u'Inverse', False),
}
self.w = Window((100, 100, 800, 500), 'PenBall Wizard v{0}'.format(__version__), minSize=(500, 400))
self.w.filtersPanel = Group((0, 0, 300, -0))
self.w.filtersPanel.filtersList = List((0, 0, -0, -80), filtersList, selectionCallback=self.filterSelectionChanged, doubleClickCallback=self.filterEdit, allowsMultipleSelection=False, allowsEmptySelection=False, rowHeight=22)
self.w.filtersPanel.controls = Group((0, -80, -0, 0))
self.w.filtersPanel.addFilter = SquareButton((0, -80, 100, 40), 'Add filter', sizeStyle='small', callback=self.addFilter)
self.w.filtersPanel.addFilterChain = SquareButton((100, -80, 100, 40), 'Add operations', sizeStyle='small', callback=self.addFilterChain)
self.w.filtersPanel.removeFilter = SquareButton((-100, -80, 100, 40), 'Remove filter', sizeStyle='small', callback=self.removeFilter)
self.w.textInput = EditText((300, 0, -75, 22), '', callback=self.stringInput)
self.w.generate = SquareButton((0, -40, 300, -0), 'Generate', callback=self.buildGenerationSheet, sizeStyle='small')
self.w.displaySettings = PopUpButton(
(-70, 3, -10, 15),
self.makeDisplaySettingsMenuItems(),
sizeStyle='mini',
callback=self.changeDisplaySettings)
self.w.displaySettings.getNSPopUpButton().setPullsDown_(True)
self.w.displaySettings.getNSPopUpButton().setBordered_(False)
self.w.preview = MultiLineView((300, 22, -0, -0))
displayStates = self.w.preview.getDisplayStates()
for key in ['Show Metrics','Upside Down','Stroke','Beam','Inverse','Water Fall','Multi Line']:
displayStates[key] = False
for key in ['Fill','Single Line']:
displayStates[key] = True
self.w.preview.setDisplayStates(displayStates)
for callback, event in self.observers:
addObserver(self, callback, event)
self.updateControls()
self.w.bind('close', self.end)
self.launchWindow()
self.w.open()
开发者ID:bghryct,项目名称:Robofont-scripts,代码行数:60,代码来源:penBallWizardController.py
示例8: generate
def generate(self, saveDir):
if not saveDir:
return
saveDir = saveDir[0]
f = self.font.naked()
glyphs = [g for g in f if not g.template]
progress = ProgressWindow("Generating .png's", tickCount=len(glyphs), parentWindow=self.window)
gridSize = int(getExtensionDefault(GRID_DEFAULTS_KEY, 50))
for g in glyphs:
if g.unicode is not None:
fileName = "%04X" %g.unicode
else:
fileName = glyphNameToFileName(g.name, f)
path = os.path.join(saveDir, "%s.png" %fileName)
image = g.getRepresentation("com.typemytype.pixelImageFactory", gridSize=gridSize)
data = image.TIFFRepresentation()
imageRep = NSBitmapImageRep.imageRepWithData_(data)
pngData = imageRep.representationUsingType_properties_(NSPNGFileType, None)
pngData.writeToFile_atomically_(path, False)
progress.update()
progress.close()
开发者ID:Hofstede,项目名称:RoboFontExtensions,代码行数:28,代码来源:generateImageFont.py
示例9: _getTempTTF
def _getTempTTF(self, path, report=None, preserveTTFhints=False):
if not hasattr(self, "_tempTTFPath"):
_, ext = os.path.splitext(path)
ext = ext.lower()
self._tempTTFPath = tempfile.mkstemp(suffix=".ttf")[1]
if ext == ".otf":
report.write("Source is binary a OTF file. Convert to TTF.")
report.indent()
convertToTTF(path, self._tempTTFPath, report)
report.dedent()
elif ext == ".ttf":
report.write("Source is binary a TTF file.")
shutil.copyfile(path, self._tempTTFPath)
if not preserveTTFhints:
report.write("Auto hint the existing TTF file.")
report.indent()
tempDest = tempfile.mkstemp(suffix=".ttf")[1]
autohintOptions = getExtensionDefault(settingsIdentifier, defaultOptions)
result = TTFAutohint(self._tempTTFPath, tempDest, autohintOptions)
report.writeItems(result)
os.remove(self._tempTTFPath)
self._tempTTFPath = tempDest
report.dedent()
else:
if ext == ".ufo":
report.write("Source is a UFO file. Generate TTF.")
else:
report.write("Source is a %s file. Import the file. Generate TTF." % (ext[1:]))
report.indent()
generateTTF(path, self._tempTTFPath, report)
report.dedent()
return self._tempTTFPath
开发者ID:typemytype,项目名称:batchRoboFontExtension,代码行数:32,代码来源:__init__.py
示例10: __init__
def __init__(self, parentWindow):
data = getExtensionDefault(self.identifier, dict())
updateWithDefaultValues(data, defaultOptions)
width = 380
height = 1000
self.w = Sheet((width, height), parentWindow=parentWindow)
y = 10
self.w.threaded = CheckBox((10, y, -10, 22), "Threaded", value=data["threaded"])
y += 30
self.w.exportInFolders = CheckBox((10, y, -10, 22), "Export in Sub Folders", value=data["exportInFolders"])
y += 30
self.w.keepFileNames = CheckBox((10, y, -10, 22), "Keep file names (otherwise use familyName-styleName)", value=data["keepFileNames"])
y += 35
self.w.saveButton = Button((-100, y, -10, 20), "Save settings", callback=self.saveCallback, sizeStyle="small")
self.w.setDefaultButton(self.w.saveButton)
self.w.closeButton = Button((-190, y, -110, 20), "Cancel", callback=self.closeCallback, sizeStyle="small")
self.w.closeButton.bind(".", ["command"])
self.w.closeButton.bind(unichr(27), [])
self.w.resetButton = Button((-280, y, -200, 20), "Reset", callback=self.resetCallback, sizeStyle="small")
y += 30
self.w.resize(width, y, False)
self.w.open()
开发者ID:typemytype,项目名称:batchRoboFontExtension,代码行数:33,代码来源:toolBox.py
示例11: __init__
def __init__(self):
self.draw = False
self.swap = True
self.radius = getExtensionDefault(
"%s.%s" % (WurstSchreiberDefaultKey, "radius"), 60)
color = NSColor.colorWithCalibratedRed_green_blue_alpha_(1, 0, 0, .5)
colorValue = getExtensionDefaultColor(
"%s.%s" % (WurstSchreiberDefaultKey, "color"), color)
self.w = FloatingWindow((150, 170), "WurstSchreiber")
x = 15
y = 15
self.w.preview = CheckBox(
(x, y, -x, 20),
"Preview",
callback=self.previewChanged,
value=True)
y+=30
self.w.slider = SliderGroup(
(x, y, -x, 22), 0, 100, self.radius, callback=self.sliderChanged)
y+=35
self.w.color = ColorWell(
(x, y, -x, 40), callback=self.colorChanged, color=colorValue)
y+=55
self.w.button = Button(
(x, y, -x, 20), "Trace!", callback=self.traceButton)
addObserver(self, "drawWurst", "drawBackground")
self.w.bind("close", self.closing)
self.w.open()
开发者ID:asaumierdemers,项目名称:WurstSchreiber,代码行数:32,代码来源:WurstSchreiber.py
示例12: openWindow
def openWindow(self, sender=None):
""" Initialize the input window. """
presets = [
"case", "dnom", "fina", "hist", "init", "isol", "locl", "lnum", "medi", "numr", "onum", "ordn", "tnum",
"pcap", "salt", "sinf", "smcp", "ss01", "ss02", "ss03", "ss04", "ss05", "ss06", "ss07", "ss08",
"ss09", "ss10", "ss11", "ss12", "ss13", "ss14", "ss15", "ss16", "ss17", "ss18", "ss19", "ss20",
"subs", "sups", "swsh", "titl", "zero" ]
presetList = " ".join(presets)
registerExtensionDefaults({"nl.typologic.suffixer.presetSuffixes" : presetList})
currentPresets = getExtensionDefault("nl.typologic.suffixer.presetSuffixes").split()
self.f = CurrentFont()
if self.f is None:
print "Suffixer: No font open"
return
existingSuffixes = []
for g in self.f:
suf = self._findSuffix(g.name)
if suf != None and suf not in existingSuffixes:
existingSuffixes.append(suf)
existingSuffixes.sort()
currentSuffix = ""
if CurrentGlyph() is not None:
currentSuffix = self._findSuffix(CurrentGlyph().name)
elif self.f.selection is not None:
for gn in self.f.selection:
currentSuffix = self._findSuffix(gn)
if currentSuffix != None:
break
self.w = FloatingWindow((300, 166), "Suffixer")
p = 10
h = 20
y1, y2, y3, y4 = 15, 49, 82, 135
w1, x2 = 160, 180
self.w.labelTwo = TextBox((p, y1, w1, h), "Add suffix to glyph names:")
self.w.dotTwo = TextBox((x2, y1, 15, h), ".")
self.w.newSuffix = ComboBox((x2+p, y1, -p, h), currentPresets)
self.w.replace = CheckBox((p+2, y2, w1, h), "Replace existing suffix:", callback=self.replaceCheckCallback)
self.w.dotOne = TextBox((x2, y2, 15, h), ".")
self.w.oldSuffix = PopUpButton((x2+p, y2, -p, h), existingSuffixes)
if currentSuffix != "" and currentSuffix != None:
self.w.oldSuffix.set(existingSuffixes.index(currentSuffix))
self.w.scope = RadioGroup((p, y3, -p, h*2), ["Target selected glyphs", "Replace all in current font"], isVertical=True)
self.w.scope.set(0)
currentState = 0 if currentSuffix == "" or currentSuffix == None else 1
self.w.replace.set(currentState)
self.w.scope.enable(currentState)
self.w.submit = Button((p, y4, -p, h), "Change suffixes", callback=self.replaceSuffixes)
self.w.setDefaultButton(self.w.submit)
self.w.open()
self.w.makeKey()
开发者ID:ninastoessinger,项目名称:Suffixer,代码行数:60,代码来源:suffixer.py
示例13: get_defaults
def get_defaults(self):
otf_1 = getExtensionDefault('%s.otf_1' % self.extension_key, None)
otf_2 = getExtensionDefault('%s.otf_2' % self.extension_key, None)
folder = getExtensionDefault('%s.folder' % self.extension_key, None)
if otf_1 is not None and os.path.exists(otf_1):
self.otf_1 = otf_1
self.w.otf_1_status.set('%s' % unichr(10003))
if otf_2 is not None and os.path.exists(otf_2):
self.otf_2 = otf_2
self.w.otf_2_status.set('%s' % unichr(10003))
if folder is not None and os.path.exists(folder):
self.folder = folder
self.w.folder_status.set('%s' % unichr(10003))
开发者ID:gferreira,项目名称:compare-otfs,代码行数:17,代码来源:compare-otfs.py
示例14: __init__
def __init__(self):
self.w = Window((250, 45), "DrawBot Settings")
self.w.openPythonFilesInDrawBot = CheckBox((10, 10, -10, 22), "Open .py files directly in DrawBot.",
value=getExtensionDefault("com.drawBot.openPyFileDirectly", False),
callback=self.openPythonFilesInDrawBotCallback)
self.w.open()
开发者ID:BoldFaceFoundry,项目名称:drawBotRoboFontExtension,代码行数:8,代码来源:settings.py
示例15: openFile
def openFile(self, notification):
if getExtensionDefault("com.drawBot.openPyFileDirectly", False):
fileHandler = notification["fileHandler"]
path = notification["path"]
_, ext = os.path.splitext(path)
if ext.lower() == ".py":
DrawBotController().open(path)
fileHandler["opened"] = True
开发者ID:anthrotype,项目名称:drawBotRoboFontExtension,代码行数:8,代码来源:installDrawbot.py
示例16: _load_settings
def _load_settings(self):
for settings_key, setting in self.settings.iteritems():
self.settings[settings_key].value = getExtensionDefault(
"%s.%s" % (
self._extension_id,
settings_key
),
setting.default_value
)
开发者ID:jenskutilek,项目名称:jkRFExtensionSettings,代码行数:9,代码来源:SettingsWindow.py
示例17: becomeActive
def becomeActive(self):
"""
Boot up the dialog.
"""
self.fillColor = getExtensionDefaultColor(self.DEFAULTKEY_FILLCOLOR, self.FALLBACK_FILLCOLOR)
self.strokeColor = getExtensionDefaultColor(self.DEFAULTKEY_STROKECOLOR, self.FALLBACK_STROKECOLOR)
self.w = FloatingWindow((260, 130), "Bounding Options", minSize=(100, 100), closable=False)
self.w.viewOptions = RadioGroup((10, 10, 150, 20),
['Selection', 'Glyph'],
callback=self.selectionCallback, isVertical=False, sizeStyle="small")
self.w.viewOptions.set(getExtensionDefault(self.DEFAULTKEY_SELECTION, 0))
self.w.useItalic = CheckBox((165, 10, 100, 20), "Use Italic", value=getExtensionDefault(self.DEFAULTKEY_USEITALIC, True), sizeStyle="small", callback=self.useItalicCallback)
self.w.xLabel = TextBox((10, 40, 70, 20), "Divisions: X", sizeStyle="small")
self.w.divisionsRadioX = Slider((80, 40, 70, 20),
value=getExtensionDefault(self.DEFAULTKEY_DIVISIONSX, 1),
minValue=1,
maxValue=4,
tickMarkCount=4,
stopOnTickMarks=True,
continuous=True,
sizeStyle="small",
callback=self.divisionsXCallback)
self.w.yLabel = TextBox((160, 40, 70, 20), "Y", sizeStyle="small")
self.w.divisionsRadioY = Slider((175, 40, 70, 20),
value=getExtensionDefault(self.DEFAULTKEY_DIVISIONSY, 1),
minValue=1,
maxValue=4,
tickMarkCount=4,
stopOnTickMarks=True,
continuous=True,
sizeStyle="small",
callback=self.divisionsYCallback)
self.w.drawGuidesButton = Button((10, 100, 90, 20), 'Div Guides', callback=self.drawDivGuides, sizeStyle="small")
self.w.drawBoxGuidesButton = Button((120, 100, 90, 20), 'Box Guides', callback=self.drawBoxGuides, sizeStyle="small",)
x = 10
y = 70
self.w.showCoordinates = CheckBox((x, y, 90, 20), "Coordinates", value=getExtensionDefault(self.DEFAULTKEY_SHOWCOORDINATES, True), sizeStyle="small", callback=self.showCoordinatesCallback)
x += 90
self.w.showDimensions = CheckBox((x, y, 90, 20), "Dimensions", value=getExtensionDefault(self.DEFAULTKEY_SHOWDIMENSIONS, True), sizeStyle="small", callback=self.showDimensionsCallback)
x += 90
color = getExtensionDefaultColor(self.DEFAULTKEY_FILLCOLOR, self.FALLBACK_FILLCOLOR)
self.w.color = ColorWell((x, y, 30, 22),
color=color,
callback=self.colorCallback)
self.setUpBaseWindowBehavior()
self.w.open()
开发者ID:LauraMeseguer,项目名称:fbOpenTools,代码行数:59,代码来源:boundingTool.py
示例18: replaceSuffixes
def replaceSuffixes(self, sender):
""" Handle replacing/appending of suffixes. """
mode = "replace" if self.w.replace.get() == 1 else "append"
oldSuffix = self.w.oldSuffix.getItems()[self.w.oldSuffix.get()]
enteredSuffix = self.w.newSuffix.get()
suffixes_in = [oldSuffix, enteredSuffix]
suffixes = [] # build proper suffixes list
for s in suffixes_in:
if s is not None and len(s) > 0:
if s[0] == ".":
s = s[1:] # handle suffixes without periods
suffixes.append(s)
if mode == "replace" and suffixes[0] == suffixes[1]:
Message(u"Cannot replace a suffix with itself.\nI mean I could, but there seems to be little point :)")
elif mode == "append" and suffixes[1] == "":
Message(u"Cannot append an empty suffix.\n(Or you could just pretend I've already done it.)")
else:
scope = self.f.keys() if self.w.scope.get() == 1 else self.f.selection
if mode == "replace":
for gname in scope:
if gname.endswith(suffixes[0]):
sufLen = len(suffixes[0])
if len(suffixes[1]) > 0:
newName = gname[:-sufLen] + suffixes[1]
else:
sufLenWithPeriod = sufLen+1
newName = gname[:-sufLenWithPeriod]
self._changeGlyphname(gname, newName)
elif mode == "append":
for gname in scope:
newName = gname + "." + suffixes[1]
self._changeGlyphname(gname, newName)
self.f.autoUnicodes()
self.f.update()
# store new values as defaults
savedPresets = getExtensionDefault("nl.typologic.suffixer.presetSuffixes")
if enteredSuffix != "" and enteredSuffix not in savedPresets:
savedPresetsList = savedPresets.split()
savedPresetsList.append(enteredSuffix)
savedPresetsList.sort()
newPresets = " ".join(savedPresetsList)
setExtensionDefault("nl.typologic.suffixer.presetSuffixes", newPresets)
self.w.close()
开发者ID:ninastoessinger,项目名称:Suffixer,代码行数:51,代码来源:suffixer.py
示例19: generateTTF
def generateTTF(ufoPath, dest, report):
tempDest = tempfile.mkstemp(suffix=".ttf")[1]
font = RFont(ufoPath, document=False, showInterface=False)
font.lib[shouldAddPointsInSplineConversionLibKey] = 1
result = font.generate(path=tempDest, format="ttf", decompose=False, checkOutlines=True, autohint=False, releaseMode=True, glyphOrder=font.glyphOrder)
if not font.hasInterface():
font.close()
report.write(result)
autohintOptions = getExtensionDefault(settingsIdentifier, defaultOptions)
result = TTFAutohint(tempDest, dest, autohintOptions)
report.writeItems(result)
os.remove(tempDest)
开发者ID:typemytype,项目名称:batchRoboFontExtension,代码行数:16,代码来源:__init__.py
示例20: toggle_panels
def toggle_panels():
'''Show/hide all floating windows in the current workspace.'''
# get panels
windows = NSApp.windows()
panels = [ window for window in windows if isinstance(window, NSPanel) ]
# get state
show_panels = getExtensionDefault('com.hipertipo.showHidePanels', fallback=True)
# hide panels
if show_panels:
for panel in panels:
panel.orderOut_(None)
setExtensionDefault('com.hipertipo.showHidePanels', False)
# show panels
if show_panels is False:
for panel in panels:
if str(type(panel)) != '<objective-c class NSColorPanel at 0x7fff750fad60>':
panel.orderBack_(None)
setExtensionDefault('com.hipertipo.showHidePanels', True)
开发者ID:gferreira,项目名称:hTools2,代码行数:18,代码来源:sysutils.py
注:本文中的mojo.extensions.getExtensionDefault函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论