Git Product home page Git Product logo

eyeliner's People

Contributors

connordavenport avatar frankrolf avatar ryanbugden avatar

Watchers

 avatar

eyeliner's Issues

Support for anchors?

I love this extension. Wondering if anchor alignment could also be supported?

AttributeError: 'NoneType' object has no attribute 'extensionContainer'

The extension misfires if the UFO is being opened concurrently with RF (RF is closed > Open UFO with... > RF). I think this is because the Glyph Window needs to be open before any "extension container" is recognized.

********************
Installing 'Eyeliner' report:
  Traceback (most recent call last):
      File "usher.py", line 24, in <module>
      File "/Applications/RoboFont_4p.app/Contents/Resources/lib/python3.7/mojo/subscriber.py", line 1415, in __init__
      File "/Users/Ryan/Library/Application Support/RoboFont/plugins/Eyeliner.roboFontExt/lib/eyelinerRF4.py", line 24, in build
    AttributeError: 'NoneType' object has no attribute 'extensionContainer'

Eye should appear _while_ Transforming

Having the eye appear before mouseUp, in the midst of a Transform operation would be helpful.

This will require building in some sort of 0.49 unit threshold (refer to how RF does rounding), as the points are natively only rounded with with the Transform tool on mouseUp.

eyeliner eye with merz symbols

was playing with merz

# run inside the merz playground extension

from merz.tools.drawingTools import NSImageDrawingTools


def eyelinerSymbolFactory(
        radius,
        stretch=0.7,
        strokeColor=(0, 0, 0, 1),
        strokeWidth=1
        ):
    # calcute the width and height
    width = radius * 6 * stretch * 2 + strokeWidth * 2
    height = radius * 2 + strokeWidth * 2
    # create a image draw bot 
    bot = NSImageDrawingTools((width, height))
    # get a pen
    pen = bot.BezierPath()
    # draw the eye
    pen.moveTo((6 * radius * stretch, 0))
    pen.curveTo(
        (2 * radius * stretch, 0),
        (1.25 * radius * stretch, -radius),
        (0, -radius))
    pen.curveTo(
        (-1.25 * radius * stretch, -radius),
        (-2 * radius * stretch, 0),
        (-6 * radius * stretch, 0))
    pen.curveTo(
        (-2 * radius * stretch, 0),
        (-1.25 * radius * stretch, radius),
        (0, radius))
    pen.curveTo(
        (1.25 * radius * stretch, radius),
        (2 * radius * stretch, 0),
        (6 * radius * stretch, 0))
    pen.closePath()

    bot.fill(None)
    bot.stroke(*strokeColor)
    bot.strokeWidth(strokeWidth)
    bot.translate(width / 2, height / 2)
    bot.drawPath(pen)
    # return the image
    return bot.getImage()

# register the factory
merz.SymbolImageVendor.registerImageFactory("eyeliner.eye", eyelinerSymbolFactory)

######## the can happen in a separate script

# add your symbol
symbolLayer = container.appendSymbolSublayer(
    position=(100, 100),
    imageSettings=dict(
        name="eyeliner.eye",
        radius=10, 
        strokeColor=(1, 0, 0.77, 1)       
    )
)

symbolLayer = container.appendSymbolSublayer(
    position=(200, 100),
    imageSettings=dict(
        name="eyeliner.eye",
        radius=10, 
        stretch=.3,
        strokeColor=(1, 0, 0.77, 1)       
    )
)

symbolLayer = container.appendSymbolSublayer(
    position=(300, 100),
    rotation=30,
    imageSettings=dict(
        name="eyeliner.eye",
        radius=10, 
        stretch=.3,
        strokeColor=(1, 0, 0.77, 1)       
    )
)

symbolLayer = container.appendSymbolSublayer(
    position=(400, 100),
    rotation=40,
    imageSettings=dict(
        name="eyeliner.eye",
        radius=10, 
        stretch=.3,
        strokeColor=(0, 1, 0.77, 1)       
    )
)

image

cc @typesupply @roberto-arista

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.