[cairo] The line still blurry after I follow "Frequently Asked Questions" guide
cworth at cworth.org
Mon May 4 19:51:01 UTC 2020
On Sun, May 03 2020, mustodo wrote:
> So, how should I do to draw a sharp with single-pixel-wide line like
> code editor?
Here's my best advice:
1. Get (or make) a piece of graph paper, (paper with printed vertical
and horizontal lines to form a grid of uniform squares.
2. Label the line of the graph paper with integers.
3. Plot the points of the path that you are constructing in cairo.
Note: If you are filling the path, skip step 4.
4. If you are going to stroke the path, plot new points that are
separated orthogonally from the line segments of step (3) at a
distance of one-half the current stroke width.
Now, if all of the lines you drew in step (3), for cairo_fill, or in
step (4), for cairo_strike, lie precisely on the integer, printed lines
of your graph paper, then you should be seeing sharp results, (and
you should also not need to set CAIRO_ANTIALIAS_NONE to achieve that).
Good luck. And have fun with cairo!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 832 bytes
Desc: not available
More information about the cairo