[英]Rotated text with OpenVG
I've noticed that the OpenVG transformation matrix is ignored by the text rendering routine at all and I cannot control the text position with it manually with VG_GLYPH_ORIGIN parameter
. 我注意到,文本渲染例程完全忽略了OpenVG转换矩阵,并且无法使用VG_GLYPH_ORIGIN
parameter
手动控制它的文本位置。
I'm implementing a scene graph. 我正在实现一个场景图。 I found out that I can use
vgGetMatrix
, read components 6 and 7 of the current 3x3 transform matrix and set VG_GLYPH_ORIGIN
to those values before drawing a block of text. 我发现我可以使用
vgGetMatrix
,读取当前3x3变换矩阵的组件6和7,并在绘制文本块之前将VG_GLYPH_ORIGIN
设置为这些值。 This allows the text origin to be placed in correct place, but the text is still always displayed left-to-right. 这样可以将文本原点放置在正确的位置,但是文本始终始终从左到右显示。
However, this itself doesn't enable me to do any other transformations, like rotation. 但是,这本身并不能使我进行任何其他转换,例如旋转。 I'm surprised because the text is composed from
VGPath
s and they are indeed transformed 我很惊讶,因为文本是由
VGPath
组成的,并且确实被转换了
Is there a way to make the text rotated with OpenVG 1.1? 有没有一种方法可以使文本随OpenVG 1.1一起旋转? Or should I ignore the text functionality from OpenVG 1.1 and draw the letters as individual paths or images manually?
还是应该忽略OpenVG 1.1的文本功能,而是手动将字母绘制为单独的路径或图像?
All the draw functions use a different user->surface matrix: 所有绘制函数都使用不同的用户->表面矩阵:
vgDrawPath
uses VG_MATRIX_PATH_USER_TO_SURFACE
vgDrawPath
使用VG_MATRIX_PATH_USER_TO_SURFACE
vgDrawImage
uses VG_MATRIX_IMAGE_USER_TO_SURFACE
vgDrawImage
使用VG_MATRIX_IMAGE_USER_TO_SURFACE
vgDrawGlyph
/ vgDrawGlyphs
use VG_MATRIX_GLYPH_USER_TO_SURFACE
vgDrawGlyph
/ vgDrawGlyphs
使用VG_MATRIX_GLYPH_USER_TO_SURFACE
By default, all of the matrix functions ( vgTranslate
, vgRotate
, vgLoadMatrix
, etc) operate on VG_MATRIX_PATH_USER_TO_SURFACE
. 默认情况下,所有矩阵函数(
vgTranslate
, vgRotate
, vgLoadMatrix
等)在VG_MATRIX_PATH_USER_TO_SURFACE
上VG_MATRIX_PATH_USER_TO_SURFACE
。 To change the active matrix, call vgSeti
with VG_MATRIX_MODE
as the first argument: 要更改活动矩阵,请使用
VG_MATRIX_MODE
作为第一个参数调用vgSeti
:
vgSeti(VG_MATRIX_MODE, VG_MATRIX_GLYPH_USER_TO_SURFACE);
/* now vgTranslate, vgRotate, etc will operate on VG_MATRIX_GLYPH_USER_TO_SURFACE */
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.