robotools / defconappkit Goto Github PK
View Code? Open in Web Editor NEWA set of vanilla extensions for font editing applications.
License: MIT License
A set of vanilla extensions for font editing applications.
License: MIT License
I just discussed this with @benkiel, who encouraged me to open this issue.
My setup is Robofont Version 3.3b (build 1905221146) on macOS 10.14.5. I noticed some slow scrolling behavior in the Font Overview, and could isolate the source to be the GlyphCollectionView.
My observation is that any window using the GlyphCollectionView is scrolling very slowly. It’s easy to max out the CPU by just scrolling up and down in a glyph window – both in Robofont and the DefconAppKit Test App. The “rubberband bounce” effect at the bottom and top of the window is not smooth.
Overall it seems there is a large load on the CPU when scrolling – which of course gets worse the bigger the UFO gets.
I don’t know where to start with this, but I’d be glad to help out.
It is possible to have a total of 7 postscriptBlueValues, which results in a list of 14 number pairs.
This line indicates that this amount is in fact expected, however I regularly experience overflow. Here is a typical list of numbers:
-16 0 516 528 532 544 551 563 628 640 652 668 710 722
Hi, I don't know what exactly I'm doing wrong.
In the code below I'm trying to create a glyphLineView
from defcon import Font
from defconAppKit.controls.glyphLineView import GlyphLineView
from defconAppKit.controls.glyphSequenceEditText import GlyphSequenceEditText
from vanilla import Window, Slider
class Demo:
def __init__(self):
self.font = Font("some/path/to/ufo")
x,y,p,btnH,txtH = 10, 10, 10,22,17
try:
self.w = Window((200, 200), "Demo", minSize=(100, 100))
self.w.lineViewSizeSlider = Slider((x, y, -p, btnH), minValue=10, maxValue=500, value=100,
continuous=True, callback=self.lineViewResize)
y += p + btnH
self.w.textInput = GlyphSequenceEditText((x, y, -p, btnH), self.font, callback=self.lineViewTextInput)
y += p + btnH
self.w.testView = GlyphLineView((x, y, -p, -p))
self.w.testView.setShowLayers(True)
self.w.testView.setPointSize(200)
self.w.open()
except:
# Error. Print exception.
import traceback
print(traceback.format_exc())
def lineViewTextInput(self, sender):
try:
glyphs = sender.get()
self.w.testView.set(glyphs)
except:
# Error. Print exception.
import traceback
print(traceback.format_exc())
def lineViewResize(self, sender):
self.w.testView.setPointSize(sender.get())
# Demo()
if __name__ == "__main__":
from vanilla.test.testTools import executeVanillaTest
executeVanillaTest(Demo)
This is the output that I'm getting whenever I'm trying to write something using GlyphSequenceEditText instance.
local variable 'strokeColor' referenced before assignment
Any idea what am I doing wrong?
Best
R
In drawing.py, the contour and component drawing is handled with separate pens. This is fine if the contour and component colors are different, but if they are the same, they both need to be drawn with the same pen to properly display winding directions. To solve this, introduce a new pen* (and factory) that has them combined and test the colors before choosing the paths to use.
*Or maybe combine the two NSBezierPaths into one?
I'm testing some stuff in RoboFont, I think I found the bug:
from vanilla import FloatingWindow, List, ImageListCell
from defconAppKit.representationFactories.glyphCellFactory import GlyphCellFactory
class LastGlyphs:
rowHeight = 50
def __init__(self):
self.w = FloatingWindow((100,100+22),minSize=(100,100),maxSize=(100,5000))
if CurrentGlyph():
image = GlyphCellFactory(
glyph=CurrentGlyph(),
width=100,
height=self.rowHeight,
drawHeader=False,
drawMetrics=False
)
items = [
dict(image=image)
]
else:
items = []
self.w.glyphView = List((0,0,-0,-0),items,
rowHeight=self.rowHeight,
columnDescriptions=[
{"title": "image", "cell": ImageListCell()}
])
self.w.open()
if __name__=='__main__':
LastGlyphs()
self.font.layer in this line is a tuple. It doesn't have an argument `layerOrder.
In Robofont Version 4.1b (build 2110061420) I encountered the following problem which according to @typemytype might be related to the functionality of fontInfoView (or how Robofont interacts with it).
In a new font: Open Font Info, go to the Postscript sheet and enter 2 values into BlueValues. Hit okay. Go back to the Postscript Sheet and add a third value (one shouldn’t, I know) and click okay again. Open the Postscript sheet in the font info another time and all BlueValues entries are gone.
for layerName in self._placardLayerOptions.keys():
RuntimeError: dictionary changed size during iteration in
when setting the url field and no text is set it fails hard
see https://forum.robofont.com/topic/566/fontinfo-woff-description-url
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.