Exemple #1
0
        public override PaintedWord[] GetPaintedWords(AnalyzedLayoutedText analyzedLayoutedText)
        {
            var words = new PaintedWord[analyzedLayoutedText.Words.Length];

            for (var i = 0; i < words.Length; i++)
            {
                words[i] = new PaintedWord(analyzedLayoutedText.Words[i], palette.FontColor);
            }
            return(words);
        }
Exemple #2
0
        public void GetPaintedWords_PaintsWords()
        {
            var layoutedWords = new LayoutedWord[3];

            layoutedWords[0] = new LayoutedWord("test", new Rectangle(0, 0, 10, 10));
            layoutedWords[1] = new LayoutedWord("test1", new Rectangle(17, 37, 10, 10));
            layoutedWords[2] = new LayoutedWord("test2", new Rectangle(48, 56, 10, 10));
            var statDict = new Dictionary <WordStatistics.WordStatistics, int>
            {
                [new WordStatistics.WordStatistics(layoutedWords[0], StatisticsType.WordCount)] = 2,
                [new WordStatistics.WordStatistics(layoutedWords[0], StatisticsType.WordCount)] = 4,
                [new WordStatistics.WordStatistics(layoutedWords[0], StatisticsType.WordCount)] = 8
            };
            var text = new AnalyzedLayoutedText(layoutedWords, statDict);

            foreach (var paintedWord in wordPainter.GetPaintedWords(text))
            {
                paintedWord.FontColor.Should().NotBe(default(Color));
            }
        }
Exemple #3
0
 public abstract PaintedWord[] GetPaintedWords(AnalyzedLayoutedText analyzedLayoutedText);