conv_contour函数auto_detect_orientation的字体应用

    AGG 回来了!!

1 提供如下的代码结构渲染字体

agg::conv_transform<...> conv (path,matrix);

agg::conv_curve<...> curve (conv);

agg::conv_contour<...> contour(curve);

 

curve.approximaltion_scale (scale);

contour.auto_detect_orientation (true);

contour.width (bold);

2 采用conv_contour的理由

为了放大或者缩小字体

3 采用auto_detect_orientation的理由

从上面的所有关于该函数的说明都知道conv_contour扩展轮廓线实际上是会根据图形绘制的方向而有所不同,逆时针绘制的图形和顺时针绘制的图形,扩展轮廓线刚好相反,所以需要调用auto_detect_orientation设置为true,屏蔽顺时针和逆时针之间的区别。有些英文字母绘制是顺时针的比如a,逆时针比如c,详细可参考上传的图片,windows自带的图片查看器可打开!!

Never mind the orientation (cw or ccw) ofthe paths. Both will

be handled in exactly the same way bysetting the auto_detect_

orientation to true, which is what I want,as I don't want some

paths to shrink and other to get expanded,depending on their

orientation.

 

If I want to enlarge the paths, I use apositive value for the

'bold' argument; a negative value willshrink the paths, with

various success, depending on the shape ofthe path.


你可能感兴趣的:(agg)