I have some code setup in an extended view which does some drawings which are easily scaled (vector-like). (My scale is setup as 0-1.0)
I noticed that when I set my paint fill to FILL, the text drawn on a path looks correct, but when I set the fill to stroke (I just want the outline of the text) the image looks like it is on some LSD trip. Here is my sample code :
Paint yellowPaint = Paints.getFillTextPaint(0.01f, 0xFFffea3e, 0.065f);
canvas.drawTextOnPath(mContext.getString(R.string.building_a_partnership),
Paths.getRoundedTextPath(mOuterCircleRectF, 280f, 350f),
0, -0.025f, yellowPaint);
public static Paint getFillTextPaint(float f, int color, float textSize) {
Paint textPaint = new Paint();
textPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
textPaint.setStyle(Paint.Style.FILL);
textPaint.setColor(color);
textPaint.setTextSize(textSize);
textPaint.setStrokeWidth(f);
textPaint.setShadowLayer(0.002f, 0.0f, 0.0f, 0xFF000000);
textPaint.setTypeface(Typeface.SANS_SERIF);
return textPaint;
}
If I change the Paint.Style from FILL to STROKE I get the images below. I have used the canvas.drawText() and it works fine showing the stroked letters. It is only when it is applied to a Path, when it seems to get all weird.
Apparently this is due to the fact that my scale factor is 0-1.. There appears to be a bug w/ how rendering a stroke with size < 1.0 is treated. Suggested solution is to use a scale of 0-100..