* @param ty
   *        The y-coordinate at which to render the baseline.
   */
  private void drawLine(Graphics g, int lineNum, int ty) {
    if (baseFont != getFont()) {
      baseFont = getFont();
      specialFonts.clear();
    }

    g.setColor(getForeground());
    Font drawingFont = baseFont;
    g.setFont(drawingFont);
    int fontFlags = 0;

    StringBuilder line = code.getsb(lineNum);
    int xx = 1 + getInsets().left;
    char[] a = line.toString().toCharArray();
    Color c = g.getColor();

    if (marker == null) {
      drawChars(g, a, 0, a.length, xx, ty);
    } else {
      ArrayList<TokenMarkerInfo> tmall = marker.getStyles(code.get(lineNum));
      int pos = 0;
      for (TokenMarkerInfo tm : tmall) {
        // Start by printing normal characters until we reach
        // styleBlock.startPos
        xx = drawChars(g, a, pos, tm.startPos, xx, ty);
        // Print the remaining characters in the styleBlock range
        g.setColor(tm.color != null? tm.color : c);

        fontFlags = tm.fontStyle;
        if (specialFonts.containsKey(fontFlags)) {
          drawingFont = specialFonts.get(fontFlags);
        } else {
          drawingFont = baseFont.deriveFont(fontFlags);
          specialFonts.put(fontFlags, drawingFont);
        }
        g.setFont(drawingFont);

        xx = drawChars(g, a, tm.startPos, tm.endPos, xx, ty);
        pos = tm.endPos;
        g.setFont(baseFont);
        g.setColor(c);
      }
    }
  }