This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
It works, but only for thin outlines. If i make the outline thicker, the sharp points in the text (in letters like A, M or W) get overly "stretched". Please see the attached picture, it's hard to describe this effect.
As a workaround, I tried to use transformations and the fill() command to "draw a rectangle" with the text in a for-cycle in black and then fill() the text in white in the middle of it. This approach works great, but is really very slow and I would need to resize the text dynamically in my program
This is the code I'm using with the original method I found in the tutorial:
This is a method in my Text class, so there are variables like color, borderRatio which are available. It seems to me that this is a bug in text outlining which happens with very sharp points in the text. Is there any way around it, some settings that can resolve this issue? Or any workaround (except the one I mentioned)?
There are no new questions, but there may be new answers.
Joined: Jan 04, 2006
Thanks Darryl for your reply, it made me try the example from java2s and when I was adding setStroke command I realized that the constructor of BasicStroke can have more parameters, played with it a bit and resolved the issue:
Basically anything apart from BasicStroke.JOIN_MITER as the third parameter will do.
Petr Vasicek wrote:Thanks Darryl for your reply, it made me try the example from java2s and when I was adding setStroke command I realized that the constructor of BasicStroke can have more parameters, played with it a bit and resolved the issue: