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

Font selection for text layers #585

Merged
merged 26 commits into from Apr 21, 2022
Merged

Font selection for text layers #585

merged 26 commits into from Apr 21, 2022

Conversation

0HyperCube
Copy link
Member

@0HyperCube 0HyperCube commented Apr 16, 2022

Closes #504
Closes #529
Closes #508

  • Fetch fonts and put them into dropdown in the properties panel
  • TextArea to add to text properties
  • Download selected font and render.

@cloudflare-pages
Copy link

cloudflare-pages bot commented Apr 16, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9dbde20
Status: ✅  Deploy successful!
Preview URL: https://4b905e63.graphite-master.pages.dev

View logs

@Keavon
Copy link
Member

Keavon commented Apr 17, 2022

Glad to see this coming along, nice work! Just some quick comments while I notice them (you're probably already aware of these, but here are some nice checkboxes to serve as reminders):

  • We'll want the tool's options bar to have the font selection also
  • And that means renaming the font size from "Font" to "Size"
  • And in the Properties panel, we also want a Size field
    Excited to see this come along!

@0HyperCube 0HyperCube marked this pull request as ready for review April 17, 2022 11:00
@Keavon
Copy link
Member

Keavon commented Apr 17, 2022

This works great!

  • How feasible would it be to remove the built-in font now? This would reduce our wasm build size by a couple megabytes. But I realize that means it has nothing to default to when you first start typing. Although I suppose that's no different than first picking a different font before you start typing. So that's probably the best tradeoff?
  • Can we have a "Style" dropdown to pick the different weights/italics/other variants? (Both in the options bar and properties panel.)

@0HyperCube
Copy link
Member Author

  • How feasible would it be to remove the built-in font now? This would reduce our wasm build size by a couple megabytes. But I realize that means it has nothing to default to when you first start typing. Although I suppose that's no different than first picking a different font before you start typing. So that's probably the best tradeoff?

I have removed the font (although it was only one style and was ~200kB) and instead load it when the editor is initialised (so we don't hang if the user goes offline and then types text for the first time).

  • Can we have a "Style" dropdown to pick the different weights/italics/other variants? (Both in the options bar and properties panel.)

Done

@Keavon
Copy link
Member

Keavon commented Apr 17, 2022

  • It would be great if we can apply the (specific variant of the) font to the editing mode (foreign element in the SVG).
  • The term "Style" not "Variant" is more standard.

We should talk about how to make the CtrlB and CtrlI shortcuts work to switch into/out of bold and italic styles. We'll need some way to detect a weight (like figuring out where "regular" fits into the numbered weights which is usually 400 but doesn't have to be) and italics/oblique-or-not value and then intelligently pick sane default weights for bolded and non-bolded. Mixing font weights/styles in the same line of text will get even more interesting. Not in scope for this PR though.

This branch is reminding me that I definitely also need to prioritize some work on improving the Properties panel's horizontal scrolling and layout flexbox behavior to prevent horizontal scrollbars and the mess they cause with floating menus. That'll also improve with the fix you made in #583 once merged. For now, the user can make it usable by just widening the Properties/Layer panels column.

I built a Cloudflare Workers worker to proxy the Google Fonts API (with some caching), so you don't have to include your API key in the final build. It's using one I created for Graphite now, so you can go ahead and deactivate your testing API key (which is now visible on the public internet forever).

@Keavon Keavon changed the title Add font dropdown Font selection for text layers Apr 18, 2022
@Keavon
Copy link
Member

Keavon commented Apr 18, 2022

I'm also noticing that it takes a bit of time (maybe ~1/3 of a second) to display a populated FontInput widget, during which time the UI hangs. This happens when switching to the Text tool (so the options bar displays it) or selecting a text layer (so the Properties panel displays it). I assume this is time spent serializing and deserializing in the process of sending the data from the backend to the frontend. I wonder if there's any way we can change the architecture so that data lives readily available on the frontend, or it gets streamed to the widget on scroll, or it gets loaded asynchronously in order to not hang the main UI thread.

@0HyperCube
Copy link
Member Author

This branch is reminding me that I definitely also need to prioritize some work on improving the Properties panel's horizontal scrolling and layout flexbox behavior to prevent horizontal scrollbars and the mess they cause with floating menus. That'll also improve with the fix you made in #583 once merged. For now, the user can make it usable by just widening the Properties/Layer panels column.

I also can't seem to get the height for the textarea to be more than one row without breaking the css @Keavon.

@0HyperCube
Copy link
Member Author

0HyperCube commented Apr 18, 2022

I'm also noticing that it takes a bit of time (maybe ~1/3 of a second) to display a populated FontInput widget, during which time the UI hangs. This happens when switching to the Text tool (so the options bar displays it) or selecting a text layer (so the Properties panel displays it). I assume this is time spent serializing and deserializing in the process of sending the data from the backend to the frontend. I wonder if there's any way we can change the architecture so that data lives readily available on the frontend, or it gets streamed to the widget on scroll, or it gets loaded asynchronously in order to not hang the main UI thread.

@Keavon The fonts and variants list is kept in js in a local variable inside fonts.ts. The rust only sends and receives strings for the variant, the font name and the file path. I would assume the slowness comes from adding ~8400 dom nodes but I'm not really sure how to profile it or what to do about it.

@0HyperCube
Copy link
Member Author

We should talk about how to make the CtrlB and CtrlI shortcuts work to switch into/out of bold and italic styles. We'll need some way to detect a weight (like figuring out where "regular" fits into the numbered weights which is usually 400 but doesn't have to be) and italics/oblique-or-not value and then intelligently pick sane default weights for bolded and non-bolded. Mixing font weights/styles in the same line of text will get even more interesting. Not in scope for this PR though.

