11.92 Sample ‘pendelta

Example of pendelta for lines and glyphs smoothing.

MGL code:

quality 6
list a 0.25 0.5 1 2 4
for $0 0 4
pendelta a($0)
define $1 0.5*$0-1
line -1 $1 1 $1 'r'
text 0 $1 'delta=',a($0)
next

C++ code:

void smgl_pendelta(mglGraph *gr)
{
	double a[5]={0.25,0.5,1,2,4};
	gr->SetQuality(6);
	char buf[64];
	for(int i=0;i<5;i++)
	{
		gr->SetPenDelta(a[i]);
		gr->Line(mglPoint(-1,0.5*i-1), mglPoint(1,0.5*i-1),"r");
		sprintf(buf,"delta=%g",a[i]);
		gr->Puts(mglPoint(0,0.5*i-1),buf);
	}
}
Sample pendelta