def __init__(self):
        self.w = vanilla.FloatingWindow((300, 60), "Fill up Masters")

        self.w.text_1 = vanilla.TextBox((15, 12 + 2, 120, 14),
                                        "Copy paths from",
                                        sizeStyle='small')
        self.w.master_from = vanilla.PopUpButton(
            (120, 12, 80, 17),
            self.GetMasterNames(),
            sizeStyle='small',
            callback=self.MasterChangeCallback)

        self.w.text_2 = vanilla.TextBox((15, 32 + 2, 120, 14),
                                        "into selection of",
                                        sizeStyle='small')
        self.w.master_into = vanilla.PopUpButton(
            (120, 32, 80, 17),
            self.GetMasterNames(),
            sizeStyle='small',
            callback=self.MasterChangeCallback)
        #self.w.anchor_value.bind( "+", self.ValuePlus1 )

        self.w.copybutton = vanilla.Button((-80, 32, -15, 17),
                                           "Copy",
                                           sizeStyle='small',
                                           callback=self.buttonCallback)
        self.w.setDefaultButton(self.w.copybutton)

        self.w.open()
        self.w.master_into.set(1)
예제 #2
0
    def __init__(self):
        self.w = vanilla.FloatingWindow((400, 70), "Steal Metrics Keys")

        self.w.text_anchor = vanilla.TextBox((15, 12 + 2, 130, 14),
                                             "Copy keys from:",
                                             sizeStyle='small')
        self.w.from_font = vanilla.PopUpButton(
            (150, 12, 150, 17),
            self.GetFonts(isSourceFont=True),
            sizeStyle='small',
            callback=self.buttonCheck)

        self.w.text_value = vanilla.TextBox((15, 12 + 2 + 25, 130, 14),
                                            "To selected glyphs in:",
                                            sizeStyle='small')
        self.w.to_font = vanilla.PopUpButton((150, 12 + 25, 150, 17),
                                             self.GetFonts(isSourceFont=False),
                                             sizeStyle='small',
                                             callback=self.buttonCheck)

        self.w.copybutton = vanilla.Button((-80, 12 + 25, -15, 17),
                                           "Copy",
                                           sizeStyle='small',
                                           callback=self.copyKeys)
        self.w.setDefaultButton(self.w.copybutton)

        self.w.open()
        self.buttonCheck(None)
예제 #3
0
	def __init__( self ):
		self.listOfMasters = []
		self.updateListOfMasters() 
		
		self.w = vanilla.FloatingWindow( (400, windowHeight), "Steal sidebearings", minSize=(350, windowHeight), maxSize=(650, windowHeight), autosaveName="com.mekkablue.MetricsCopy.mainwindow" )
		
		self.w.text_anchor = vanilla.TextBox( (15, 12+2, 130, 17), "Copy metrics from:", sizeStyle='small')
		self.w.from_font = vanilla.PopUpButton( (150, 12, -15, 17), self.listOfMasterNames(), sizeStyle='small', callback=self.buttonCheck)
		
		self.w.text_value = vanilla.TextBox( (15, 12+2+25, 130, 17), "To selected glyphs in:", sizeStyle='small')
		self.w.to_font = vanilla.PopUpButton( (150, 12+25, -15, 17), self.listOfMasterNames()[::-1], sizeStyle='small', callback=self.buttonCheck)
		
		self.w.lsb   = vanilla.CheckBox( ( 17, 12+50, 80, 20), "LSB", value=True, callback=self.buttonCheck, sizeStyle='small' )
		self.w.rsb   = vanilla.CheckBox( (97, 12+50, 80, 20), "RSB", value=True, callback=self.buttonCheck, sizeStyle='small' )
		self.w.width = vanilla.CheckBox( (177, 12+50, 80, 20), "Width", value=False, callback=self.buttonCheck, sizeStyle='small' )
		
		self.w.ignoreSuffixes  = vanilla.CheckBox( (15+2, 12+75, -15, 20), "Ignore dotsuffix:", value=False, sizeStyle='small', callback=self.buttonCheck )
		self.w.suffixToBeIgnored = vanilla.EditText( (150, 12+75, -15, 20), ".alt", sizeStyle = 'small')

		self.w.keepWindowOpen  = vanilla.CheckBox( (15+2, 12+100, -15, 20), "Keep this window open", value=False, sizeStyle='small' )
		
		self.w.copybutton = vanilla.Button((-80, -32, -15, 17), "Copy", sizeStyle='small', callback=self.copyMetrics)
		self.w.setDefaultButton( self.w.copybutton )
		
		if not self.LoadPreferences( ):
			self.outputError( "Could not load preferences at startup. Will resort to defaults." )
		
		self.w.open()
		self.w.makeKey()
		
		self.buttonCheck( None )
예제 #4
0
	def __init__( self ):
		self.w = vanilla.FloatingWindow( (330, 170), "Anchor Mover 2.0", minSize=(300,170), maxSize=(1000,170), autosaveName="com.mekkablue.AnchorMover2.mainwindow" )

		self.w.text_1 = vanilla.TextBox((15-1, 12+2, 75, 14), "Move anchor", sizeStyle='small' )
		self.w.anchor_name = vanilla.PopUpButton((15+75, 12, -110-15-25, 17), self.GetAnchorNames(), sizeStyle='small' )
		self.w.button = vanilla.SquareButton((-110-15-20, 12, -110-15, 18), u"↺", sizeStyle='small', callback=self.SetAnchorNames )
		self.w.text_2 = vanilla.TextBox((-105-15, 12+2, -15, 14), "in selected glyphs:", sizeStyle='small' )
		
		self.w.hLine_1 = vanilla.HorizontalLine((15, 40, -15, 1))
		self.w.hText_1 = vanilla.TextBox((15-2, 40+12, 20, 14), u"↔", sizeStyle='regular' )
		self.w.hText_2 = vanilla.TextBox((15+20, 40+12+2, 20, 14), "to", sizeStyle='small' )
		self.w.hTarget = vanilla.PopUpButton((15+40, 40+12, -50-15-15-15, 17), [x[0] for x in listHorizontal], sizeStyle='small', callback=self.SavePreferences )
		self.w.hText_3 = vanilla.TextBox((-60-15-15, 40+12+2, -50-15, 14), "+", sizeStyle='small' )
		self.w.hChange = vanilla.EditText((-60-15, 40+12, -15, 19), "0.0", sizeStyle='small', callback=self.SavePreferences )
		
		self.w.vText_1 = vanilla.TextBox((15, 70+12, 20, 14), u"↕", sizeStyle='regular' )
		self.w.vText_2 = vanilla.TextBox((15+20, 70+12+2, 20, 14), "to", sizeStyle='small' )
		self.w.vTarget = vanilla.PopUpButton((15+40, 70+12, -50-15-15-15, 17), [y[0] for y in listVertical], sizeStyle='small', callback=self.SavePreferences )
		self.w.vText_3 = vanilla.TextBox((-60-15-15, 70+12+2, -50-15, 14), "+", sizeStyle='small' )
		self.w.vChange = vanilla.EditText((-60-15, 70+12, -15, 19), "0.0", sizeStyle='small', callback=self.SavePreferences )
		
		self.w.italic  = vanilla.CheckBox((15, 110, -15, 18), "Respect italic angle", value=True, sizeStyle='small', callback=self.SavePreferences )
		
		self.w.moveButton = vanilla.Button((-80-15, -20-15, -15, -15), "Move", sizeStyle='regular', callback=self.MoveCallback )
		self.w.setDefaultButton( self.w.moveButton )

		if not self.LoadPreferences( ):
			print "Error: Could not load preferences. Will resort to defaults."

		self.w.open()
