【问题标题】:How to find out the coordinates of rotated textframe如何找出旋转文本框的坐标
【发布时间】:2011-02-28 13:27:33
【问题描述】:

借助 (idml) itemtransform 水平/垂直距离和路径点数组,我可以找出文本框的坐标 (x1,y1), (x2,y2), (x3,y3), (x4, y4)。如果旋转文本框,则项目变换值会发生变化,但路径点数组值是相同的。我可以通过矩阵 [cos(θ) sin(θ) -sin(θ) cos(θ) 0 0] 找到旋转角度,但我无法获得旋转文本框的确切坐标。文本框如下所示。

普通文本框

  <TextFrame Self="u136" ParentStory="u124" ItemTransform="1 0 0 1 101.72727272727272 -349.41818181818184">
        <Properties>
            <PathGeometry>
                <GeometryPathType PathOpen="false">
                    <PathPointArray>
                        <PathPointType Anchor="-101.72727272727272 -46.581818181818164" LeftDirection="-101.72727272727272 -46.581818181818164" RightDirection="-101.72727272727272 -46.581818181818164"/>
                        <PathPointType Anchor="-101.72727272727272 -0.3272727272727103" LeftDirection="-101.72727272727272 -0.3272727272727103" RightDirection="-101.72727272727272 -0.3272727272727103"/>
                        <PathPointType Anchor="115.9090909090909 -0.3272727272727103" LeftDirection="115.9090909090909 -0.3272727272727103" RightDirection="115.9090909090909 -0.3272727272727103"/>
                        <PathPointType Anchor="115.9090909090909 -46.581818181818164" LeftDirection="115.9090909090909 -46.581818181818164" RightDirection="115.9090909090909 -46.581818181818164"/>
                    </PathPointArray>
                </GeometryPathType>
            </PathGeometry>
        </Properties>         

旋转的文本框

 <TextFrame Self="u136" ParentStory="u124" ItemTransform="0 1 -1 0 320.3805483338268 -125.07900895050204">
        <Properties>
            <PathGeometry>
                <GeometryPathType PathOpen="false">
                    <PathPointArray>
                        <PathPointType Anchor="-101.72727272727272 -46.581818181818164" LeftDirection="-101.72727272727272 -46.581818181818164" RightDirection="-101.72727272727272 -46.581818181818164"/>
                        <PathPointType Anchor="-101.72727272727272 -0.3272727272727103" LeftDirection="-101.72727272727272 -0.3272727272727103" RightDirection="-101.72727272727272 -0.3272727272727103"/>
                        <PathPointType Anchor="115.9090909090909 -0.3272727272727103" LeftDirection="115.9090909090909 -0.3272727272727103" RightDirection="115.9090909090909 -0.3272727272727103"/>
                        <PathPointType Anchor="115.9090909090909 -46.581818181818164" LeftDirection="115.9090909090909 -46.581818181818164" RightDirection="115.9090909090909 -46.581818181818164"/>
                    </PathPointArray>
                </GeometryPathType>
            </PathGeometry>
        </Properties>        

当我将旋转文本框的值转换为坐标并在屏幕上绘制时,我没有得到它在原始文本中绘制的确切位置。

谁能帮我找出旋转文本框的坐标。

提前致谢。

【问题讨论】:

  • 嗨,我怎样才能获得文本框的高度、宽度和 x、y 位置?

标签: text coordinates rotation frame adobe-indesign


【解决方案1】:

TextFrame 的 ItemTransform 属性 (a b c d e f) 中的值表示一个二维空间变换矩阵,用于根据以下矩阵乘法公式从 TextFrame 的内部坐标系转换回父坐标系:

| Xparent |   | a  c  e |   | X |
| Yparent | = | b  d  f | * | Y |
| 1       |   | 0  0  1 |   | 1 |

其中X、Y是TextFrame内部坐标系中的坐标,Xparent和Yparent是父级(Spread等)坐标系中对应的坐标。

欲了解更多信息,请参阅7 Coordinate Systems, Transformations and Units

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-02-29
    • 2019-05-08
    • 2011-02-19
    • 2010-12-28
    • 1970-01-01
    • 2014-05-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多