ryanbugden / eyeliner Goto Github PK
View Code? Open in Web Editor NEWRoboFont extension that highlights points that are aligned with vertical metrics or guides.
License: Other
RoboFont extension that highlights points that are aligned with vertical metrics or guides.
License: Other
... as opposed to the current state, it just looks like the the line has split into three paths instead of 2.
Try drawing fill symbol in background, same color as substrate.
May be too fussy, but worth a try.
I love this extension. Wondering if anchor alignment could also be supported?
Each set of eyes should only correspond to their own glyph window
This is a great extension! Wondering if you might support Blue Zones as well?
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'
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
.
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)
)
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.