0

I'm working on a small design project, part of which involved writing out text in a given font such that the letters of a word are just touching each other on their right and left sides.

I've thought of implementing this as follows - create GlyphVectors of two letters, create Shape objects using vector.getOutline(), then create Area objects and intersect them.

The only thing I'm missing with this method is the ability to shift the second letter to the right until the intersect is empty.

Is there a way to do this, or do I need to use a different approach?

TIA

eta: ok, I've figured out I can use AffineTransform. Now, is there a way to tell the size (surface area) of the Area created by the intersection of two letters?

Erwin
  • 93
  • 1
  • 5

1 Answers1

0

How precise do you want this to be? Pixel precision is much easier to attain than vector precision. Have you considered linearisation (usually done through

public PathIterator getPathIterator(AffineTransform at, double flatness)

) of outlines and then doing search in opposite directions among all points? This seems to be the most obvious solution even though it is not vector-precise.

Andrew Butenko
  • 395
  • 1
  • 8