예제 #5
0
	def __init__( self ):
		# Window 'self.w':
		windowWidth  = 400
		windowHeight = 110
		windowWidthResize  = 300 # user can resize width by this value
		windowHeightResize = 0   # user can resize height by this value
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"Copy glyphs into backup layers", # window title
			minSize = ( windowWidth, windowHeight ), # minimum size (for resizing)
			maxSize = ( windowWidth + windowWidthResize, windowHeight + windowHeightResize ), # maximum size (for resizing)
			autosaveName = "com.mekkablue.CopyGlyphsIntoBackupLayers.mainwindow" # stores last window position and size
		)
		
		# UI elements:
		self.w.from_text = vanilla.TextBox((15, 12+2, 130, 14), "Backup layers from:", sizeStyle='small')
		self.w.from_font = vanilla.PopUpButton((150, 12, -15, 17), self.GetFonts(isSourceFont=True), sizeStyle='small', callback=self.buttonCheck)
		
		self.w.to_text = vanilla.TextBox((15, 12+2+25, 130, 14), "Into selected glyphs in:", sizeStyle='small')
		self.w.to_font = vanilla.PopUpButton((150, 12+25, -15, 17), self.GetFonts(isSourceFont=False), sizeStyle='small', callback=self.buttonCheck)
		
		self.w.suffix_text = vanilla.TextBox((15, 12+50, 130, 14), "Layer name suffix:", sizeStyle='small')
		self.w.suffix = vanilla.EditText( (150, 12+50, -90, 15+3), "Backup", sizeStyle = 'small')
		
		# Run Button:
		self.w.copybutton = vanilla.Button((-80, 12+50, -15, 17), "Copy", sizeStyle='small', callback=self.CopyGlyphsIntoBackupLayersMain)
		self.w.setDefaultButton( self.w.copybutton )
		
		# Load Settings:
		if not self.LoadPreferences():
			print("Note: 'Copy glyphs into backup layers' could not load preferences. Will resort to defaults")
		
		# Open window and focus on it:
		self.w.open()
		self.w.makeKey()
예제 #6
0
	def __init__( self ):
		# Window 'self.w':
		windowWidth  = 340
		windowHeight = 220
		windowWidthResize  = 300 # user can resize width by this value
		windowHeightResize = 0   # user can resize height by this value
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"Sample String Maker", # window title
			minSize = ( windowWidth, windowHeight ), # minimum size (for resizing)
			maxSize = ( windowWidth + windowWidthResize, windowHeight + windowHeightResize ), # maximum size (for resizing)
			autosaveName = "com.mekkablue.SampleStringMaker.mainwindow" # stores last window position and size
		)
		
		# UI elements:
		linePos, inset, lineHeight = 12, 15, 22
		
		self.w.descriptionText = vanilla.TextBox( (inset, linePos+2, -inset, 14), u"Builds group kern strings, adds them to the Sample Texts.", sizeStyle='small', selectable=True )
		linePos += lineHeight
		
		self.w.scriptText = vanilla.TextBox( (inset, linePos+2, 45, 14), u"Script:", sizeStyle='small', selectable=True )
		self.w.scriptPopup = vanilla.PopUpButton( (inset+45, linePos, -inset, 17), self.scripts, sizeStyle='small', callback=self.SavePreferences )
		self.w.scriptPopup.getNSPopUpButton().setToolTip_("Script for letters, will be ignored for all other categories (e.g., numbers).")
		linePos += lineHeight
		
		self.w.leftCategoryText = vanilla.TextBox( (inset, linePos+2, 90, 14), u"Left Category:", sizeStyle='small', selectable=True )
		self.w.leftCategoryPopup = vanilla.PopUpButton( (inset+90, linePos, -inset, 17), self.categoryList, sizeStyle='small', callback=self.SavePreferences )
		self.w.leftCategoryPopup.getNSPopUpButton().setToolTip_("Category:Subcategory for left side of kern pair.")
		linePos += lineHeight
		
		self.w.rightCategoryText = vanilla.TextBox( (inset, linePos+2, 90, 14), u"Right Category:", sizeStyle='small', selectable=True )
		self.w.rightCategoryPopup = vanilla.PopUpButton( (inset+90, linePos, -inset, 17), self.categoryList, sizeStyle='small', callback=self.SavePreferences )
		self.w.rightCategoryPopup.getNSPopUpButton().setToolTip_("Category:Subcategory for right side of kern pair.")
		linePos += lineHeight
		
		self.w.includeNonExporting = vanilla.CheckBox( (inset, linePos-1, -inset, 20), u"Also include non-exporting glyphs", value=False, callback=self.SavePreferences, sizeStyle='small' )
		self.w.includeNonExporting.getNSButton().setToolTip_("Also add glyphs of these categories if they are set to not export.")
		linePos += lineHeight
		
		self.w.excludeText = vanilla.TextBox( (inset, linePos+2, 150, 14), u"Exclude glyphs containing:", sizeStyle='small', selectable=True )
		self.w.excludedGlyphNameParts = vanilla.EditText( (inset+150, linePos, -inset, 19), ".tf, .tosf, ord", callback=self.SavePreferences, sizeStyle='small' )
		self.w.excludedGlyphNameParts.getNSTextField().setToolTip_("If the glyph name includes any of these comma-separated fragments, the glyph will be ignored. Always excluded: Ldot, ldot, ldot.sc, Fhook and florin.")
		linePos += lineHeight
		
		self.w.openTab = vanilla.CheckBox( (inset, linePos-1, -inset, 20), u"Open new tab at first kern string.", value=False, callback=self.SavePreferences, sizeStyle='small' )
		self.w.openTab.getNSButton().setToolTip_("If checked, a new tab will be opened with the first found kern string, and the cursor positioned accordingly, ready for group kerning and switching to the next sample string.")
		linePos += lineHeight
		
		
		# Run Button:
		self.w.runButton = vanilla.Button( (-80-inset, -20-inset, -inset, -inset), "Add", sizeStyle='regular', callback=self.SampleStringMakerMain )
		self.w.setDefaultButton( self.w.runButton )
		
		# Load Settings:
		if not self.LoadPreferences():
			print("Note: 'Sample String Maker' could not load preferences. Will resort to defaults")
		
		# Open window and focus on it:
		self.w.open()
		self.w.makeKey()
