Commit Graph

40 Commits

Author SHA1 Message Date
Sebastian Köln 3d0e911c3e fix #219 (minimum stroke thickness) 2019-08-10 18:35:56 +03:00
est31 3928e8d964 Rename the feature text → pf-text 2019-08-05 22:49:08 +02:00
est31 38df17696a Put the text stuff into separate files 2019-07-27 19:18:10 +02:00
est31 fa1a32bdbb Make text rendering optional in pathfinder_canvas 2019-07-27 06:13:02 +02:00
Sebastian Köln e12821350e fix canvas 2019-07-16 09:55:01 +03:00
Sebastian Köln 6acab74fae Merge branch 'master' of https://github.com/servo/pathfinder 2019-07-16 09:43:37 +03:00
Patrick Walton 2c984de1ea Add convenience translation, rotation, and scaling methods to `Transform2D` 2019-07-12 11:34:48 -07:00
Patrick Walton 1eb28a5539 Fix incorrect definition of 2D transform multiplication 2019-07-12 11:26:09 -07:00
Patrick Walton bcac119324 Rename `Transform2DF` to `Transform2F` and `Transform3DF` to `Transform4F` 2019-07-11 14:59:10 -07:00
Sebastian Köln 251785db67 cleanup 2019-06-25 11:39:31 +03:00
Sebastian Köln 17f0e50878 Merge https://github.com/servo/pathfinder 2019-06-24 18:23:10 +03:00
Sebastian Köln 2a129b7bbd add CanvasRenderingContext2D::fill_layout – a method to draw layouts directly, without using skribo 2019-06-24 16:12:05 +03:00
Patrick Walton 431dcf3d2e Rename `pathfinder_geometry::basic` to simply `pathfinder_geometry`, and move
the remaining code in that crate to a new crate, `pathfinder_content`

The old hierarchy was confusing.
2019-06-21 10:06:19 -07:00
Patrick Walton 0012f09eeb Fix examples 2019-06-20 21:43:57 -07:00
Patrick Walton 7973148603 Implement basic shadows (no blur yet) 2019-06-03 21:09:04 -07:00
Patrick Walton bd248bf850 Implement line dash offset 2019-06-03 19:36:08 -07:00
Patrick Walton 1a42bbf4d3 Implement dashing for line segments (no curves yet) 2019-06-03 14:16:58 -07:00
Patrick Walton a1b0df0a42 Rename `Point2DF` to `Vector2F`, `Point3DF` to `Vector4F`, and `LineSegmentF`
to `LineSegment2F`.

Straw poll on Twitter suggested that these names were preferred.
2019-06-03 12:39:29 -07:00
Patrick Walton 678b6f12c7 Add support for counterclockwise winding to arcs 2019-06-01 12:56:31 -07:00
Patrick Walton 44167beff5 Implement `Path2D::arc_to`. 2019-05-31 16:01:53 -07:00
Patrick Walton 0b9a41c533 Treat the miter limit as part of the canvas state, allowing it to be saved and
restored even if miter joins are not in use.

In my opinion, this behavior is less logical, but it matches the behavior of
the HTML canvas API, which we aim to remain close to.
2019-05-30 21:39:08 -07:00
Patrick Walton 95f3337c6f Add the `ellipse` method to canvas paths 2019-05-30 17:24:12 -07:00
Patrick Walton 9756aa89f9 Base the core arc primitive on a unit chord and transform.
This lets us handle ellipses better.
2019-05-30 17:19:21 -07:00
Patrick Walton 607a518544 Implement canvas text align 2019-05-30 15:08:15 -07:00
Patrick Walton 8d078ff345 Add an initial implementation of canvas `measureText` 2019-05-30 12:38:32 -07:00
Patrick Walton 9138e1e0bb Pass in the font context to the canvas rendering context constructor so that it
can be reused.

Creating a system font source can do I/O on some platforms, so obviously we
don't want to do it every frame.
2019-05-29 21:15:42 -07:00
Patrick Walton e1bcc11ace Change the `F32` and `I32` suffixes to `F` and `I` to match the C API.
They're shorter and less noisy.
2019-05-29 19:17:16 -07:00
Patrick Walton 51877426ea Take paths by reference, not by value, in outline stroke-to-fill. 2019-05-29 15:15:40 -07:00
Patrick Walton e04cc273ee Add enough C bindings to recreate `canvas_minimal` in C.
Closes #12.
2019-05-25 20:21:38 -07:00
Patrick Walton e282eb57d5 Implement interior miter line joins (not yet endpoints) 2019-05-16 11:10:15 -07:00
Patrick Walton 272b63a017 Implement square line caps 2019-05-16 10:43:43 -07:00
Patrick Walton 6eab3fa2d8 Implement `globalAlpha` for canvas 2019-05-14 18:26:10 -07:00
Patrick Walton 7518fa65c0 Update dependencies 2019-05-13 18:47:19 -07:00
Patrick Walton c7382a8b2c Add affine transform support to the canvas implementation 2019-05-13 18:40:25 -07:00
Patrick Walton f24d93819b Add arc building methods and switch the Moiré demo to use them.
Also, stop taking points by reference in many methods, for consistency.
2019-05-13 12:42:13 -07:00
Patrick Walton a5d373cb91 Rename "object" to "path" in preparation for image objects 2019-05-10 12:03:38 -07:00
Patrick Walton a078766dc6 Implement basic text rendering in canvas with `skribo` and `font-kit`.
Skribo currently writes some debugging info to standard output. A patch is
forthcoming to fix that.
2019-05-09 15:21:18 -07:00
Patrick Walton 3ba4ce117c Add graphics state saving and restoration to the canvas API 2019-05-03 17:45:01 -07:00
Patrick Walton a86a87a670 Allow fill and stroke colors to be changed 2019-05-03 17:37:27 -07:00
Patrick Walton 9de7d95d33 Start a simple HTML canvas-like API, and add a minimal example to show how to
use it.
2019-05-03 14:15:38 -07:00