Re: [ft-devel] one question answered, and another comes (Re: FT_Bitmap_Convert, and FreeType's bitmap format vs Cairo's)

Hin-Tak Leung <[email protected]>
Newsgroups gmane.comp.lib.cairo,gmane.comp.fonts.freetype.devel
Message-ID <[email protected]>
--------------------------------------------
On Tue, 25/4/17, Alexei Podtelezhnikov <[email protected]> wrote:

...
> > How does one check if
 two shapes overlap, or two paths intersect, in
 cairo?
 
> Check if you
 have pixels with coverage more than 1. If coverage is
 capped at 1, render the components individually
 and see if the total
 coverage of individual
 components exceeds the coverage of the
 combo.

Thanks. I'll have a thought about it some more.

To put things in context, here is what I have now, with freetype-py +pycairo:

https://github.com/rougier/freetype-py/issues/45#issuecomment-297070166

I only managed to get the individial rectangle enclosing each 'Hello' not to overlap.

The original example is very slow and loop overs the pixels as a numerical array in various places.
However, it actually does the dot-product of currently-trying-to-ink part with the already-inked part,
so it can pack the 'Hello' a lot tighter, as it allows the containing ranctangle to overlap as long as the glyphs
themselves do not.

Certainly it is possible to dig in the pixels in C and sum them - the objective of the exercise is really rather how far using just scripting language without compiling C code can go :- ). (doing vector sums and loop over pixels in a scripting language is slow...)
-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.