The dimensions in the `DWRITE_GLYPH_METRICS` are a bit special:
the `rightSideBearing` is measured from the right edge of the
character boundary, not the left edge.
So, doing (right - left) would usually return a negative or very
small number, which, when casted to a u32 in an unsafe block, would
silently overflow to a very large number and make webrender crash.
Therefore, in order to calculate the metrics correctly, we have
to first calculate the full width of the character, then subtract
the right and left edges, same width the height.
I'm pretty confident that it is only thread safe if FK is (or another way of putting it is, I'm pretty sure if you include an `Rc<_>` in FK it should not be safe to share between threads).
This doesn't break meshes the way the previous "discard if too thin"
code did. It fixes several issues observed on Wikipedia when using
Pathfinder in Firefox.
Closes#72.
This removes a whole lot of code from `pathfinder_path_utils`. Hopefully
the remaining code can go upstream.
These changes regress quality of stroke widths for cubic curves, because
they move fill-to-stroke conversion before cubic-to-quadratic
conversion. To fix that, we will need to recursively subdivide when
doing fill-to-stroke conversion.
I'm not too happy with this, as I discovered a segfault in FreeType that doesn't give me confidence
in this as a solution for the long term. Additionally, this exposes the problems in the partitioner
with lack of winding fill rule, proper handling of self-intersections, and splitting of paths at
their extrema. (I believe these problems should be fairly straightforward to handle, but we just
don't handle them yet.)