In the font list, the regular variant is always called regular and italic always ends in italic with regular italic just being italic. CSS always maps bold to 700 and normal to 400 so I don't think we should complicate it further as long as we don't stop the user from choosing any variant. We can fake italic by applying a skew as well as faking bold if the variant does not exist. Mixed styles is just a case of loading a new font and laying out the text span in that font but starting from the last position, although we also need to handle if there are fonts with different line heights on the same line. The mixed styles can be stored as Vec<{span_content: String, font: String}>. Making this work with content editable whilst you are typing would be challenging though.

@Keavon
Copy link
Member

Keavon commented Apr 18, 2022

I also can't seem to get the height for the textarea to be more than one row without breaking the css

I was working earlier on improving that by making TextAreaInput reuse FieldInput (which I extended to use both <input> and <textarea>), with CSS to handle proper visual display. However I broke the event handler functionality and didn't have time to debug it. I can push that if you'd be willing to help find the cause of the event handling no longer working. (Edit: I pushed it.)

The fonts and variants list is kept in js in a local variable inside fonts.ts. The rust only sends and receives strings for the variant, the font name and the file path. I would assume the slowness comes from adding ~8400 dom nodes but I'm not really sure how to profile it or what to do about it.

Indeed, I profiled this just now and it looks like it is mostly a bunch of Vue functions running. That'll be something to improve in the future. I also would love the FontInput widget to display previews of the fonts someday, although that would require a lot of loading. To reduce the loading, we'd make it load only the ones visible at the moment, and we can use that same idea to only populate the DOM elements for the ones visible.

In the font list, the regular variant is always called regular and italic always ends in italic with regular italic just being italic. CSS always maps bold to 700 and normal to 400 so I don't think we should complicate it further as long as we don't stop the user from choosing any variant. We can fake italic by applying a skew as well as faking bold if the variant does not exist. Mixed styles is just a case of loading a new font and laying out the text span in that font but starting from the last position, although we also need to handle if there are fonts with different line heights on the same line. The mixed styles can be stored as Vec<{span_content: String, font: String}>. Making this work with content editable whilst you are typing would be challenging though.

It looks like you are right about this, it's more standardized than I realized. (Very thin fonts on Google Fonts, like this one, which only have one style should maybe be weight 100 in reality, but it still lists it as 400/regular.) So the code should be pretty simple. Replace "regular" with "400" and "italic" with "400italic", then find the ones ending in `"italic", and use 400 for regular and 700 for bold. CtrlB switches the current weight to 700 if currently lower than 700 or to 400 if current at or above 700. CtrlI switches from the non-italics version to the italics version of the closest weight to the current weight.

  • We might also want to clean up the ugly API names that show up in the dropdown menu by matching them to the closest name in this list, perhaps with the numerical weight in parenthesis, like: Regular (400) or Extra Bold (800) or Extra Bold (825), the last example being in the event of a weird weight that matches to the closest name but shows the exact number).

///
/// assert_eq!(intersections, vec![vec![shape_id]]);
/// ```
fn intersects_quad(&self, quad: Quad, path: &mut Vec<LayerId>, intersections: &mut Vec<Vec<LayerId>>);
fn intersects_quad(&self, quad: Quad, path: &mut Vec<LayerId>, intersections: &mut Vec<Vec<LayerId>>, font_cache: &FontCache);
Copy link
Member

Choose a reason for hiding this comment

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

For this and all these other functions related to transformation, it seems pretty inappropriate to have to pass the font cache here. Can the cache instead live as a reference on struct Layer? Presumably that means lifetimes may get tricky, or perhaps that's even illogical to make Graphene handle that. Maybe give a copy of the data to Graphene? I'm not really sure what the best solution is here. @TrueDoctor perhaps you have any thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Keavon Don't think so (unless we use something from std::sync), as we need to get mutable access to the font cache (i.e. dropping all other references) when we load a new font.

@0HyperCube 0HyperCube requested a review from mfish33 April 20, 2022 17:30
Copy link
Member

@Keavon Keavon left a comment

Choose a reason for hiding this comment

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

I'm so pumped for this feature, it's really, really awesome.

@0HyperCube 0HyperCube merged commit a7431be into master Apr 21, 2022
@0HyperCube 0HyperCube deleted the font-properties branch April 21, 2022 08:50
FlorentCollin pushed a commit to FlorentCollin/Graphite that referenced this pull request May 2, 2022
* Add font dropdown

