Giter Club home page Giter Club logo

Comments (10)

schriftgestalt avatar schriftgestalt commented on August 24, 2024
del(Layer.shapes[0])

from glyphssdk.

Mark2Mark avatar Mark2Mark commented on August 24, 2024

Thanks!

Is there an easy way to distinguish between paths and components?
When a user wants to only delete either or.
I know one could type check as on objc, but for the regular python user? It’s not all too clear with the .shapes I think.

  • The documentation needs an update then. del(layer.paths[0])del(Layer.shapes[0])

from glyphssdk.

florianpircher avatar florianpircher commented on August 24, 2024

You can use shapeType.

from glyphssdk.

Mark2Mark avatar Mark2Mark commented on August 24, 2024

Thanks!

Should anyone add that to the Documentation?

from glyphssdk.

florianpircher avatar florianpircher commented on August 24, 2024

I linked to the documentation. Or what other documentation do you use?

from glyphssdk.

Mark2Mark avatar Mark2Mark commented on August 24, 2024

Didn’t see that it is a link. I also linked mine, though (twice 😉 )
Tried to point y’all to the part under GSLayer > paths, where it says:

# access all paths
for path in layer.paths:
print(path)
# delete path
del(layer.paths[0]) # <------------- this is what I am talking about.
# copy paths from another layer
import copy
layer.paths = copy.copy(anotherlayer.paths)

from glyphssdk.

florianpircher avatar florianpircher commented on August 24, 2024

Yes, that part is wrong.

from glyphssdk.

Mark2Mark avatar Mark2Mark commented on August 24, 2024

I’d love to help with the docu, but I have no access or clue how it is generated. Hence I can only drop all my findings here.

from glyphssdk.

schriftgestalt avatar schriftgestalt commented on August 24, 2024

The docu is generated from the comments in the wrapper file. It uses a script to extract the comments and then uses sphinx to build the html. https://github.com/schriftgestalt/GlyphsSDK/tree/Glyphs3/ObjectWrapper/Sphinx%20Documentation

from glyphssdk.

schriftgestalt avatar schriftgestalt commented on August 24, 2024

The formatting is a bit tricky (indentation and empty lines). I can clean it up if needed.

from glyphssdk.

Related Issues (20)

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.