title: itext: make a single letter bold within a word
body: <p>Is it possible to bold out specific letters within a word in itext?</p>
  
  <p>Consider this sentence, "this is a word". Could i make all the "i" withing that sentence bold? So the output would be like this:
  "th<strong>i</strong>s <strong>i</strong>s a word"</p>
  
  <p>So to get the first word right (this), do i really have to create three chunks for one word and than add all the chunks together? Or is there another approach? </p>
  
  <p>With three chunks i mean something like this (i know its not working code but made it like this for readability):</p>
  
  <pre><code>Chunk chunk1 = new Chunk("th");
  Chunk chunk2 = new Chunk("i", bold);
  Chunk chunk3 = new Chunk("s");
  
  Paragraph p = new Paragraph(); 
  p.add(chunk1); p.add(chunk2); p.add(chunk3)
  </code></pre>
  
  <p>There has to be a better way. Some "strings" i want colorized as well, like each letter in the string will have a different color, do i have to create chunks for each letter than combine them? </p>
  
  <p>With a EditText box in android to change each letter color i could use SpannableString. But its different with itext since it doesnt have the char. I hope you guys understand what i mean, i will post two methods on how i solved in android in an editText box. Now i just want a similar method for writing a colorized and bold text to a pdf. </p>
  
  <pre><code>    public SpannableString colorizeText(String text) {
          SpannableString spannableColor = new SpannableString(text);
          int x = 1;
          for(char letter : text.toCharArray()){
              spannableColor.setSpan(new ForegroundColorSpan(returnCorrectColor(letter)), x-1, x, 0);
              x++;
          }
          return spannableColor;
      }
  
      private int returnCorrectColor(char letter) {
          String theLetter = Character.toString(letter);
          if (theLetter.contains("a")){
              return Color.BLUE;
          }
          else if(theLetter.contains("o")){
              return Color.GREEN;
          }
          return Color.RED;
      }
  </code></pre>