Exemplo n.º 1
0
 public override bool SameLine(TextChunk a)
 {
     if (a is HorizontalTextChunk)
     {
         HorizontalTextChunk horAs = (HorizontalTextChunk)a;
         return(getLineNumber() == horAs.getLineNumber());
     }
     else
     {
         return(base.SameLine(a));
     }
 }
Exemplo n.º 2
0
    public override void RenderText(TextRenderInfo renderInfo)
    {
        textLineFinder.RenderText(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 HorizontalTextChunk(renderInfo.GetText(), segment.GetStartPoint(), segment.GetEndPoint(), renderInfo.GetSingleSpaceWidth(), textLineFinder);

        getLocationalResult().Add(location);
    }
Exemplo n.º 3
0
 override public int CompareTo(TextChunk rhs)
 {
     if (rhs is HorizontalTextChunk)
     {
         HorizontalTextChunk horRhs = (HorizontalTextChunk)rhs;
         int rslt = CompareInts(getLineNumber(), horRhs.getLineNumber());
         if (rslt != 0)
         {
             return(rslt);
         }
         return(CompareFloats(StartLocation[Vector.I1], rhs.StartLocation[Vector.I1]));
     }
     else
     {
         return(base.CompareTo(rhs));
     }
 }