rem: if (escapementArray[left] < escapementArray[right]) {
add: if (left > numChars - right) {
context: truncate_middle(const char* source, char* dest, uint32 numChars,	const float* escapementArray, float width, float ellipsisWidth, float size){	// find visual center	ellipsisWidth /= size;	// test if this is as accurate as escapementArray * size	width /= size;	float halfWidth = (width - ellipsisWidth) / 2.0;	float leftWidth = 0.0, rightWidth = 0.0;	uint32 left, right;	// coming from left...	for (left = 0; left < numChars; left++) {		if (leftWidth + escapementArray[left] > halfWidth)			break;		leftWidth += escapementArray[left];	}	if (left == numChars) {		// string is smaller than half of the maximum width		return false;	}	// coming from right...	for (right = numChars; right-- > left; ) {		if (rightWidth + escapementArray[right] > halfWidth)			break;		rightWidth += escapementArray[right];	}	if (left >= right) {		// string is smaller than the maximum width		return false;	}	if (left == 0 || right >= numChars - 1) {		// there is no space for the ellipsis		strcpy(dest, "");		return true;	}	// The ellipsis now definitely fits, but let's	// see if we can add another character		float totalWidth = ellipsisWidth + rightWidth + leftWidth;	if (escapementArray[left] < escapementArray[right]) {		// try right letter first		if (escapementArray[right] + totalWidth <= width)			right--;		else if (escapementArray[left] + totalWidth <= width)			left++;	} else {		// try left letter first		if (escapementArray[left] + totalWidth <= width)			left++;		else if (escapementArray[right] + totalWidth <= width)			right--;	}	// copy characters	for (uint32 i = 0; i < left; i++) {		// copy one glyph		do {			*dest++ = *source++;		} while (IsInsideGlyph(*source));	}	dest = write_ellipsis(dest);	for (uint32 i = left; i < numChars; i++) {		// copy one glyph		do {			if (i >= right)				*dest++ = *source++;			else				source++;		} while (IsInsideGlyph(*source));	}	// terminate	dest[0] = '\0';	return true;}