* Add fonts

* Font tool options

* Fix tests

* Replace http with https

* Add variant selection

* Do not embed default font

* Use proxied font list API

* Change default font to Merriweather

* Remove outdated comment

* Specify font once & load font into foreignobject

* Fix tests

* Rename variant to font_style

* Change TextAreaInput to use FieldInput (WIP, breaks functionality)

* Fix textarea functionality

* Fix types

* Add weight name mapping

* Change labeling of "Italic"

* Remove commented HTML node

* Rename font "name" to "font_family" and "file" "font_file"

* Fix errors

* Fix fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Keavon added a commit that referenced this pull request May 10, 2022
* Add font dropdown

* Add fonts

* Font tool options

* Fix tests

* Replace http with https

* Add variant selection

* Do not embed default font

* Use proxied font list API

* Change default font to Merriweather

* Remove outdated comment

* Specify font once & load font into foreignobject

* Fix tests

* Rename variant to font_style

* Change TextAreaInput to use FieldInput (WIP, breaks functionality)

* Fix textarea functionality

* Fix types

* Add weight name mapping

* Change labeling of "Italic"

* Remove commented HTML node

* Rename font "name" to "font_family" and "file" "font_file"

* Fix errors

* Fix fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Keavon added a commit that referenced this pull request May 11, 2022
* changed path_intersection structure

* comment

* Removed do_if!

* Create project website with near-complete home page

* Added support for undoing
    - i gotta say the undo system is quite nice

* Website responsive resizing improvements

* Add newsletter signup to website

