Font font = new Font(device, CurvesSWTTab.getPlatformFont(), 16, SWT.ITALIC);
gc.setFont(font);
gc.setLineWidth(2);
Transform transform;
// ----- letter s -----
sXPos = 4 * width / 16;
sYPos = (height - 150) / 2;
transform = new Transform(device);
transform.translate(sXPos, sYPos);
gc.setTransform(transform);
transform.dispose();
gc.setForeground(device.getSystemColor(SWT.COLOR_DARK_BLUE));
gc.drawString(GraphicsExample.getResourceString("Cubic"), 0, 175, true);
Path path = new Path(device);
path.cubicTo(-200 + sDiffX1, 50 + sDiffY1, 200 + sDiffX2, 100 + sDiffY2, 0, 150);
gc.drawPath(path);
path.dispose();
// draw the spline points
gc.setTransform(null);
gc.drawRectangle(sRect1.x + (int) sXPos, sRect1.y + (int) sYPos, sRect1.width, sRect1.height);
gc.drawRectangle(sRect2.x + (int) sXPos, sRect2.y + (int) sYPos, sRect2.width, sRect2.height);
// ----- letter w -----
wXPos = 6 * width / 16;
wYPos = (height - 150) / 2;
transform = new Transform(device);
transform.translate(wXPos, wYPos);
gc.setTransform(transform);
transform.dispose();
gc.setForeground(device.getSystemColor(SWT.COLOR_GRAY));
gc.drawString(GraphicsExample.getResourceString("Quadratic"), 0, -50, true);
gc.drawString(GraphicsExample.getResourceString("Quadratic"), 110, -50, true);
path = new Path(device);
path.quadTo(100 + wDiffX1, 300 + wDiffY1, 100, 0);
path.quadTo(100 + wDiffX2, 300 + wDiffY2, 200, 0);
gc.drawPath(path);
path.dispose();
gc.setTransform(null);
gc.drawRectangle(wRect1.x + (int) wXPos, wRect1.y + (int) wYPos, wRect1.width, wRect1.height);
gc.drawRectangle(wRect2.x + (int) wXPos, wRect2.y + (int) wYPos, wRect2.width, wRect2.height);
// ----- top of letter t -----
topTXPos = 11 * width / 16;
topTYPos = (height - 150) / 2;
transform = new Transform(device);
transform.translate(topTXPos, topTYPos);
gc.setTransform(transform);
transform.dispose();
gc.setForeground(device.getSystemColor(SWT.COLOR_YELLOW));
gc.drawString(GraphicsExample.getResourceString("Cubic"), 25, -50, true);
path = new Path(device);
path.cubicTo(33 + tTopDiffX1, -20 + tTopDiffY1, 66 + tTopDiffX2, 20 + tTopDiffY2, 100, 0);
gc.drawPath(path);
path.dispose();
gc.setTransform(null);
gc.drawRectangle(tTopRect1.x + (int) topTXPos, tTopRect1.y + (int) topTYPos, tTopRect1.width, tTopRect1.height);
gc.drawRectangle(tTopRect2.x + (int) topTXPos, tTopRect2.y + (int) topTYPos, tTopRect2.width, tTopRect2.height);
// ----- vertical bar of letter t -----
botTXPos = 12 * width / 16;
botTYPos = (height - 150) / 2;
transform = new Transform(device);
transform.translate(botTXPos, botTYPos);
gc.setTransform(transform);
transform.dispose();
gc.setForeground(device.getSystemColor(SWT.COLOR_RED));
gc.drawString(GraphicsExample.getResourceString("Cubic"), 0, 175, true);
path = new Path(device);