I am working on reading in some svg fonts and neede the Qq and Tt commands so
I've implemented them.
My first tests show some pretty good results.
Just add these after case A,a and before the default case in doPath in
SVGParser.
case 'T':
case 't': {
wasCurve = true;
float x = ph.nextFloat();
float y = ph.nextFloat();
if (cmd == 't') {
x += lastX;
y += lastY;
}
float x1 = 2 * lastX - lastX1;
float y1 = 2 * lastY - lastY1;
p.cubicTo( lastX, lastY, x1, y1, x, y );
lastX = x;
lastY = y;
lastX1 = x1;
lastY1 = y1;
break;
}
case 'Q':
case 'q': {
wasCurve = true;
float x1 = ph.nextFloat();
float y1 = ph.nextFloat();
float x = ph.nextFloat();
float y = ph.nextFloat();
if (cmd == 'q') {
x += lastX;
y += lastY;
x1 += lastX;
y1 += lastY;
}
p.cubicTo( lastX, lastY, x1, y1, x, y );
lastX1 = x1;
lastY1 = y1;
lastX = x;
lastY = y;
break;
}
Enjoy!
Original issue reported on code.google.com by m...@j-roen.net on 5 Jun 2012 at 11:09
Original issue reported on code.google.com by
m...@j-roen.net
on 5 Jun 2012 at 11:09