Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Solved
    • Unsolved
    1. Home
    2. Recent
    Log in to post
    • All categories
    • Announcements
    • General Questions
    • Feature Requests
    • Problems & Bugs
    • Extensions
    • Documentation
    • Tools Corner
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics

    • jesentanadi

      SOLVED Adding text to CurrentGlyphView
      General Questions • user interface observers • • jesentanadi  

      13
      0
      Votes
      13
      Posts
      2263
      Views

      okaytype

      Thanks, Frederik. I couldn't figure that out, but I did figure out I could subclass the vanilla elements. I think this approach will work better for what I'm doing. from vanilla import * from mojo.events import addObserver, removeObserver from AppKit import NSApp, NSColor, NSTextAlignmentCenter, NSTextAlignmentRight, NSTextAlignmentLeft debug = True class OverlayViewController(object): def __init__(self): windowname = 'debug window ui test' if debug == True: self.w = Window((500, 50), windowname) self.w.bind("close", self.windowClose) for window in [w for w in NSApp().orderedWindows() if w.isVisible()]: if window.title() == windowname: window.close() self.w.open() self.view = None addObserver(self, 'addToGlyphView', 'glyphWindowWillOpen') def windowClose(self, sender): print('removing observer') removeObserver(self, "glyphWindowWillOpen") def addToGlyphView(self, notification): self.window = notification["window"] x, y, w, h = xywh = (0, 0, -0, 22) this = self.testGV = Group(xywh) this.text1 = SubClassedEditText(xywh, '-', window=self.window, sizeStyle='mini', continuous=False) self.window.addGlyphEditorSubview(this) class SubClassedEditText(EditText): def __init__(self, *args, **kwargs): self.window = kwargs['window'] del kwargs['window'] super(SubClassedEditText, self).__init__(*args, **kwargs) this = self.getNSTextField() this.setBezeled_(False) this.setBackgroundColor_(NSColor.redColor()) this.setAlignment_(NSTextAlignmentCenter) addObserver(self, "currentGlyphChanged", "currentGlyphChanged") def currentGlyphChanged(self, info): try: g = self.window.getGlyph() if g is None: return f = g.getParent() self.set(f.info.styleName + ' ' + g.name) except: pass def _breakCycles(self): super(SubClassedEditText, self)._breakCycles() removeObserver(self, "currentGlyphChanged") OverlayViewController()
    • RafaŁ Buchner

      SOLVED disable/enable tool without deleting/installing extensions?
      General Questions • editing tools events • • RafaŁ Buchner  

      4
      2
      Votes
      4
      Posts
      255
      Views

      frederik

      Why do you need those tool objects? Im trying to understand your question ;)
    • RafaŁ Buchner

      SOLVED Is there any way to track what character set was used in sorting?
      General Questions • scripting sorting glyphs • • RafaŁ Buchner  

      3
      0
      Votes
      3
      Posts
      224
      Views

      RafaŁ Buchner

      thanks! :)
    • bahman

      UNSOLVED Getting the command for a menu item
      General Questions • keyboard shortcuts • • bahman  

      1
      0
      Votes
      1
      Posts
      153
      Views

      bahman

      Hi, this is a rather odd request! It's possible to get menu shortcuts using the getMenuShortCuts in mojo.UI, I was wondering if I can also access its command? I want to introduce shortcuts through a tool that conflicts with RF default keys like "⌘s" or "⌘⇧s" and I want to replace them to "␣s" or "␣⇧s" when the tool is active. But now I want to fire the command that saves the active UFO when the user hits "␣s", it's possible through font.save() but I'm not sure if it works for "Save as" or other menu items. So I want to access the command itself so I don't have to redefine it. Thanks!
    • StephenNixon

      SOLVED Can I make hidden folders within my robofont scripts folder?
      General Questions • • StephenNixon  

      9
      0
      Votes
      9
      Posts
      409
      Views

      frederik

      In the case where your script becomes a package, this could idd fail, as import will not find the correct py files. I guess a strategy where the main.py (the symlinked one) adds the package to sys.path and imports the required bits and pieces to be executed...
    • StephenNixon

      UNSOLVED Can I use utf8 characters in script menuTitle strings?
      General Questions • scripting user interface • • StephenNixon  

      5
      0
      Votes
      5
      Posts
      228
      Views

      StephenNixon

      Amazing, thanks!
    • StephenNixon

      SOLVED Is it possible to export to from Space Center to a multi-page or tall-page PDF?
      General Questions • space center mojo.ui • • StephenNixon  

      13
      0
      Votes
      13
      Posts
      581
      Views

      gferreira

      @StephenNixon this will give you the current width & height of the Space Center window: from mojo.UI import CurrentSpaceCenter (x, y), (w, h) = CurrentSpaceCenter().getNSView().bounds() print(w, h)
    • StephenNixon

      SOLVED Can UFO-specific extension settings be stored in a property list (.plist) file, in the UFO?
      General Questions • ufo custom data plist • • StephenNixon  

      7
      0
      Votes
      7
      Posts
      315
      Views

      StephenNixon

      @gferreira Awesome, thanks for making it so clear! Okay, yes, this is very easy to work with, now.
    • StephenNixon

      What backup strategies do UFO-making folks use?
      General Questions • • StephenNixon  

      6
      2
      Votes
      6
      Posts
      637
      Views

      frederik

      BlackBlaze time machine on network HD Git is used as a version control system, not really a backup
    • gferreira

      SOLVED drag and drop between vanilla lists
      General Questions • vanilla • • gferreira  

      4
      0
      Votes
      4
      Posts
      269
      Views

      gferreira

      @RafaŁ-Buchner that’s it!! thank you very much.
    • ryan

      SOLVED Smooth corners and handle behavior
      General Questions • user interface user interaction points handles smooth • • ryan  

      3
      0
      Votes
      3
      Posts
      387
      Views

      ryan

      Amazing! Thanks @gferreira
    • okaytype

      SOLVED mojo canvas mouseEntered
      General Questions • • okaytype  

      4
      1
      Votes
      4
      Posts
      269
      Views

      okaytype

      This works perfectly. Thanks for the update. If anyone else wants to play, here's a simpler canvas test script : from AppKit import NSApp from vanilla import * from mojo.canvas import CanvasGroup from mojo.drawingTools import rect, fill debug = True class CanvasTest(object): def __init__(self): windowname = 'Canvas Test' if debug == True: for window in [w for w in NSApp().orderedWindows() if w.isVisible()]: if window.title() == windowname: window.close() self.w = Window((500, 500), windowname, fullSizeContentView=False) self.w.g = CanvasGroup((100, 100, -100, -100), delegate=CanvasStuff()) self.w.open() class CanvasStuff(object): def draw(self): fill(.5, .2, 1,1) rect(0, 0, 600, 600) def mouseDown(self, event): print('mouseDown') def mouseUp(self, event): print('mouseUp') def mouseDragged(self, event): print('mouseDragged') def mouseEntered(self, event): print('mouseEntered') def mouseExited(self, event): print('mouseExited') CanvasTest()
    • StephenNixon

      SOLVED Preserve empty glyphs when applying defcon sort order through script
      General Questions • fontparts template glyphs glyph order sorting glyphs • • StephenNixon  

      3
      0
      Votes
      3
      Posts
      289
      Views

      StephenNixon

      @gferreira said in Preserve empty glyphs when applying defcon sort order through script: newGlyphOrder = f.naked().unicodeData.sortGlyphNames(f.templateGlyphOrder, sortDescriptors=[dict(type="cannedDesign", ascending=True, allowPseudoUnicode=True)]) f.templateGlyphOrder = newGlyphOrder Oh, interesting! Sure enough, changing glyphOrder to templateGlyphOrder fixed my script. It now works just as hoped. :) Thanks so much for point out that difference to me!
    • ddaanniiieeelll

      SOLVED Scale drawings on canvas while zooming
      General Questions • scale notifications zoom • • ddaanniiieeelll  

      3
      1
      Votes
      3
      Posts
      228
      Views

      ddaanniiieeelll

      Works great! Thanks a lot :)
    • StephenNixon

      SOLVED Sometimes, when I try to run a script, it just opens in the scripting window. Why?
      General Questions • keyboard shortcuts • • StephenNixon  

      8
      0
      Votes
      8
      Posts
      687
      Views

      StephenNixon

      Interesting solution. Sounds good to me! Thanks for figuring out a way to solve this. :)
    • martin

      SOLVED compileGlyph and glyphConstruction
      General Questions • components glyph construction accented glyphs • • martin  

      6
      0
      Votes
      6
      Posts
      372
      Views

      martin

      @gferreira thank you, that's perfect. I also noticed you added a my favorite autoUnicodes() function :)
    • StephenNixon

      SOLVED Robofont remote scripting seems to expect python 2 to be the main system python?
      General Questions • • StephenNixon  

      5
      0
      Votes
      5
      Posts
      239
      Views

      frederik

      Oh yeah, I’ve already changed this in the RF3.3 beta... soon!!
    • StephenNixon

      SOLVED Can I open the Output Window from a script? What about from a remote script? (I'm so close!)
      General Questions • • StephenNixon  

      3
      0
      Votes
      3
      Posts
      197
      Views

      StephenNixon

      @ThunderNixon said in Can I open the Output Window from a script? What about from a remote script? (I'm so close!): from mojo.UI import OutputWindow I'm nearly positive that I tried that, and it didn't work, so I threw in the open() to see whether it made a difference. The good news is, it's working now, so either I hit a temporary bug, or I formulated a false memory in my head. If OutputWindow().show() fails in the future, I'll loop back on this. Thank you!
    • StephenNixon

      UNSOLVED How might I remove overlap in contours without erasing points along path?
      General Questions • contours interpolation remove overlap • • StephenNixon  

      3
      0
      Votes
      3
      Posts
      251
      Views

      StephenNixon

      Thanks for weighing in! Just to be clear, I'm not necessarily expecting things to stay magically compatible – I only am looking for a way to remove overlaps, but leave any points intact that are on the exterior of that combined shape. I think you understood my meaning already, but my initial image was pretty ambiguous, so this shows my general hope better: So, it sounds like the way the Remove Overlap functionality works, it's not that these points are removed as an extra step, but rather that their removal is a core part of the function? And there's no way to "turn that off"? As a simple temporary solution, I have found that I can at least have a visual of missing points by duplicating the glyph to an "overlap" layer, then turning that layer's visibility on. You could run a pre-overlap code getting points that are going to be removed... and add them back in a post-overlap script Is there some kind of accessible list of points to be removed (that doesn't seem very likely), or would I have to find a way to loop through points, and mathematically determine if they're on a straight path?
    • andreas

      SOLVED Anchors
      General Questions • components glyph construction accented glyphs anchors • • andreas  

      5
      0
      Votes
      5
      Posts
      820
      Views

      gferreira

      hi @jhera, there are multiple ways to build accented glyphs in RoboFont. these are described here: Building accented glyphs have you tried using the Glyph Construction extension? in 2019 you don’t really need anchors to position diacritics anymore :) you can still use them (with or without underscore), but you can also use guidelines, variables, vertical metrics attributes, reference positions, etc. have a look at the docs & give it a try!