예제 #7
0
    def __init__(self):

        self.fontList = AllFonts()
        self.fontNames = [str(f) for f in self.fontList]

        self.w = vanilla.Window((300, 220), "Copy Anchors")
        self.w.fontChoiceTitle0 = vanilla.TextBox((10, 14, -10, 25), "⬇️")
        self.w.fontChoice0 = vanilla.PopUpButton((40, 10, -10, 25),
                                                 self.fontNames)
        self.w.fontChoiceTitle1 = vanilla.TextBox((10, 44, -10, 25), "➡️")
        self.w.fontChoice1 = vanilla.PopUpButton((40, 40, -10, 25),
                                                 self.fontNames)
        if len(self.fontNames) > 1:
            self.w.fontChoice1.set(1)

        self.w.glyphTitle = vanilla.TextBox((10, 84, -10, 25), "🔠")
        self.w.glyphChoice = vanilla.PopUpButton(
            (40, 80, -10, 25), ["Selected glyphs", "All glyphs"])

        self.w.measureTitle = vanilla.TextBox((10, 114, -10, 25), "↔️")
        self.w.measureChoice = vanilla.PopUpButton(
            (40, 110, -10, 25), ["Relative to glyph bounds", "Exact copy"])

        self.w.clearFist = vanilla.CheckBox((40, 145, -10, 25),
                                            "Clear destination anchors first",
                                            value=True)

        self.w.copyButton = vanilla.SquareButton((10, 185, -10, 25),
                                                 "Copy!",
                                                 callback=self.copyAnchors)
        self.w.open()
    def __init__(self):

        self.pageScale = 0.1  # Scale the SVG so that glyphs aren't 1000 ps points in size
        self.bufferFactor = 3  # The scale of the buffer within the grid (1 = glyphs touch)

        self.fontList = []
        self.fontNameList = []

        if not HASDRAWBOT:

            self.w = vanilla.Window((300, 200), "Import/Export Art")

            self.w.title = vanilla.TextBox((10, 10, -10, 25), titleText)
            self.w.warningBox = vanilla.Box((10, 40, -10, 150))
            self.w.warningBox.nodrawbot = vanilla.TextBox((10, 10, -10, -10),
                                                          nodrawbotText)
            self.w.open()

        else:

            self.w = vanilla.Window((300, 780), "Import/Export Art")

            self.w.title = vanilla.TextBox((10, 10, -10, 25), titleText)
            self.w.titleFont = vanilla.TextBox((10, 40, -10, 25),
                                               "Source/Destination UFO")
            self.w.fontChoice = vanilla.PopUpButton((10, 60, -10, 25),
                                                    self.fontNameList)
            # Export
            self.w.exportBox = vanilla.Box((10, 105, -10, 185))
            self.w.exportBox.title = vanilla.TextBox((10, 10, -10, 100),
                                                     descriptionExport)
            self.w.exportBox.glyphChoice = vanilla.PopUpButton(
                (10, 110, -10, 25), ["Selected glyphs", "All glyphs"])
            self.w.exportBox.exportButton = vanilla.SquareButton(
                (10, 140, -10, 25), "Export SVG", callback=self.exportCallback)
            # Edit
            self.w.editBox = vanilla.Box((10, 305, -10, 165))
            self.w.editBox.title = vanilla.TextBox((10, 10, -10, 200),
                                                   descriptionEdit)
            # Import
            self.w.importBox = vanilla.Box((10, 485, -10, 285))
            self.w.importBox.title = vanilla.TextBox((10, 10, -10, 190),
                                                     descriptionImport)
            self.w.importBox.layerChoice = vanilla.PopUpButton(
                (10, 210, -10, 25), [
                    "Into the default foreground layer",
                    "Into a new layer called “import“"
                ])
            self.w.importBox.importButton = vanilla.SquareButton(
                (10, 240, -10, 25), "Import SVG", callback=self.importCallback)

            self.w.bind("close", self.closeCallback)
            self.w.open()
            self.buildFontList(None)

            addObserver(self, "buildFontList", "fontDidOpen")
            addObserver(self, "buildFontList", "newFontDidOpen")
            addObserver(self, "buildFontList", "fontDidClose")
	def __init__( self ):
		# Window 'self.w':
		windowWidth  = 280
		windowHeight = 240
		windowWidthResize  = 100 # user can resize width by this value
		windowHeightResize = 0   # user can resize height by this value
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"Fix Arrow Positioning", # window title
			minSize = ( windowWidth, windowHeight ), # minimum size (for resizing)
			maxSize = ( windowWidth + windowWidthResize, windowHeight + windowHeightResize ), # maximum size (for resizing)
			autosaveName = "com.mekkablue.FixArrowPositioning.mainwindow" # stores last window position and size
		)
		
		# UI elements:
		linePos, inset, lineHeight = 12, 15, 22
		
		self.w.explanation = vanilla.TextBox( (inset, linePos+2, -inset, 14), "Fixes position and spacing of arrows.", sizeStyle='small', selectable=True )
		linePos += lineHeight
		
		self.w.referenceForHorizontalArrowsText = vanilla.TextBox( (inset, linePos+2, 130, 14), "Reference for H arrows:", sizeStyle='small' )
		self.w.referenceForHorizontalArrows = vanilla.PopUpButton( (inset+130, linePos, -inset, 17), self.hArrows, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight

		self.w.referenceForVerticalArrowsText = vanilla.TextBox( (inset, linePos+2, 130, 14), "Reference for V arrows:", sizeStyle='small' )
		self.w.referenceForVerticalArrows = vanilla.PopUpButton( (inset+130, linePos, -inset, 17), self.vArrows, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		self.w.referenceForDiagonalArrowsText = vanilla.TextBox( (inset, linePos+2, 130, 14), "Reference for D arrows:", sizeStyle='small' )
		self.w.referenceForDiagonalArrows = vanilla.PopUpButton( (inset+130, linePos, -inset, 17), self.dArrows, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		self.w.suffixText = vanilla.TextBox( (inset, linePos+2, 70, 14), "Dot suffix:", sizeStyle='small', selectable=False )
		self.w.suffix = vanilla.EditText( (inset+70, linePos, -inset, 19), "", sizeStyle='small' )
		linePos += lineHeight
		
		self.w.verticalPosOfHorizontalArrows = vanilla.CheckBox( (inset, linePos-1, -inset, 20), "Fix vertical positioning of horizontal arrows", value=True, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		self.w.verticalPosOfDiagonalArrows = vanilla.CheckBox( (inset, linePos-1, -inset, 20), "Fix vertical positioning of diagonal arrows", value=True, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		self.w.addAndUpdateMetricsKeys = vanilla.CheckBox( (inset, linePos-1, -inset, 20), "Add and update metrics keys", value=True, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		# Run Button:
		self.w.runButton = vanilla.Button( (-80-inset, -20-inset, -inset, -inset), "Fix", sizeStyle='regular', callback=self.FixArrowPositioningMain )
		self.w.setDefaultButton( self.w.runButton )
		
		# Load Settings:
		if not self.LoadPreferences():
			print("Note: 'Fix Arrow Positioning' could not load preferences. Will resort to defaults")
		
		# Open window and focus on it:
		self.w.open()
		self.w.makeKey()
예제 #10
0
    def __init__(self):
        windowWidth = 200
        windowHeight = 240

        self.w = vanilla.FloatingWindow((50, 50, windowWidth, windowHeight),
                                        "CopySidebearings")

        self.fonts = [(makeDefaultIDString(font), font) for font in AllFonts()]
        fontNames = [i[0] for i in self.fonts]

        # dropdowns
        self.w.sourceUFOText = vanilla.TextBox((15, 15, 90, 22),
                                               "Source UFO:",
                                               sizeStyle="small")
        self.w.sourceUFODropDown = vanilla.PopUpButton((15, 30, 170, 20),
                                                       fontNames)
        self.w.sourceUFODropDown.set(0)

        self.w.destinationUFOText = vanilla.TextBox((15, 60, 90, 22),
                                                    "Destination UFO:",
                                                    sizeStyle="small")
        self.w.destinationUFODropDown = vanilla.PopUpButton((15, 75, 170, 20),
                                                            fontNames)
        self.w.destinationUFODropDown.set(1)

        # divider
        self.w.divider1 = vanilla.HorizontalLine((15, 108, -15, 1))

        # glyphs scope area
        self.w.iconAllGlyphs = vanilla.ImageView((15, 123, 12, 13))
        self.w.iconAllGlyphs.setImage(imagePath="../resources/allGlyphs.png")
        self.w.iconSelGlyphs = vanilla.ImageView((15, 149, 12, 13))
        self.w.iconSelGlyphs.setImage(
            imagePath="../resources/selectedGlyphs.png")
        self.w.glyphsRadioGroup = vanilla.RadioGroup(
            (32, 118, -15, 50), ["All Glyphs", "Selected Glyphs"],
            sizeStyle="small")
        self.w.glyphsRadioGroup.set(0)  # default to all glyphs

        # divider
        self.w.divider2 = vanilla.HorizontalLine((15, 176, -15, 1))

        # commit button
        self.w.commitButton = vanilla.Button(
            (15, 188, -15, 20),
            "Copy Sidebearings",
            sizeStyle="small",
            callback=self._commitButtonCallback)

        # note
        self.w.note = vanilla.TextBox((15, 215, -15, 15),
                                      "Open output window for results.",
                                      sizeStyle="mini",
                                      alignment="center")

        self.w.open()  # go go gadget window
예제 #11
0
    def __init__(self):

        self.w = vanilla.FloatingWindow(
            (300, 150), "Check anchors' positions"
        )  #, autosaveName="pl.dadastudio.Test.mainwindow"

        self.w.text_1 = vanilla.TextBox(
            (self.leftMargin, self.setLineHeight(0), -15, 14),
            "Anchor:",
            sizeStyle='small')

        self.w.anchor_name = vanilla.PopUpButton(
            (self.leftMargin + 75, self.setLineHeight(0), -self.leftMargin,
             17),
            self.GetAnchorNames(),
            callback=self.setHeight,
            sizeStyle='small')

        self.w.text_3 = vanilla.TextBox(
            (self.leftMargin, self.setLineHeight(1), -15, 14),
            "subCategory",
            sizeStyle='small')
        self.w.subCategory_name = vanilla.PopUpButton(
            (self.leftMargin + 75, self.setLineHeight(1), -self.leftMargin,
             17),
            self.GetSubCategoryNames(),
            callback=self.setHeight,
            sizeStyle='small')

        self.w.text_4 = vanilla.TextBox(
            (self.leftMargin, self.setLineHeight(2), -15, 14),
            "Expected Y",
            sizeStyle='small')
        self.w.setY = vanilla.EditText(
            (self.leftMargin + 75, self.setLineHeight(2), -self.leftMargin,
             17),
            text="",
            sizeStyle='small')

        self.w.moveButton = vanilla.Button(
            (-80 - self.leftMargin, -40, -self.leftMargin, -self.leftMargin),
            "Search",
            sizeStyle='regular',
            callback=self.MoveCallback)
        self.w.correctButton = vanilla.Button(
            (self.leftMargin, -40, 150, -self.leftMargin),
            "Correct",
            sizeStyle='regular',
            callback=self.CorrectCallback)
        self.w.setDefaultButton(self.w.moveButton)

        self.w.center()
        self.w.correctButton.enable(False)

        self.w.setY.set(str(Font.selectedFontMaster.xHeight))
    def __init__(self):
        windowWidth = 280
        windowHeight = 150
        windowWidthResize = 0
        windowHeightResize = 0
        self.w = vanilla.FloatingWindow(
            (windowWidth, windowHeight),
            "Copy master into sublayer",
            minSize=(windowWidth, windowHeight),
            maxSize=(windowWidth + windowWidthResize,
                     windowHeight + windowHeightResize),
            autosaveName="com.harbortype.CopyMasterIntoSublayer.mainwindow")

        self.w.text_1 = vanilla.TextBox((15, 12 + 2, 120, 14),
                                        "Copy paths from:",
                                        sizeStyle='small')
        self.w.masterSource = vanilla.PopUpButton((120, 12, -15, 17),
                                                  self.GetMasterNames(),
                                                  sizeStyle='small',
                                                  callback=None)

        self.w.text_2 = vanilla.TextBox((15, 48 + 2, 120, 14),
                                        "into the sublayer:",
                                        sizeStyle='small')
        self.w.layerTarget = vanilla.EditText((120, 48 - 1, -15, 18),
                                              sizeStyle='small',
                                              callback=None)

        self.w.text_3 = vanilla.TextBox((15, 48 + 22, 120, 14),
                                        "of master:",
                                        sizeStyle='small')
        self.w.masterDestination = vanilla.PopUpButton((120, 48 + 20, -15, 17),
                                                       self.GetMasterNames(),
                                                       sizeStyle='small',
                                                       callback=None)

        self.w.copybutton = vanilla.Button((-80, -30, -15, -10),
                                           "Copy",
                                           sizeStyle='small',
                                           callback=self.CopyAll)
        self.w.setDefaultButton(self.w.copybutton)

        # Load Settings:
        if not self.LoadPreferences():
            print(
                "Note: 'Copy Master into Sublayer' could not load preferences. Will resort to defaults."
            )

        self.w.open()
        self.w.makeKey()
예제 #13
0
	def __init__( self ):
		# Window 'self.w':
		windowWidth  = 350
		windowHeight = 260
		windowWidthResize  = 100 # user can resize width by this value
		windowHeightResize = 0   # user can resize height by this value
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"Punctuation Unifier", # window title
			minSize = ( windowWidth, windowHeight ), # minimum size (for resizing)
			maxSize = ( windowWidth + windowWidthResize, windowHeight + windowHeightResize ), # maximum size (for resizing)
			autosaveName = "com.mekkablue.PunctuationUnifier.mainwindow" # stores last window position and size
		)
		
		# UI elements:
		linePos, inset, lineHeight = 12, 15, 22
		
		self.w.descriptionText = vanilla.TextBox( (inset, linePos+2, -inset, 14), u"Unifies the shapes of the periods in punctuation.", sizeStyle='small', selectable=True )
		linePos += lineHeight
		
		self.w.periodBaseText = vanilla.TextBox( (inset, linePos+2, 100, 14), u"Model for period:", sizeStyle='small', selectable=True )
		self.w.periodBase = vanilla.PopUpButton( (inset+100, linePos, -inset, 17), self.periodBase, sizeStyle='small', callback=self.SavePreferences )
		linePos += lineHeight
		
		self.w.commaBaseText = vanilla.TextBox( (inset, linePos+2, 100, 14), u"Model for comma:", sizeStyle='small', selectable=True )
		self.w.commaBase = vanilla.PopUpButton( (inset+100, linePos, -inset, 17), self.commaBase, sizeStyle='small', callback=self.SavePreferences )
		linePos += lineHeight
		
		self.w.scaleToHeight = vanilla.CheckBox( (inset, linePos-1, -inset, 20), u"Scale to height", value=False, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		
		self.w.text_1 = vanilla.TextBox( (inset-1, linePos+2, 75, 14), "inset", sizeStyle='small' )
		self.w.popup_1 = vanilla.PopUpButton( (inset+80, linePos, 50, 17), [str(x) for x in range( 3, 12 )], callback=self.SavePreferences, sizeStyle='small' )
		self.w.edit_1 = vanilla.EditText( (inset+80+55, linePos, -inset, 19), "insert text here", sizeStyle='small', callback=self.SavePreferences)
		linePos += lineHeight
		
		# Run Button:
		self.w.runButton = vanilla.Button( (-80-inset, -20-inset, -inset, -inset), "Run", sizeStyle='regular', callback=self.PunctuationUnifierMain )
		self.w.setDefaultButton( self.w.runButton )
		
		# Load Settings:
		if not self.LoadPreferences():
			print "Note: 'Punctuation Unifier' could not load preferences. Will resort to defaults"
		
		# Open window and focus on it:
		self.w.open()
		self.w.makeKey()
예제 #14
0
	def __init__( self ):
		# Window 'self.w':
		windowWidth  = 280
		windowHeight = 155
		windowWidthResize  = 120 # user can resize width by this value
		windowHeightResize = 0   # user can resize height by this value
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"Copy layer to layer", # window title
			minSize = ( windowWidth, windowHeight ), # minimum size (for resizing)
			maxSize = ( windowWidth + windowWidthResize, windowHeight + windowHeightResize ), # maximum size (for resizing)
			autosaveName = "com.mekkablue.MasterFiller.mainwindow" # stores last window position and size
		)

		self.w.text_1 = vanilla.TextBox((15, 12+2, 120, 14), "Copy paths from", sizeStyle='small')
		self.w.master_from = vanilla.PopUpButton((120, 12, -15, 17), self.GetMasterNames(1), sizeStyle='small', callback=self.MasterChangeCallback)

		# self.w.text_2 = vanilla.TextBox((15, 32+2, 120, 14), "into selection of", sizeStyle='small')
		# self.w.master_into = vanilla.PopUpButton((120, 32, -15, 17), self.GetMasterNames(), sizeStyle='small', callback=self.MasterChangeCallback)

		self.w.include_components = vanilla.CheckBox((15, 52+2, -100, 20), "Include components", sizeStyle='small', callback=self.SavePreferences, value=True)
		self.w.include_anchors = vanilla.CheckBox((15, 52+20, -100, 20), "Include anchors", sizeStyle='small', callback=self.SavePreferences, value=True)
		self.w.include_metrics = vanilla.CheckBox((15, 52+38, -100, 20), "Include metrics", sizeStyle='small', callback=self.SavePreferences, value=True)
		self.w.keep_window_open = vanilla.CheckBox((15, 52+56, -100, 20), "Keep window open", sizeStyle='small', callback=self.SavePreferences, value=True)

		self.w.copybutton = vanilla.Button((-80, -30, -15, -10), "Copy", sizeStyle='small', callback=self.buttonCallback)
		self.w.setDefaultButton( self.w.copybutton )

		# Load Settings:
		if not self.LoadPreferences():
			print "Note: 'Copy Layer to Layer' could not load preferences. Will resort to defaults."

		self.w.open()
		self.w.makeKey()
예제 #15
0
	def __init__( self ):
		# Window 'self.w':
		windowWidth  = 350
		windowHeight = 60
		windowWidthResize  = 500 # user can resize width by this value
		windowHeightResize = 0   # user can resize height by this value
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"New Tab with OT Class", # window title
			minSize = ( windowWidth, windowHeight ), # minimum size (for resizing)
			maxSize = ( windowWidth + windowWidthResize, windowHeight + windowHeightResize ), # maximum size (for resizing)
			autosaveName = "com.mekkablue.NewTabWithOTClass.mainwindow" # stores last window position and size
		)
		
		# UI elements:
		self.w.text = vanilla.TextBox( (15-1, 12+2, 100, 14), "Pick an OT class:", sizeStyle='small' )
		self.w.classMenu = vanilla.PopUpButton( (15+100, 12, -130, 17), self.currentFontClasses(None), callback=None, sizeStyle='small' )
		self.w.updateButton = vanilla.Button((-125, 12+1, -100, -15), u"↺", sizeStyle='small', callback=self.populateClassMenu )
		
		# Run Button:
		self.w.runButton = vanilla.Button((-95, 12+3, -15, -15), "New Tab", sizeStyle='regular', callback=self.NewTabWithOTClassMain )
		self.w.setDefaultButton( self.w.runButton )
		
		self.font = Glyphs.font
		
		# Open window and focus on it:
		self.w.open()
		self.w.makeKey()
	def __init__( self ):
		# Window 'self.w':
		windowWidth  = 470
		windowHeight = 110
		windowWidthResize  = 300 # user can resize width by this value
		windowHeightResize = 0   # user can resize height by this value
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"Set in All TTF Autohint Options", # window title
			minSize = ( windowWidth, windowHeight ), # minimum size (for resizing)
			maxSize = ( windowWidth + windowWidthResize, windowHeight + windowHeightResize ), # maximum size (for resizing)
			autosaveName = "com.mekkablue.SetTTFAutohintOptions.mainwindow" # stores last window position and size
		)
		
		# UI elements:
		self.w.ttfAutohintOption = vanilla.PopUpButton( (15, 13, 200, 17), availableOptions, callback=self.SavePreferences, sizeStyle='small' )
		self.w.optionValue = vanilla.EditText( (220, 12, -65-50, 20), "value", callback=self.SavePreferences, sizeStyle = 'small')
		self.w.explanation = vanilla.TextBox( (15-1, 40, -5, -5), "Adds or sets this option in all TTF Autohint Options parameters in the current font. For fallback-stem-width, use * for entering the respective instance weight value, and idotless for measuring the width of the interpolated dotless i. The Del button removes this TTFA option from all instances.", sizeStyle='small' )
		
		# Run Button:
		self.w.runButton = vanilla.Button((-60-50, 10, -15-50, 22), "Set", sizeStyle='regular', callback=self.SetTTFAutohintOptionsMain )
		self.w.delButton = vanilla.Button((-60, 10, -15, 22), "Del", sizeStyle='regular', callback=self.RemoveOption )
		self.w.setDefaultButton( self.w.runButton )
		
		# Load Settings:
		if not self.LoadPreferences():
			print("Note: 'Set TTF Autohint Options' could not load preferences. Will resort to defaults")
		
		# enable or disable the edit box
		self.editValueField()
		
		# Open window and focus on it:
		self.w.open()
		self.w.makeKey()
예제 #17
0
	def __init__( self ):
		windowWidth  = 400
		windowHeight = 280
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"ALL YOUR @BASE BELONG TO US.", # window title
			autosaveName = "com.Tosche.BatchMetricKey.mainwindow" # stores last window position and size
		)

		# UI elements:
		self.w.presetText = vanilla.TextBox( ( 12, 13, 55, 17), "Presets:", sizeStyle='regular' )
		self.w.presetPopup = vanilla.PopUpButton( (14+58, 13, -15, 17), [str(x) for x in presets], callback=self.setField, sizeStyle='regular' )
		self.w.keyTextField = vanilla.EditText( (14, 45, -15, 22), re.sub(" .*", "", presets[0]), sizeStyle = 'regular')
		self.w.setToText = vanilla.TextBox( ( 12, 78, 50, 17), "Set to:", sizeStyle='regular' )
		self.w.applyL = vanilla.CheckBox( ( 12+50, 78, 50, 22), "Left", value=True, sizeStyle='regular')
		self.w.applyR = vanilla.CheckBox( ( 12+50+50, 78, 56, 22), "Right", value=True, sizeStyle='regular')
		self.w.avoidNest = vanilla.CheckBox( ( 275, 78, 115, 22), "Adoid Nesting", value=True, sizeStyle='regular')
		self.w.radioQText = vanilla.TextBox( ( 12, 115, 100, 17), "If there is Q:", sizeStyle='regular' )
		self.w.radioQ = vanilla.RadioGroup( (100, 115, 350, 19), ["Use width of O (no key)", "Use RSB of Q"], sizeStyle='regular', isVertical=False)
		self.w.radioQ.set(0)
		self.w.line = vanilla.HorizontalLine((12, 190, -10, 1))
		self.w.explain = vanilla.TextBox( ( 12, 200, 350, 80), "@base is a glyph without suffix of the selected glyph.\n@base of hsuperior is h\n@Base of a.smcp is A\[email protected] of one.numr is one.smcp", sizeStyle='regular' )
		# Run Button:
		self.w.setButton = vanilla.Button((290, 145, 90, 34), "Set", sizeStyle='regular', callback=self.BatchMetricKeyMain )
		self.w.setDefaultButton( self.w.setButton )
		
		# Open window and focus on it:
		self.w.open()
		self.w.makeKey()
	def __init__( self ):
		# Window 'self.w':
		windowWidth  = 400
		windowHeight = 120
		windowWidthResize  = 0 # user can resize width by this value
		windowHeightResize = 0 # user can resize height by this value
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"Variation Interpolator", # window title
			minSize = ( windowWidth, windowHeight ), # minimum size (for resizing)
			maxSize = ( windowWidth + windowWidthResize, windowHeight + windowHeightResize ), # maximum size (for resizing)
			autosaveName = "com.mekkablue.VariationInterpolator.mainwindow" # stores last window position and size
		)
		
		# UI elements:
		self.w.text_1 = vanilla.TextBox( (15-1, 12+2, 40, 14), "Create", sizeStyle='small' )
		self.w.numberOfInterpolations = vanilla.PopUpButton( (15+45, 12, 50, 17), [str(x) for x in range( 1, 31 )], callback=self.SavePreferences, sizeStyle='small' )
		self.w.text_2 = vanilla.TextBox( (15+100, 12+2, -15, 14), "background-interpolation glyphs", sizeStyle='small' )

		self.w.text_3 = vanilla.TextBox( (15-1, 40+2, 75, 14), "with suffix", sizeStyle='small' )
		self.w.suffix = vanilla.EditText( (15+65, 40-1, -150, 20), "var", callback=self.SavePreferences, sizeStyle = 'small')
		self.w.text_4 = vanilla.TextBox( (-145, 40+2, -15, 14), "for selected glyphs.", sizeStyle='small' )
		
		# Run Button:
		self.w.runButton = vanilla.Button((-100-15, -20-15, -15, -15), "Create", sizeStyle='regular', callback=self.VariationInterpolatorMain )
		self.w.setDefaultButton( self.w.runButton )
		
		# Load Settings:
		if not self.LoadPreferences():
			print "Note: 'Variation Interpolator' could not load preferences. Will resort to defaults"
		
		# Open window and focus on it:
		self.w.open()
		self.w.makeKey()
예제 #19
0
    def __init__(self):
        self.w = vanilla.FloatingWindow((340, 40), "Move anchors")

        self.w.text_anchor = vanilla.TextBox((15, 12 + 2, 45, 14),
                                             "Move",
                                             sizeStyle='small')
        self.w.anchor_name = vanilla.PopUpButton(
            (50, 12, 80, 17),
            self.GetAnchorNames(),
            sizeStyle='small',
            callback=self.AnchorChangeCallback)

        self.w.text_value = vanilla.TextBox((135, 12 + 2, 55, 14),
                                            "to height",
                                            sizeStyle='small')
        self.w.anchor_value = vanilla.EditText((190, 12, 50, 19),
                                               "0.0",
                                               sizeStyle='small')

        self.w.movebutton = vanilla.Button((-80, 12 + 1, -15, 17),
                                           "Move",
                                           sizeStyle='small',
                                           callback=self.buttonCallback)
        self.w.setDefaultButton(self.w.movebutton)

        self.w.open()
        self.AnchorChangeCallback(self)
예제 #20
0
	def __init__( self ):
		# Window 'self.w':
		windowWidth  = 240
		windowHeight = 110
		windowWidthResize  = 300 # user can resize width by this value
		windowHeightResize = 0   # user can resize height by this value
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"Remove Anchors", # window title
			minSize = ( windowWidth, windowHeight ), # minimum size (for resizing)
			maxSize = ( windowWidth + windowWidthResize, windowHeight + windowHeightResize ), # maximum size (for resizing)
			autosaveName = "com.mekkablue.AnchorDeleter.mainwindow" # stores last window position and size
		)
		
		# UI elements:
		linePos, inset, lineHeight = 12, 15, 22
		self.w.text_1 = vanilla.TextBox( (inset-1, linePos+2, 80, 14), "Delete anchor", sizeStyle='small' )
		self.w.updateButton = vanilla.SquareButton( (-inset-20, linePos, -inset, 18), u"↺", sizeStyle='small', callback=self.updateAnchors )
		self.w.anchorPopup = vanilla.PopUpButton( (inset+80, linePos, -inset-25, 17), self.updateAnchors(None), callback=self.SavePreferences, sizeStyle='small' )
		
		linePos += lineHeight
		self.w.selectedAnchorsOnly = vanilla.CheckBox( (inset, linePos, -inset, 20), "In selected glyphs only", value=False, callback=self.SavePreferences, sizeStyle='small' )

		# Run Button:
		self.w.runButton = vanilla.Button((-80-inset, -20-inset, -inset, -inset), "Delete", sizeStyle='regular', callback=self.AnchorDeleterMain )
		self.w.setDefaultButton( self.w.runButton )
		
		# Load Settings:
		if not self.LoadPreferences():
			print "Note: 'Delete Anchors' could not load preferences. Will resort to defaults"
		
		# Open window and focus on it:
		self.w.open()
		self.w.makeKey()
예제 #21
0
    def __init__(self):
        # Window 'self.w':
        windowWidth = 320
        windowHeight = 180
        windowWidthResize = 300  # user can resize width by this value
        windowHeightResize = 400  # user can resize height by this value
        self.w = vanilla.FloatingWindow(
            (windowWidth, windowHeight),  # default window size
            "Find and Replace In Instance Parameters",  # window title
            minSize=(windowWidth, windowHeight),  # minimum size (for resizing)
            maxSize=(windowWidth + windowWidthResize, windowHeight +
                     windowHeightResize),  # maximum size (for resizing)
            autosaveName=
            "com.mekkablue.FindAndReplaceInInstanceParameters.mainwindow"  # stores last window position and size
        )

        # UI elements:
        self.w.text_1 = vanilla.TextBox((15 - 1, 12 + 2, 130, 14),
                                        "Replace in parameters",
                                        sizeStyle='small')
        self.w.availableParameters = vanilla.PopUpButton(
            (145, 12, -15, 17),
            self.setAvailableParameters(None),
            callback=self.SavePreferences,
            sizeStyle='small')
        self.w.find = vanilla.TextEditor((15, 40, 100, -50),
                                         text="find",
                                         callback=self.SavePreferences,
                                         checksSpelling=False)
        self.w.replace = vanilla.TextEditor((110, 40, 100, -50),
                                            text="replace",
                                            callback=self.SavePreferences,
                                            checksSpelling=False)
        self.windowResize(None)

        # Run Button:
        self.w.rescanButton = vanilla.Button(
            (-200, -20 - 15, -110, -15),
            "Rescan",
            sizeStyle='regular',
            callback=self.setAvailableParameters)
        self.w.runButton = vanilla.Button(
            (-80 - 15, -20 - 15, -15, -15),
            "Replace",
            sizeStyle='regular',
            callback=self.FindAndReplaceInInstanceParametersMain)
        self.w.setDefaultButton(self.w.runButton)

        self.w.bind("resize", self.windowResize)

        # Load Settings:
        if not self.LoadPreferences():
            print(
                "Note: 'Find and Replace In Instance Parameters' could not load preferences. Will resort to defaults"
            )

        # Open window and focus on it:
        self.w.open()
        self.w.makeKey()
예제 #22
0
    def __init__(self):
        # Window 'self.w':
        edY = 200
        txY = 14
        spX = 10
        spY = 5
        btnX = 250
        btnY = 20
        windowWidth = 350
        windowHeight = edY * 2 + spY * 6 + txY * 2 + btnY + 14
        self.w = vanilla.FloatingWindow(
            (windowWidth, windowHeight),  # default window size
            "Analyse Manuscript",  # window title
            autosaveName=
            "com.Tosche.AnalyseManuscript.mainwindow"  # stores last window position and size
        )

        # UI elements:
        self.w.text1 = vanilla.TextBox((spX, spY, -spX, txY),
                                       'Paste your text below...',
                                       sizeStyle='small')
        self.w.dump = vanilla.TextEditor((spX, spY * 2 + txY, -spX, edY),
                                         "",
                                         callback=self.updateChar)
        self.w.text2 = vanilla.TextBox((spX, spY * 3 + txY + edY, -spX, txY),
                                       "0 Unicode characters",
                                       sizeStyle='small')
        self.w.chars = vanilla.TextEditor(
            (spX, spY * 4 + txY * 2 + edY, -spX, edY), "", readOnly=True)
        self.w.chars._textView.setFont_(NSFont.fontWithName_size_("Menlo", 12))
        self.w.dump._textView.setAutomaticSpellingCorrectionEnabled_(False)
        self.w.dump._textView.setAutomaticTextReplacementEnabled_(False)
        self.w.dump._textView.setContinuousSpellCheckingEnabled_(False)
        self.w.dump._textView.setGrammarCheckingEnabled_(False)
        self.w.dump._textView.setAutomaticQuoteSubstitutionEnabled_(False)

        # Run Button:
        self.w.markPopup = vanilla.PopUpButton(
            (spX, -btnY - spY - 7, 70, -spY - 7), [
                "Mark", "Red", "Orange", "Brown", "Yellow", "Light Green",
                "Dark Green", "Cyan", "Blue", "Purple", "Pink", "Light Grey",
                "Dark Grey"
            ],
            callback=self.markGlyphs)
        self.w.runButton = vanilla.Button(
            (-btnX - spX, -btnY - spY - 7, -spX, -spY - 7),
            "Add missing characters",
            sizeStyle='regular',
            callback=self.AnalyseManuscriptMain)
        self.w.setDefaultButton(self.w.runButton)

        # Open window and focus on it:
        self.w.open()
        menu = self.w.markPopup._nsObject.menu()
        menu.setAutoenablesItems_(False)
        menu.itemAtIndex_(0).setEnabled_(False)
        divider = NSMenuItem.separatorItem()
        menu.insertItem_atIndex_(divider, 1)
        self.w.makeKey()
예제 #23
0
    def __init__(self):
        # Window 'self.w':
        windowWidth = 400
        windowHeight = 160
        windowWidthResize = 1000  # user can resize width by this value
        windowHeightResize = 1000  # user can resize height by this value
        self.w = vanilla.FloatingWindow(
            (windowWidth, windowHeight),  # default window size
            "Compare Glyph Info",  # window title
            minSize=(windowWidth, windowHeight),  # minimum size (for resizing)
            maxSize=(windowWidth + windowWidthResize, windowHeight +
                     windowHeightResize),  # maximum size (for resizing)
            autosaveName=
            "com.mekkablue.CompareGlyphInfo.mainwindow"  # stores last window position and size
        )

        # UI elements:
        self.linePos, inset, lineHeight = 5, 6, 22

        self.w.descriptionText = vanilla.TextBox(
            (inset, self.linePos + 2, 140, 14),
            "Compare between fonts:",
            sizeStyle='small',
            selectable=True)

        self.w.whatToCompare = vanilla.PopUpButton(
            (inset + 140, self.linePos, -160 - inset - 10, 17),
            thingsToCompare,
            sizeStyle='small',
            callback=self.Reload)
        self.w.whatToCompare.getNSPopUpButton().setToolTip_(
            "Choose which glyph info to compare between all open fonts.")

        self.w.ignoreMissingGlyphs = vanilla.CheckBox(
            (-160 - inset, self.linePos, -inset - 25, 17),
            "Ignore missing glyphs",
            value=False,
            callback=self.Reload,
            sizeStyle='small')
        self.w.ignoreMissingGlyphs.getNSButton().setToolTip_(
            "If activated, will only list glyphs that are present in ALL open fonts."
        )

        self.w.updateButton = vanilla.SquareButton(
            (-inset - 20, self.linePos, -inset, 18),
            "↺",
            sizeStyle='small',
            callback=self.Reload)
        self.w.updateButton.getNSButton().setToolTip_(
            "Reload with currently opened fonts. Useful if you just opened or closed a font, or brought another font forward."
        )

        self.linePos += lineHeight
        self.Reload()

        # Open window and focus on it:
        self.w.open()
        self.w.makeKey()
    def __init__(self):

        self.currentGlyph = None
        self.window = None

        self.fonts = []
        self.fontNames = []

        self.glyph0 = RGlyph()  #None
        self.glyph1 = RGlyph()  #None
        self.compatibilityReport = None
        self.interpolatedGlyph = RGlyph()

        self.w = vanilla.FloatingWindow((250, 155), "Interpolation Slider")
        self.w.open()
        self.w.title = vanilla.TextBox((10, 10, -10, 25),
                                       "Masters:",
                                       sizeStyle="small")
        self.w.font0 = vanilla.PopUpButton((10, 25, -10, 25), [],
                                           callback=self.glyphChanged,
                                           sizeStyle="small")
        self.w.font1 = vanilla.PopUpButton((10, 50, -10, 25), [],
                                           callback=self.glyphChanged,
                                           sizeStyle="small")
        self.w.compatibilityText = vanilla.TextBox((-105, 83, 100, 35),
                                                   u"Compatibility: ⚪️",
                                                   sizeStyle="small")
        self.w.line = vanilla.HorizontalLine((5, 110, -5, 1))
        self.w.interpValue = vanilla.Slider((10, 120, -10, 25),
                                            callback=self.optionsChanged,
                                            minValue=0,
                                            maxValue=1)
        self.w.interpValue.set(0.5)
        self.w.bind("close", self.closed)

        self.collectFonts()
        self.glyphChanged(None)

        addObserver(self, "glyphChanged", "currentGlyphChanged")
        addObserver(self, "fontsChanged", "newFontDidOpen")
        addObserver(self, "fontsChanged", "fontDidOpen")
        addObserver(self, "fontsChanged", "fontDidClose")
        addObserver(self, "drawBkgnd", "drawBackground")
        addObserver(self, "drawPreview", "drawPreview")
예제 #25
0
    def __init__(self):
        # Window 'self.w':
        windowWidth = 340
        windowHeight = 135
        self.w = vanilla.Window(
            (windowWidth, windowHeight),  # default window size
            "Replace Corners",  # window title
            minSize=(windowWidth, windowHeight),  # minimum size (for resizing)
            maxSize=(windowWidth, windowHeight),  # maximum size (for resizing)
            autosaveName=
            "com.mekkablue.FindAndReplaceCorners.mainwindow"  # stores last window position and size
        )

        thisFont = Glyphs.font
        self.corners = self.allCorners(thisFont)

        # UI elements:
        margin = 25
        self.w.textSearch = vanilla.TextBox((margin + 5, 12 + 2, 80, 18),
                                            "Find:")
        self.w.searchFor = vanilla.PopUpButton((margin + 80, 12, -margin, 22),
                                               self.corners)

        self.w.textReplace = vanilla.TextBox((margin, 32 + 12 + 2, 80, 18),
                                             "Replace with:")
        self.w.replaceBy = vanilla.PopUpButton(
            (margin + 80, 32 + 12, -margin, 22), self.corners)

        self.w.replaceButton = vanilla.Button(
            (-70 - margin, 63 + 12 + 1, -margin, 22),
            "Replace",
            callback=self.FindAndReplaceCornersMain)
        self.w.setDefaultButton(self.w.replaceButton)

        # Load Settings:
        if not self.LoadPreferences():
            print(
                "Note: 'Replace Corners' could not load preferences. Will resort to defaults"
            )

        # Open window and focus on it:
        self.w.open()
        self.w.makeKey()
예제 #26
0
	def __init__( self ):
		# Window 'self.w':
		windowWidth  = 340
		windowHeight = 240
		windowWidthResize  = 200 # user can resize width by this value
		windowHeightResize = 0   # user can resize height by this value
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"Copy layer to layer", # window title
			minSize = ( windowWidth, windowHeight ), # minimum size (for resizing)
			maxSize = ( windowWidth + windowWidthResize, windowHeight + windowHeightResize ), # maximum size (for resizing)
			autosaveName = "com.mekkablue.CopyLayerToLayer.mainwindow" # stores last window position and size
		)

		self.w.text_1 = vanilla.TextBox((15, 12+2, 120, 14), "Copy paths from", sizeStyle='small')
		self.w.fontSource = vanilla.PopUpButton((120, 12, -15, 17), self.GetFontNames(), sizeStyle='small', callback=self.FontChangeCallback)
		self.w.masterSource = vanilla.PopUpButton((120, 12+20, -15, 17), self.GetMasterNames("source"), sizeStyle='small', callback=self.MasterChangeCallback)

		self.w.text_2 = vanilla.TextBox((15, 56+2, 120, 14), "into selection of", sizeStyle='small')
		self.w.fontTarget = vanilla.PopUpButton((120, 56, -15, 17), self.GetFontNames(), sizeStyle='small', callback=self.FontChangeCallback)
		self.w.masterTarget = vanilla.PopUpButton((120, 56+20, -15, 17), self.GetMasterNames("target"), sizeStyle='small', callback=self.MasterChangeCallback)

		self.w.includePaths = vanilla.CheckBox((15+150+15, 100+2, 160, 20), "Include paths", sizeStyle='small', callback=self.SavePreferences, value=True)
		self.w.includeComponents = vanilla.CheckBox((15, 100+2, 160, 20), "Include components", sizeStyle='small', callback=self.SavePreferences, value=True)
		self.w.includeAnchors = vanilla.CheckBox((15, 100+20, 160, 20), "Include anchors", sizeStyle='small', callback=self.SavePreferences, value=True)
		self.w.includeMetrics = vanilla.CheckBox((15+150+15, 100+20, 160, 20), "Include metrics", sizeStyle='small', callback=self.SavePreferences, value=True)

		self.w.copyBackground = vanilla.CheckBox((15, 100+45, 160, 20), "Into background instead", sizeStyle='small', callback=self.SavePreferences, value=False)
		self.w.keepOriginal = vanilla.CheckBox((15+150+15, 100+45, 160, 20), "Keep target layer content", sizeStyle='small', callback=self.SavePreferences, value=False)

		self.w.keepWindowOpen = vanilla.CheckBox((15, 100+70, 160, 20), "Keep window open", sizeStyle='small', callback=self.SavePreferences, value=True)

		self.w.copybutton = vanilla.Button((-80, -30, -15, -10), "Copy", sizeStyle='small', callback=self.buttonCallback)
		self.w.setDefaultButton( self.w.copybutton )

		# Load Settings:
		if not self.LoadPreferences():
			print("Note: 'Copy Layer to Layer' could not load preferences. Will resort to defaults.")

		self.w.open()
		self.w.makeKey()
		self.w.masterTarget.set(1)
	def __init__( self ):
		# Window 'self.w':
		windowWidth  = 290
		windowHeight = 250
		windowWidthResize  = 300 # user can resize width by this value
		windowHeightResize = 0   # user can resize height by this value
		self.w = vanilla.FloatingWindow(
			( windowWidth, windowHeight ), # default window size
			"Find Shapeshifting Glyphs", # window title
			minSize = ( windowWidth, windowHeight ), # minimum size (for resizing)
			maxSize = ( windowWidth + windowWidthResize, windowHeight + windowHeightResize ), # maximum size (for resizing)
			autosaveName = "com.mekkablue.FindShapeshiftingGlyphs.mainwindow" # stores last window position and size
		)
		
		# UI elements:
		linePos, inset, lineHeight = 12, 15, 22
		
		self.w.descriptionText = vanilla.TextBox( (inset, linePos+2, -inset, 28), u"Reports glyphs that change number of cw/ccw paths (‘shapeshift’) in interpolation.", sizeStyle='small', selectable=True )
		linePos += int(lineHeight*1.7)
		
		self.w.text_1 = vanilla.TextBox( (inset, linePos+2, 85, 14), "Count paths in", sizeStyle='small' )
		self.w.checkInstances = vanilla.PopUpButton( (inset+85, linePos, -inset, 17), ("constructed instances midway between masters", "all active instances in font", "all active and inactive instances in font"), callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		self.w.alsoCheckMasters = vanilla.CheckBox( (inset, linePos-1, -inset, 20), "Add masters as instances", value=False, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		self.w.onlyCheckSelection = vanilla.CheckBox( (inset, linePos-1, -inset, 20), "Limit to selected glyphs (otherwise all glyphs)", value=False, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		self.w.ignoreGlyphsWithoutPaths = vanilla.CheckBox( (inset, linePos-1, -inset, 20), "Ignore glyphs without paths", value=False, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		self.w.ignoreNonexportingGlyphs = vanilla.CheckBox( (inset, linePos-1, -inset, 20), "Ignore glyphs that do not export", value=False, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		self.w.openTab = vanilla.CheckBox( (inset, linePos-1, -inset, 20), "Open found shapeshifters in a new tab", value=True, callback=self.SavePreferences, sizeStyle='small' )
		linePos += lineHeight
		
		self.w.progress = vanilla.ProgressBar((inset, linePos, -inset, 16))
		self.w.progress.set(0) # set progress indicator to zero
		linePos+=lineHeight
		
		# Run Button:
		self.w.runButton = vanilla.Button( (-80-inset, -20-inset, -inset, -inset), "Find", sizeStyle='regular', callback=self.FindShapeshiftingGlyphsMain )
		self.w.setDefaultButton( self.w.runButton )
		
		# Load Settings:
		if not self.LoadPreferences():
			print("Note: 'Find Shapeshifting Glyphs' could not load preferences. Will resort to defaults")
		
		# Open window and focus on it:
		self.w.open()
		self.w.makeKey()
    def __init__(self):
        self.w = vanilla.FloatingWindow((150, 45), ".ssXX")

        self.w.popUpButton = vanilla.PopUpButton(
            (10, 10, -90, 20), [str(i + 1) for i in range(20)])
        self.w.make_button = vanilla.Button((-80, 12, -15, 17),
                                            "Create",
                                            sizeStyle='small',
                                            callback=self.addSuffix)

        self.w.open()
예제 #29
0
 def __init__(self):
     
     self.fontList = AllFonts()
     self.fontNames = [getFontName(f) for f in self.fontList]
     
     self.w = vanilla.Window((300, 200), "Build Rotated Masters")
     
     self.w.descriptionText = vanilla.TextBox((10, 10, -10, 50), "Rotate a UFO that has “3D Projection View” glyph depth data. Nine UFO masters and a designSpace file will be created.", sizeStyle="small")
     
     self.w.fontChoice = vanilla.PopUpButton((10, 60, -10, 25), self.fontNames)
     
     self.w.glyphChoice = vanilla.PopUpButton((10, 90, -10, 25), ["All glyphs", "Selected glyphs"])
     
     self.w.outlineBox = vanilla.CheckBox((10, 125, -10, 25), "Outline Paths", callback=self.outlineChanged)
     self.w.outlineAmount = NumberEditText((115, 125, 50, 25), "90", 
         allowFloat=False, allowNegative=False, minimum=1)
     self.w.outlineAmount.enable(False)
     self.w.unitsTitle = vanilla.TextBox((170, 129, -10, 25), "units")
     
     self.w.copyButton = vanilla.SquareButton((10, 165, -10, 25), "Rotate!", callback=self.rotateFont)
     self.w.open()
예제 #30
0
    def __init__(self):

        self.debug = False

        # Glyph and font data
        self.glyph = None
        self.LIBKEY = "com.andyclymer.zPosition"
        self.pointData = {}  # dict of x,y,z for each pointID

        self.tempPath = tempfile.mkstemp()[1]
        self.tempHTMLPath = self.tempPath + ".html"

        self.w = vanilla.Window((620, 740),
                                "3D Projection Preview",
                                autosaveName="ProjectionPreview")
        self.w.bind("resize", self.windowResizedCallback)

        topHeight = 65
        self.w.refreshButton = vanilla.SquareButton(
            (10, 10, 130, 25),
            "Reload glyph data",
            callback=self.refreshPreviewCallback,
            sizeStyle="small")

        x = 150
        self.w.zoomScaleChoice = vanilla.PopUpButton(
            (x, 10, 70, 25), ["50%", "75%", "100%", "150%"],
            sizeStyle="small",
            callback=self.refreshPreviewCallback)
        self.w.zoomScaleChoice.set(2)
        self.w.strokeWidth = vanilla.EditText((x + 90, 10, 40, 25), "90")
        self.w.strokeWidth.enable(False)
        self.w.doStrokeBox = vanilla.CheckBox(
            (x + 140, 10, 100, 25),
            "Stroke",
            sizeStyle="small",
            value=False,
            callback=self.refreshPreviewCallback)

        self.w.note = vanilla.TextBox(
            (10, 43, -10, 25),
            "Note: Requires an internet connection for the Zdog library to load, http://www.zzz.dog/",
            sizeStyle="small")

        # Web view
        self.w.webView = WebView.alloc().initWithFrame_(((0, 0), (500, 500)))
        self.w.scroll = vanilla.ScrollView((10, topHeight, -10, -10),
                                           self.w.webView,
                                           hasHorizontalScroller=False,
                                           hasVerticalScroller=False)

        self.w.open()
        self.refreshPreviewCallback(None)