Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust code to the new (open!) text object #99

Open
kdzwinel opened this issue May 16, 2018 · 5 comments
Open

Adjust code to the new (open!) text object #99

kdzwinel opened this issue May 16, 2018 · 5 comments

Comments

@kdzwinel
Copy link
Collaborator

kdzwinel commented May 16, 2018

It looks like text object is no longer saved as a binary blob! It means that we can generate it with JS, which means that we may no longer need a Sketch plugin (in the long run) 🕺

{
                    "_class": "text",
                    "do_objectID": "363fb9fc-1f4e-4c53-b11b-9704da8e714f",
                    "exportOptions": {
                        "_class": "exportOptions",
                        "exportFormats": [],
                        "includedLayerIds": [],
                        "layerOptions": 0,
                        "shouldTrim": false
                    },
                    "frame": {
                        "_class": "rect",
                        "constrainProportions": false,
                        "height": 24,
                        "width": 101,
                        "x": 26,
                        "y": 0
                    },
                    "isFlippedHorizontal": false,
                    "isFlippedVertical": false,
                    "isLocked": false,
                    "isVisible": true,
                    "layerListExpandedType": 0,
                    "name": "One two three",
                    "nameIsFixed": false,
                    "resizingConstraint": 47,
                    "resizingType": 0,
                    "rotation": 0,
                    "shouldBreakMaskChain": false,
                    "userInfo": null,
                    "style": {
                        "_class": "style",
                        "endDecorationType": 0,
                        "miterLimit": 10,
                        "startDecorationType": 0
                    },
                    "attributedString": {
                        "_class": "attributedString",
                        "string": "One two three",
                        "attributes": [
                            {
                                "_class": "stringAttribute",
                                "location": 0,
                                "length": 13,
                                "attributes": {
                                    "underlineStyle": 0,
                                    "MSAttributedStringTextTransformAttribute": 0,
                                    "paragraphStyle": {
                                        "_class": "paragraphStyle",
                                        "alignment": 0,
                                        "lineHeightMultiple": 1,
                                        "maximumLineHeight": 24,
                                        "minimumLineHeight": 24
                                    },
                                    "strikethroughStyle": 0,
                                    "kerning": null,
                                    "MSAttributedStringFontAttribute": {
                                        "_class": "fontDescriptor",
                                        "attributes": {
                                            "name": "ProximaNova-Regular",
                                            "size": 16
                                        }
                                    },
                                    "MSAttributedStringColorAttribute": {
                                        "_class": "color",
                                        "alpha": 1,
                                        "blue": 0,
                                        "green": 0,
                                        "red": 0
                                    }
                                }
                            }
                        ]
                    },
                    "automaticallyDrawOnUnderlyingPath": false,
                    "dontSynchroniseWithSymbol": false,
                    "glyphBounds": "{{0, 6}, {101, 12}}",
                    "lineSpacingBehaviour": 2,
                    "textBehaviour": 0
                }
@kdzwinel kdzwinel changed the title Text object is open! Adjust code to the new (open!) text object May 16, 2018
@kdzwinel
Copy link
Collaborator Author

kdzwinel commented Jul 5, 2018

most of the heavy lifting was alrady done in airbnb/react-sketchapp#359 we need to migrate this over

@phun-ky
Copy link

phun-ky commented Jul 20, 2018

+1 +1

I am pulling my hair now trying to use sketch, the asketch to sketch plugin on macos in virtualbox in windows, I think just using JS would leave my hair intact!

@kdzwinel btw, will this completely remove the need to use the asketch2sketch.plugin? And if so, can html-sketchapp then generate a sketch library file instead of having to use sketchapp on a mac to do it?

@phun-ky
Copy link

phun-ky commented Oct 7, 2019

Any traction on this? <3

@phun-ky
Copy link

phun-ky commented Dec 19, 2019

Any traction on this? :) <3

@coderitual
Copy link
Collaborator

hey @phun-ky , We're looking at this to evaluate the effort needed. It's not number 1 priority at the moment as it still would require to use mac to generate sketch file (as mentioned in here: airbnb/react-sketchapp#359 NSAttributedString is needed to measure the dimension of a sketch layer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants