Code Monkey home page Code Monkey logo

defconappkit's Introduction

defconAppKit

A set of vanilla extensions for font editing applications.

defconappkit's People

Contributors

andyclymer avatar benkiel avatar jenskutilek avatar letterror avatar miguelsousa avatar roberto-arista avatar typemytype avatar typesupply avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

defconappkit's Issues

GlyphCollectionView uses lots of CPU

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.

Possible bug in defconAppKit.representationFactories.glyphCellFactory

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()

for layerName in reversed(layers.layerOrder):

self.font.layer in this line is a tuple. It doesn't have an argument `layerOrder.

[fontInfoView] BlueValues lost when number of values is odd

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).

Steps to reproduce

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.

Can't create a glyphLineView: getting "variable referenced before assigment" error

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

FontInfo window to narrow for expected ps Blue Values

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

Modify contour and component drawing.

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?

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.