1,295
edits
| Line 63: | Line 63: | ||
// Compute how many characters from this string starting at | // Compute how many characters from this string starting at | ||
// character 'pos' and up to length 'len' fit | // character 'pos' and up to length 'len' fit | ||
// into the given width. A break is allowed before character i | // into the given width. 'breaks' is an array of length len. | ||
// A break is allowed before character i wherever breaks[i] is nonzero, | |||
// is | // i.e., if the result of GetCharsFit is i then breaks[i] is nonzero. | ||
// If none of the chars fit then this will return zero, so breaks[0] must be | |||
// nonzero. If all of the chars fit, return 'len'. Breaks are only allowed | |||
// at cluster boundaries so if character i is not the start of a cluster, | |||
// then breaks[i] must be zero. | |||
// We will usually want to call MeasureText right afterwards, | // We will usually want to call MeasureText right afterwards, | ||
// the implementor could optimize for that. | // the implementor could optimize for that. | ||
edits