예제 #1
0
 public void Process(
     Interval <int> interval,
     ITextString match
     )
 {
     textStrings.Add(match);
 }
예제 #2
0
 public TextChar(char value, Quad box, ITextString textString, bool virtual_)
 {
     this.value      = value;
     this.quad       = box;
     this.textString = textString;
     this.virtual_   = virtual_;
 }
예제 #3
0
        public static TextString Transform(ITextString rawTextString, SKMatrix transform, IContentContext contentContext)
        {
            var textString = new TextString()
            {
                Context = contentContext,
                Style   = rawTextString.Style
            };

            foreach (var textChar in rawTextString.TextChars)
            {
                var quad = textChar.Quad;
                quad.Transform(ref transform);
                textString.TextChars.Add(new TextChar(textChar.Value, quad, textString, true));
            }
            return(textString);
        }
예제 #4
0
            public void Process(
                Interval <int> interval,
                ITextString match
                )
            {
                // Defining the highlight box of the text pattern match...
                IList <Quad> highlightQuads = new List <Quad>();

                {
                    /*
                     * NOTE: A text pattern match may be split across multiple contiguous lines,
                     * so we have to define a distinct highlight box for each text chunk.
                     */
                    RectangleF?textBox = null;
                    foreach (TextChar textChar in match.TextChars)
                    {
                        RectangleF textCharBox = textChar.Box;
                        if (!textBox.HasValue)
                        {
                            textBox = textCharBox;
                        }
                        else
                        {
                            if (textCharBox.Y > textBox.Value.Bottom)
                            {
                                highlightQuads.Add(Quad.Get(textBox.Value));
                                textBox = textCharBox;
                            }
                            else
                            {
                                textBox = RectangleF.Union(textBox.Value, textCharBox);
                            }
                        }
                    }
                    highlightQuads.Add(Quad.Get(textBox.Value));
                }
                // Highlight the text pattern match!
                new TextMarkup(page, highlightQuads, null, TextMarkup.MarkupTypeEnum.Highlight);
            }
예제 #5
0
            public void Process(Interval <int> interval, ITextString match)
            {
                //var matrix = page.RotateMatrix;
                // Defining the highlight box of the text pattern match...
                IList <Quad> highlightQuads = new List <Quad>();

                {
                    /*
                     * NOTE: A text pattern match may be split across multiple contiguous lines,
                     * so we have to define a distinct highlight box for each text chunk.
                     */
                    Quad?textQuad = null;
                    foreach (TextChar textChar in match.TextChars)
                    {
                        var textCharQuad = textChar.Quad;
                        if (!textQuad.HasValue)
                        {
                            textQuad = textCharQuad;
                        }
                        else
                        {
                            if (textCharQuad.Top > textQuad.Value.Bottom)
                            {
                                highlightQuads.Add(textQuad.Value);
                                textQuad = textCharQuad;
                            }
                            else
                            {
                                textQuad = Quad.Union(textQuad.Value, textCharQuad);
                            }
                        }
                    }
                    highlightQuads.Add(textQuad.Value);
                }
                // Highlight the text pattern match!
                new TextMarkup(page, highlightQuads, null, TextMarkupType.Highlight);
            }
예제 #6
0
 public void Process(
     Interval<int> interval,
     ITextString match
     )
 {
     // Defining the highlight box of the text pattern match...
     IList<Quad> highlightQuads = new List<Quad>();
     {
       /*
     NOTE: A text pattern match may be split across multiple contiguous lines,
     so we have to define a distinct highlight box for each text chunk.
       */
       RectangleF? textBox = null;
       foreach(TextChar textChar in match.TextChars)
       {
     RectangleF textCharBox = textChar.Box;
     if(!textBox.HasValue)
     {textBox = textCharBox;}
     else
     {
       if(textCharBox.Y > textBox.Value.Bottom)
       {
     highlightQuads.Add(Quad.Get(textBox.Value));
     textBox = textCharBox;
       }
       else
       {textBox = RectangleF.Union(textBox.Value, textCharBox);}
     }
       }
       highlightQuads.Add(Quad.Get(textBox.Value));
     }
     // Highlight the text pattern match!
     new TextMarkup(page, null, TextMarkup.MarkupTypeEnum.Highlight, highlightQuads);
 }