* Pen tool fixes (#563)

Resolves 3 known bugs with the pen tool.

* Fixed crash pointed out by @caleb-ad

* Fixed issue with final path segment losing handle data

* Replace curves with lines when under a drag threshold, improves usability.

* Readability improvements, improved comments

* Color Input (#565)

* initial working prototype

* clean up component

* Fix alignment

* Code review tweaks

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Made the non-inclusive end of a pathseg less inclusive
Fixed Bug: When doing a closepath it is possible that the current and beginning edge are both None
Fixed Numerous other things

* changed how closepath works
modified how overlapping_curve_intersections is working

* Add "New Folder"/"Delete Selected" buttons to layer panel

Closes #532

* Update npm dependencies

* Set text color based on its fill when it's being edited

* Reorder tool icons, update favicon and logo, and other icon cleanup

* Bug Fix: Line-Line intersect origin wasn't being preserved

* Bug Fix: proper assignment of t_values in overlapping_curve_intersections

* Honestly, i don't even know what I was thinking when i wrote the logic for splitting a subcurve at endpoints, but it was wrong.

* Feature: overlapping rectangles behave properly, (except when intersections aren't found correctly)

* Remake node type icons (closes #483); color picker cleanup

* Change tool shelf icon colors to use classes not style

* Add Image node icon and rename node from Path to Shape

* Bug Fix: proper intersection construction in partial overlap case

* cleaned up log statements

* Add website revisions and many new pages

* Add features page and fixes to website

* Fix clippy lints and update packages (#568)

* Fix type error in Brave browser (#569)

* Small website text improvements

* Various website fixes

* Adjusted constants
Rearranged intersection algorithm

* Changed BooleanOperation::SubtractBack to use SubtractFront
Added composite_boolean_operation for operations with more than one shape

* Add node graph mockup to website

* Differentiate between scale and dimensions (#570)

* Differentiate between scale and dimensions

* Fix layout and naming of properties

* Add embedable images (#564)

* Add embedable bitmaps

* Initial work on blob urls

* Finish implementing data url

* Fix some bugs

* Rename bitmap to image

* Fix loading image on document load

* Add transform properties for image

* Remove some logging

* Add image dimensions

* Implement system copy and paste

* Fix pasting images

* Fix test

* Address code review

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bump minimist from 1.2.5 to 1.2.6 in /frontend (#571)

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix panic dialogue when handling a message (#573)

* Fix panic dialogue when handling a message

* Fix indents for github reporting

* More whitespace improvements

* Save: line_intersection

* Add documentation to many parts of the Rust codebase (#552)

* add lots of doccomments

* add conversion traits from layerdatatypes to layers

* add suggested doc improvements

* Code review changes

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add additional stroke properties (#582)

* Add aditional stroke properties

* Add comment explaining clones for closure

* Improve labels

* Fix doc test

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bug Fix: .y not .x

* Expand upon the "Announcing Graphite alpha" blog post

* All shapes now have a Fill in the properties panel; color inputs are now optional (#583)

* Add aditional stroke properties

* Make the colour input optional

* Fix fmt

* Apply code review changes

* Code review nitpicks

* Fix recursion

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* New blog post: "Distributed computing with the Graphene runtime"

* Fix gradient transformation (#588)

* Fix with perfect circle

* Actually fix rotated gradient

* Gradient transform & fix on rotated canvas

* Cleanup & remove logging

* Add properties panel entries for artboards (#572)

* Artboards can have properties

* fix crash when renaming artboards

* moved target document to utility types

* moved import and added test for file version information

* fixed missing import

* fix error from merging

* - typed properties message handler data
- removed name from WidgetRow

* clippy warnings

* artboards have seperate properties section

* - color input can be forced to have selection
- crop tool shows on switch
- select tool shows on switch

* variable renamed

* change to use PropType<boolean> instead of PropType<Boolean>

* Add an artboard icon

* Add the "Delete Artboard" hint

* fix unselect glitch

* even better

* Remove the Transform properties group

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bug Fix: boolean union on multiple shapes

* Font selection for text layers (#585)

* Add font dropdown

* Add fonts

* Font tool options

* Fix tests

* Replace http with https

* Add variant selection

* Do not embed default font

* Use proxied font list API

* Change default font to Merriweather

* Remove outdated comment

* Specify font once & load font into foreignobject

* Fix tests

* Rename variant to font_style

* Change TextAreaInput to use FieldInput (WIP, breaks functionality)

* Fix textarea functionality

* Fix types

* Add weight name mapping

* Change labeling of "Italic"

* Remove commented HTML node

* Rename font "name" to "font_family" and "file" "font_file"

* Fix errors

* Fix fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Improvements to the layer transform cage UX (#589)

* Allow input system to handle mousedown while dragging

* Fix abort

* Add apsect ratio

* Make comment more explicit

* Fix abort when dragging

* Constrain when dragging edge

* Rename Crop tool to Artboard tool

* Stop pointerdown event from properties panel (#600)

* Change stroke weight from ints to floats (#601)

Also rename stroke "width" to "weight" in some places. Closes #587

* Change stroke weight from ints to floats

* "miter_limit" -> "line_join_miter_limit"

* Bump file format version

* cargo update
Prevent iterating beyond list bounds

* Bug fix: proper composite intersection behavior

* fix warnings

* Improved ray casting and common intersection cases

Finding intersections near path segment endpoints was previously unreliable
because of imprecision, and the necessity of avoiding double counting any
intersections. And, because of snapping, intersections on the endpoints
of path segments are a common case.
This also improved the ray casting use case, which previously used a "fudge factor"
to mitigate the common problem of casting a ray into line endpoints.

* fixed warnings

* Fix properties deselect (#606)

* Fix properties panel deselect

* Fix arrow cursors on select tool

* Fix drag from UI to document causing mouse down

* Fix tests

* Cleanup

* cleanup messages

* Draw the outlines of shapes on hover and selection (#609)

* Add hover outline overlay

* Increase selection tolerance

* Increase weight

* Only check if top intersection is selected

* Outline selected paths

* Reduce outline weight

* Increase path tool outline thickness to match hover

* Update to use unreachable! instead of panic!

* Upgrade vue-cli to version 5 (#594)

* Upgrade to Vue CLI 5 (fails to compile)

* Upgrade versions with last few weeks of changes

* Updated to fork-ts-checker-webpack-plugin 7.2.3

* Remove package.json overrides in lieu of the fixed fork-ts-checker-webpack-plugin@6.5.1

* Fix svg importing

* Comments

* For debugging only: added infrastructureLogging to vue.config.js

* Now works on Windows, waiting on fork-ts-checker-webpack-plugin backport if possible

* Switch to the fixed fork-ts-checker-webpack-plugin@6.5.2

* Fix license checker build compilation

Co-authored-by: 0hypercube <0hypercube@gmail.com>

* Tidy up the full frontend codebase and use optional chaining where possible (#620)

* Tidy up the full frontend codebase and use optional chaining where possible

* Code review changes

* Add a hotkey to select a random primary color (#622)

* Add shortcut to select a random primary color (#549)

* Rename random primary color message and reduce the number of calls to
generate_uuid

* Add documentation for SelectRandomPrimaryColor message

* Set the alpha value to 255 instead of a random value #622

Co-authored-by: Florent Collin <florentcollin23@gmail.com>

* Move the Layer Tree panel's New Folder and Delete icons into the options bar

* Migrate dialogs to Rust and add a New File dialog (#623)

* Migrate coming soon and about dialog to Rust

* Migrate confirm close and close all

* Migrate dialog error

* Improve keyboard navigation throughout UI

* Cleanup and fix panic dialog

* Reduce css spacing to better match old dialogs

* Add new document modal

* Fix crash when generating default name

* Populate rust about graphite data on startup

* Code review changes

* Move one more :focus CSS rule into App.vue

* Add a dialog message and move dialogs

* Split out keyboard input navigation from this branch

* Improvements including simplifying panic dialog code

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Snapping system improvements and refactor (#621)

* Snap to points and refactor

* Improve dot position on bounds

* Add snap matrix

* Cleanup

* Code review

* Half axis fade rather than increase it

* Fix fmt

* Hide snap to point overlay when active

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add the File > Export dialog and PNG/JPG downloading (#629)

* Add export dialog

* Code review changes

* More code review feedback

* Fix compilation on stable Rust

* Fixes to problems

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Code review

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Oliver Davies <oliver@psyfer.io>
Co-authored-by: mfish33 <32677537+mfish33@users.noreply.github.com>
Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Co-authored-by: TrueDoctor <dennis@kobert.dev>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alaska <simon.wuelker@arcor.de>
Co-authored-by: 0hypercube <0hypercube@gmail.com>
Co-authored-by: FlorentCollin <florentcollinpro@gmail.com>
Co-authored-by: Florent Collin <florentcollin23@gmail.com>
Keavon added a commit that referenced this pull request Jun 16, 2022
* Add font dropdown

* Add fonts

* Font tool options

* Fix tests

* Replace http with https

* Add variant selection

* Do not embed default font

* Use proxied font list API

* Change default font to Merriweather

* Remove outdated comment

* Specify font once & load font into foreignobject

* Fix tests

* Rename variant to font_style

* Change TextAreaInput to use FieldInput (WIP, breaks functionality)

* Fix textarea functionality

* Fix types

* Add weight name mapping

* Change labeling of "Italic"

* Remove commented HTML node

* Rename font "name" to "font_family" and "file" "font_file"

* Fix errors

* Fix fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Keavon added a commit that referenced this pull request Jun 16, 2022
* changed path_intersection structure

* comment

* Removed do_if!

* Create project website with near-complete home page

* Added support for undoing
    - i gotta say the undo system is quite nice

* Website responsive resizing improvements

* Add newsletter signup to website

* Pen tool fixes (#563)

Resolves 3 known bugs with the pen tool.

* Fixed crash pointed out by @caleb-ad

* Fixed issue with final path segment losing handle data

* Replace curves with lines when under a drag threshold, improves usability.

* Readability improvements, improved comments

* Color Input (#565)

* initial working prototype

* clean up component

* Fix alignment

* Code review tweaks

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Made the non-inclusive end of a pathseg less inclusive
Fixed Bug: When doing a closepath it is possible that the current and beginning edge are both None
Fixed Numerous other things

* changed how closepath works
modified how overlapping_curve_intersections is working

* Add "New Folder"/"Delete Selected" buttons to layer panel

Closes #532

* Update npm dependencies

* Set text color based on its fill when it's being edited

* Reorder tool icons, update favicon and logo, and other icon cleanup

* Bug Fix: Line-Line intersect origin wasn't being preserved

* Bug Fix: proper assignment of t_values in overlapping_curve_intersections

* Honestly, i don't even know what I was thinking when i wrote the logic for splitting a subcurve at endpoints, but it was wrong.

* Feature: overlapping rectangles behave properly, (except when intersections aren't found correctly)

* Remake node type icons (closes #483); color picker cleanup

* Change tool shelf icon colors to use classes not style

* Add Image node icon and rename node from Path to Shape

* Bug Fix: proper intersection construction in partial overlap case

* cleaned up log statements

* Add website revisions and many new pages

* Add features page and fixes to website

* Fix clippy lints and update packages (#568)

* Fix type error in Brave browser (#569)

* Small website text improvements

* Various website fixes

* Adjusted constants
Rearranged intersection algorithm

* Changed BooleanOperation::SubtractBack to use SubtractFront
Added composite_boolean_operation for operations with more than one shape

* Add node graph mockup to website

* Differentiate between scale and dimensions (#570)

* Differentiate between scale and dimensions

* Fix layout and naming of properties

* Add embedable images (#564)

* Add embedable bitmaps

* Initial work on blob urls

* Finish implementing data url

* Fix some bugs

* Rename bitmap to image

* Fix loading image on document load

* Add transform properties for image

* Remove some logging

* Add image dimensions

* Implement system copy and paste

* Fix pasting images

* Fix test

* Address code review

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bump minimist from 1.2.5 to 1.2.6 in /frontend (#571)

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix panic dialogue when handling a message (#573)

* Fix panic dialogue when handling a message

* Fix indents for github reporting

* More whitespace improvements

* Save: line_intersection

* Add documentation to many parts of the Rust codebase (#552)

* add lots of doccomments

* add conversion traits from layerdatatypes to layers

* add suggested doc improvements

* Code review changes

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add additional stroke properties (#582)

* Add aditional stroke properties

* Add comment explaining clones for closure

* Improve labels

* Fix doc test

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bug Fix: .y not .x

* Expand upon the "Announcing Graphite alpha" blog post

* All shapes now have a Fill in the properties panel; color inputs are now optional (#583)

* Add aditional stroke properties

* Make the colour input optional

* Fix fmt

* Apply code review changes

* Code review nitpicks

* Fix recursion

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* New blog post: "Distributed computing with the Graphene runtime"

* Fix gradient transformation (#588)

* Fix with perfect circle

* Actually fix rotated gradient

* Gradient transform & fix on rotated canvas

* Cleanup & remove logging

* Add properties panel entries for artboards (#572)

* Artboards can have properties

* fix crash when renaming artboards

* moved target document to utility types

* moved import and added test for file version information

* fixed missing import

* fix error from merging

* - typed properties message handler data
- removed name from WidgetRow

* clippy warnings

* artboards have seperate properties section

* - color input can be forced to have selection
- crop tool shows on switch
- select tool shows on switch

* variable renamed

* change to use PropType<boolean> instead of PropType<Boolean>

* Add an artboard icon

* Add the "Delete Artboard" hint

* fix unselect glitch

* even better

* Remove the Transform properties group

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bug Fix: boolean union on multiple shapes

* Font selection for text layers (#585)

* Add font dropdown

* Add fonts

* Font tool options

* Fix tests

* Replace http with https

* Add variant selection

* Do not embed default font

* Use proxied font list API

* Change default font to Merriweather

* Remove outdated comment

* Specify font once & load font into foreignobject

* Fix tests

* Rename variant to font_style

* Change TextAreaInput to use FieldInput (WIP, breaks functionality)

* Fix textarea functionality

* Fix types

* Add weight name mapping

* Change labeling of "Italic"

* Remove commented HTML node

* Rename font "name" to "font_family" and "file" "font_file"

* Fix errors

* Fix fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Improvements to the layer transform cage UX (#589)

* Allow input system to handle mousedown while dragging

* Fix abort

* Add apsect ratio

* Make comment more explicit

* Fix abort when dragging

* Constrain when dragging edge

* Rename Crop tool to Artboard tool

* Stop pointerdown event from properties panel (#600)

* Change stroke weight from ints to floats (#601)

Also rename stroke "width" to "weight" in some places. Closes #587

* Change stroke weight from ints to floats

* "miter_limit" -> "line_join_miter_limit"

* Bump file format version

* cargo update
Prevent iterating beyond list bounds

* Bug fix: proper composite intersection behavior

* fix warnings

* Improved ray casting and common intersection cases

Finding intersections near path segment endpoints was previously unreliable
because of imprecision, and the necessity of avoiding double counting any
intersections. And, because of snapping, intersections on the endpoints
of path segments are a common case.
This also improved the ray casting use case, which previously used a "fudge factor"
to mitigate the common problem of casting a ray into line endpoints.

* fixed warnings

* Fix properties deselect (#606)

* Fix properties panel deselect

* Fix arrow cursors on select tool

* Fix drag from UI to document causing mouse down

* Fix tests

* Cleanup

* cleanup messages

* Draw the outlines of shapes on hover and selection (#609)

* Add hover outline overlay

* Increase selection tolerance

* Increase weight

* Only check if top intersection is selected

* Outline selected paths

* Reduce outline weight

* Increase path tool outline thickness to match hover

* Update to use unreachable! instead of panic!

* Upgrade vue-cli to version 5 (#594)

* Upgrade to Vue CLI 5 (fails to compile)

* Upgrade versions with last few weeks of changes

* Updated to fork-ts-checker-webpack-plugin 7.2.3

* Remove package.json overrides in lieu of the fixed fork-ts-checker-webpack-plugin@6.5.1

* Fix svg importing

* Comments

* For debugging only: added infrastructureLogging to vue.config.js

* Now works on Windows, waiting on fork-ts-checker-webpack-plugin backport if possible

* Switch to the fixed fork-ts-checker-webpack-plugin@6.5.2

* Fix license checker build compilation

Co-authored-by: 0hypercube <0hypercube@gmail.com>

* Tidy up the full frontend codebase and use optional chaining where possible (#620)

* Tidy up the full frontend codebase and use optional chaining where possible

* Code review changes

* Add a hotkey to select a random primary color (#622)

* Add shortcut to select a random primary color (#549)

* Rename random primary color message and reduce the number of calls to
generate_uuid

* Add documentation for SelectRandomPrimaryColor message

* Set the alpha value to 255 instead of a random value #622

Co-authored-by: Florent Collin <florentcollin23@gmail.com>

* Move the Layer Tree panel's New Folder and Delete icons into the options bar

* Migrate dialogs to Rust and add a New File dialog (#623)

* Migrate coming soon and about dialog to Rust

* Migrate confirm close and close all

* Migrate dialog error

* Improve keyboard navigation throughout UI

* Cleanup and fix panic dialog

* Reduce css spacing to better match old dialogs

* Add new document modal

* Fix crash when generating default name

* Populate rust about graphite data on startup

* Code review changes

* Move one more :focus CSS rule into App.vue

* Add a dialog message and move dialogs

* Split out keyboard input navigation from this branch

* Improvements including simplifying panic dialog code

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Snapping system improvements and refactor (#621)

* Snap to points and refactor

* Improve dot position on bounds

* Add snap matrix

* Cleanup

* Code review

* Half axis fade rather than increase it

* Fix fmt

* Hide snap to point overlay when active

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add the File > Export dialog and PNG/JPG downloading (#629)

* Add export dialog

* Code review changes

* More code review feedback

* Fix compilation on stable Rust

* Fixes to problems

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Code review

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Oliver Davies <oliver@psyfer.io>
Co-authored-by: mfish33 <32677537+mfish33@users.noreply.github.com>
Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Co-authored-by: TrueDoctor <dennis@kobert.dev>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alaska <simon.wuelker@arcor.de>
Co-authored-by: 0hypercube <0hypercube@gmail.com>
Co-authored-by: FlorentCollin <florentcollinpro@gmail.com>
Co-authored-by: Florent Collin <florentcollin23@gmail.com>
Keavon added a commit that referenced this pull request Jul 30, 2023
* Add font dropdown

* Add fonts

* Font tool options

* Fix tests

* Replace http with https

* Add variant selection

* Do not embed default font

* Use proxied font list API

* Change default font to Merriweather

* Remove outdated comment

* Specify font once & load font into foreignobject

* Fix tests

* Rename variant to font_style

* Change TextAreaInput to use FieldInput (WIP, breaks functionality)

* Fix textarea functionality

* Fix types

* Add weight name mapping

* Change labeling of "Italic"

* Remove commented HTML node

* Rename font "name" to "font_family" and "file" "font_file"

* Fix errors

* Fix fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Keavon added a commit that referenced this pull request Jul 30, 2023
* changed path_intersection structure

* comment

* Removed do_if!

* Create project website with near-complete home page

* Added support for undoing
    - i gotta say the undo system is quite nice

* Website responsive resizing improvements

* Add newsletter signup to website

* Pen tool fixes (#563)

Resolves 3 known bugs with the pen tool.

* Fixed crash pointed out by @caleb-ad

* Fixed issue with final path segment losing handle data

* Replace curves with lines when under a drag threshold, improves usability.

* Readability improvements, improved comments

* Color Input (#565)

* initial working prototype

* clean up component

* Fix alignment

* Code review tweaks

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Made the non-inclusive end of a pathseg less inclusive
Fixed Bug: When doing a closepath it is possible that the current and beginning edge are both None
Fixed Numerous other things

* changed how closepath works
modified how overlapping_curve_intersections is working

* Add "New Folder"/"Delete Selected" buttons to layer panel

Closes #532

* Update npm dependencies

* Set text color based on its fill when it's being edited

* Reorder tool icons, update favicon and logo, and other icon cleanup

* Bug Fix: Line-Line intersect origin wasn't being preserved

* Bug Fix: proper assignment of t_values in overlapping_curve_intersections

* Honestly, i don't even know what I was thinking when i wrote the logic for splitting a subcurve at endpoints, but it was wrong.

* Feature: overlapping rectangles behave properly, (except when intersections aren't found correctly)

* Remake node type icons (closes #483); color picker cleanup

* Change tool shelf icon colors to use classes not style

* Add Image node icon and rename node from Path to Shape

* Bug Fix: proper intersection construction in partial overlap case

* cleaned up log statements

* Add website revisions and many new pages

* Add features page and fixes to website

* Fix clippy lints and update packages (#568)

* Fix type error in Brave browser (#569)

* Small website text improvements

* Various website fixes

* Adjusted constants
Rearranged intersection algorithm

* Changed BooleanOperation::SubtractBack to use SubtractFront
Added composite_boolean_operation for operations with more than one shape

* Add node graph mockup to website

* Differentiate between scale and dimensions (#570)

* Differentiate between scale and dimensions

* Fix layout and naming of properties

* Add embedable images (#564)

* Add embedable bitmaps

* Initial work on blob urls

* Finish implementing data url

* Fix some bugs

* Rename bitmap to image

* Fix loading image on document load

* Add transform properties for image

* Remove some logging

* Add image dimensions

* Implement system copy and paste

* Fix pasting images

* Fix test

* Address code review

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bump minimist from 1.2.5 to 1.2.6 in /frontend (#571)

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix panic dialogue when handling a message (#573)

* Fix panic dialogue when handling a message

* Fix indents for github reporting

* More whitespace improvements

* Save: line_intersection

* Add documentation to many parts of the Rust codebase (#552)

* add lots of doccomments

* add conversion traits from layerdatatypes to layers

* add suggested doc improvements

* Code review changes

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add additional stroke properties (#582)

* Add aditional stroke properties

* Add comment explaining clones for closure

* Improve labels

* Fix doc test

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bug Fix: .y not .x

* Expand upon the "Announcing Graphite alpha" blog post

* All shapes now have a Fill in the properties panel; color inputs are now optional (#583)

* Add aditional stroke properties

* Make the colour input optional

* Fix fmt

* Apply code review changes

* Code review nitpicks

* Fix recursion

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* New blog post: "Distributed computing with the Graphene runtime"

* Fix gradient transformation (#588)

* Fix with perfect circle

* Actually fix rotated gradient

* Gradient transform & fix on rotated canvas

* Cleanup & remove logging

* Add properties panel entries for artboards (#572)

* Artboards can have properties

* fix crash when renaming artboards

* moved target document to utility types

* moved import and added test for file version information

* fixed missing import

* fix error from merging

* - typed properties message handler data
- removed name from WidgetRow

* clippy warnings

* artboards have seperate properties section

* - color input can be forced to have selection
- crop tool shows on switch
- select tool shows on switch

* variable renamed

* change to use PropType<boolean> instead of PropType<Boolean>

* Add an artboard icon

* Add the "Delete Artboard" hint

* fix unselect glitch

* even better

* Remove the Transform properties group

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bug Fix: boolean union on multiple shapes

* Font selection for text layers (#585)

* Add font dropdown

* Add fonts

* Font tool options

* Fix tests

* Replace http with https

* Add variant selection

* Do not embed default font

* Use proxied font list API

* Change default font to Merriweather

* Remove outdated comment

* Specify font once & load font into foreignobject

* Fix tests

* Rename variant to font_style

* Change TextAreaInput to use FieldInput (WIP, breaks functionality)

* Fix textarea functionality

* Fix types

* Add weight name mapping

* Change labeling of "Italic"

* Remove commented HTML node

* Rename font "name" to "font_family" and "file" "font_file"

* Fix errors

* Fix fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Improvements to the layer transform cage UX (#589)

* Allow input system to handle mousedown while dragging

* Fix abort

* Add apsect ratio

* Make comment more explicit

* Fix abort when dragging

* Constrain when dragging edge

* Rename Crop tool to Artboard tool

* Stop pointerdown event from properties panel (#600)

* Change stroke weight from ints to floats (#601)

Also rename stroke "width" to "weight" in some places. Closes #587

* Change stroke weight from ints to floats

* "miter_limit" -> "line_join_miter_limit"

* Bump file format version

* cargo update
Prevent iterating beyond list bounds

* Bug fix: proper composite intersection behavior

* fix warnings

* Improved ray casting and common intersection cases

Finding intersections near path segment endpoints was previously unreliable
because of imprecision, and the necessity of avoiding double counting any
intersections. And, because of snapping, intersections on the endpoints
of path segments are a common case.
This also improved the ray casting use case, which previously used a "fudge factor"
to mitigate the common problem of casting a ray into line endpoints.

* fixed warnings

* Fix properties deselect (#606)

* Fix properties panel deselect

* Fix arrow cursors on select tool

* Fix drag from UI to document causing mouse down

* Fix tests

* Cleanup

* cleanup messages

* Draw the outlines of shapes on hover and selection (#609)

* Add hover outline overlay

* Increase selection tolerance

* Increase weight

* Only check if top intersection is selected

* Outline selected paths

* Reduce outline weight

* Increase path tool outline thickness to match hover

* Update to use unreachable! instead of panic!

* Upgrade vue-cli to version 5 (#594)

* Upgrade to Vue CLI 5 (fails to compile)

* Upgrade versions with last few weeks of changes

* Updated to fork-ts-checker-webpack-plugin 7.2.3

* Remove package.json overrides in lieu of the fixed fork-ts-checker-webpack-plugin@6.5.1

* Fix svg importing

* Comments

* For debugging only: added infrastructureLogging to vue.config.js

* Now works on Windows, waiting on fork-ts-checker-webpack-plugin backport if possible

* Switch to the fixed fork-ts-checker-webpack-plugin@6.5.2

* Fix license checker build compilation

Co-authored-by: 0hypercube <0hypercube@gmail.com>

* Tidy up the full frontend codebase and use optional chaining where possible (#620)

* Tidy up the full frontend codebase and use optional chaining where possible

* Code review changes

* Add a hotkey to select a random primary color (#622)

* Add shortcut to select a random primary color (#549)

* Rename random primary color message and reduce the number of calls to
generate_uuid

* Add documentation for SelectRandomPrimaryColor message

* Set the alpha value to 255 instead of a random value #622

Co-authored-by: Florent Collin <florentcollin23@gmail.com>

* Move the Layer Tree panel's New Folder and Delete icons into the options bar

* Migrate dialogs to Rust and add a New File dialog (#623)

* Migrate coming soon and about dialog to Rust

* Migrate confirm close and close all

* Migrate dialog error

* Improve keyboard navigation throughout UI

* Cleanup and fix panic dialog

* Reduce css spacing to better match old dialogs

* Add new document modal

* Fix crash when generating default name

* Populate rust about graphite data on startup

* Code review changes

* Move one more :focus CSS rule into App.vue

* Add a dialog message and move dialogs

* Split out keyboard input navigation from this branch

* Improvements including simplifying panic dialog code

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Snapping system improvements and refactor (#621)

* Snap to points and refactor

* Improve dot position on bounds

* Add snap matrix

* Cleanup

* Code review

* Half axis fade rather than increase it

* Fix fmt

* Hide snap to point overlay when active

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add the File > Export dialog and PNG/JPG downloading (#629)

* Add export dialog

* Code review changes

* More code review feedback

* Fix compilation on stable Rust

* Fixes to problems

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Code review

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Oliver Davies <oliver@psyfer.io>
Co-authored-by: mfish33 <32677537+mfish33@users.noreply.github.com>
Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Co-authored-by: TrueDoctor <dennis@kobert.dev>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alaska <simon.wuelker@arcor.de>
Co-authored-by: 0hypercube <0hypercube@gmail.com>
Co-authored-by: FlorentCollin <florentcollinpro@gmail.com>
Co-authored-by: Florent Collin <florentcollin23@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants