Finds the smallest rectangles and appends them to the list after
padding the smallest unit to fit width or height for the parent
rectangle and adding the number of specified pixels.
Returns end position of the first character in string beyond the the
found string, if text contains the same words as the substring in the
same order (but possibly with different number of separators between
words).