I'm looking for advice:

I want to deal with the placement of complex 2d shapes (say text), that are not convex and may contain holes etc. I need to be able to check for overlaps (collisions) between such shapes. The first thought that struck me was to look for 2d physics engines, but they seem mostly to deal with convex shapes. Furthermore I have no particular need of real-time systems but am more concerned with high accuracy and detail.

My second thought was OpenCV (computer vision) which I think will do what I want, but it's not really designed for this purpose and might be unnecessarily involved...

Is there any other open source system out there that I should look into? To summarize, need:

1. To define general non-convex 2d shapes
2. Check for collision

Thanks for any suggestions.