Skip to content

Conversation

willmurnane
Copy link
Collaborator

No description provided.

main/deepnest.js Outdated

// assuming no intersections, return a tree where odd leaves are parts and even ones are holes
// might be easier to use the DOM, but paths can't have paths as children. So we'll just make our own tree.
this.getParts = function (paths, filename) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimately this entire function should be removable. I started stripping out pieces of it as I replaced the functionality with the typescript stuff.

s = require("../dist/tsc/svgparser.js");
window.SvgParser = new s.SvgParser(new f.FontFactory());
console.log(s);
</script>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the entrypoint to the ts code is.

Comment on lines +4 to +9
export abstract class Curve {
abstract linearize(tol: number): Array<Point>;
abstract start(): Point;
abstract end(): Point;
abstract toString(): String;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This encapsulates functionality for "path-like things" that can be turned into polygons with some "tolerance", so that we can use polygon-oriented Minkowski for everything, but still handle all of SVG paths.

constructor() {
}

get(name: String) : opentype.Font {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be replaceable with some kind of browser API, I think? This works on my Mac, but is obviously Wrong and Bad. I only used it because I was originally building in a non-browser context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not be bad. opentype.Font works crossplattform

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants