TransformBy() public méthode

public TransformBy ( Matrix m ) : LineSegment
m Matrix
Résultat LineSegment
Exemple #1
0
        /**
         *
         * @param height the height, in text space
         * @return the height in user space
         * @since 5.3.3
         */
        private float ConvertHeightFromTextSpaceToUserSpace(float height)
        {
            LineSegment textSpace = new LineSegment(new Vector(0, 0, 1), new Vector(0, height, 1));
            LineSegment userSpace = textSpace.TransformBy(textToUserSpaceTransformMatrix);

            return(userSpace.GetLength());
        }
        /**
         * @return The width, in user space units, of a single space character in the current font
         */
        public float GetSingleSpaceWidth()
        {
            LineSegment textSpace = new LineSegment(new Vector(0, 0, 1), new Vector(GetUnscaledFontSpaceWidth(), 0, 1));
            LineSegment userSpace = textSpace.TransformBy(textToUserSpaceTransformMatrix);

            return(userSpace.GetLength());
        }
Exemple #3
0
        /**
         *
         * @see com.itextpdf.text.pdf.parser.RenderListener#renderText(com.itextpdf.text.pdf.parser.TextRenderInfo)
         */
        public virtual void RenderText(TextRenderInfo renderInfo)
        {
            LineSegment segment = renderInfo.GetBaseline();

            if (renderInfo.GetRise() != 0)
            { // remove the rise from the baseline - we do this because the text from a super/subscript render operations should probably be considered as part of the baseline of the text the super/sub is relative to
                Matrix riseOffsetTransform = new Matrix(0, -renderInfo.GetRise());
                segment = segment.TransformBy(riseOffsetTransform);
            }
            TextChunk location = new TextChunk(renderInfo.GetText(), segment.GetStartPoint(), segment.GetEndPoint(), renderInfo.GetSingleSpaceWidth());

            locationalResult.Add(location);
        }
Exemple #4
0
        /**
         *
         * @see com.itextpdf.text.pdf.parser.RenderListener#renderText(com.itextpdf.text.pdf.parser.TextRenderInfo)
         */
        public virtual void RenderText(TextRenderInfo renderInfo)
        {
            LineSegment segment = renderInfo.GetBaseline();

            if (renderInfo.GetRise() != 0)
            { // remove the rise from the baseline - we do this because the text from a super/subscript render operations should probably be considered as part of the baseline of the text the super/sub is relative to
                Matrix riseOffsetTransform = new Matrix(0, -renderInfo.GetRise());
                segment = segment.TransformBy(riseOffsetTransform);
            }
            TextChunk tc = new TextChunk(renderInfo.GetText(), tclStrat.CreateLocation(renderInfo, segment));

            locationalResult.Add(tc);
        }
 /**
  *
  * @param height the height, in text space
  * @return the height in user space
  * @since 5.3.3
  */
 private float ConvertHeightFromTextSpaceToUserSpace(float height)
 {
     LineSegment textSpace = new LineSegment(new Vector(0, 0, 1), new Vector(0, height, 1));
     LineSegment userSpace = textSpace.TransformBy(textToUserSpaceTransformMatrix);
     return userSpace.GetLength();
 }
 /**
  * @return The width, in user space units, of a single space character in the current font
  */
 public float GetSingleSpaceWidth()
 {
     LineSegment textSpace = new LineSegment(new Vector(0, 0, 1), new Vector(GetUnscaledFontSpaceWidth(), 0, 1));
     LineSegment userSpace = textSpace.TransformBy(textToUserSpaceTransformMatrix);
     return userSpace.GetLength();
 }