public int addRun(int start, int length, T font) {
		int end = start + length - 1;
		RunArrayEntry newEntry = new RunArrayEntry(start, end, font);

		if (runArray.size() == 0) {
			// Empty runArray
			runArray.add(newEntry);
			return 0;
		}

		// Find position of new entry
		int previousEntryIdx = -1;
		int nextEntryIdx = -1;
		List<Integer> toDeleteList = new LinkedList<Integer>();
		for (int i = 0; i < runArray.size(); i++) {
			if (runArray.get(i).startIdx < start) {
				// New entry start index falls into the existing entry. Record
				// this entry
				previousEntryIdx = i;
			} else if (runArray.get(i).endIdx <= end) {
				// Entry within start and end range will be overwritten
				toDeleteList.add(i);
			}
			if (runArray.get(i).endIdx > end) {
				// New entry end index falls into the existing entry. Record
				// this entry
				nextEntryIdx = i;
				break;
			}
		}

		if (previousEntryIdx != -1) {
			// Previous entry's end index needs update
			runArray.get(previousEntryIdx).setEndIdx(start - 1);
		}

		if (nextEntryIdx != -1) {
			// Next entry's start index needs update
			runArray.get(nextEntryIdx).setStartIdx(end + 1);
		}

		for (int i = toDeleteList.size() - 1; i >= 0; i--) {
			runArray.remove(toDeleteList.get(i));
		}

		// Insert new entry behind previous entry
		runArray.add(previousEntryIdx + 1, newEntry);
		return previousEntryIdx + 1;

	}