public virtual bool IsAtWordBoundary(ITextChunkLocation previous) { float dist = DistanceFromEndOf(previous); if (dist < 0) { dist = previous.DistanceFromEndOf(this); //The situation when the chunks intersect. We don't need to add space in this case if (dist < 0) { return(false); } } return(dist > CharSpaceWidth / 2.0f); }
public virtual bool IsAtWordBoundary(ITextChunkLocation previous) { if (startLocation.Equals(endLocation) || previous.GetEndLocation().Equals(previous.GetStartLocation())) { return(false); } float dist = DistanceFromEndOf(previous); if (dist < 0) { dist = previous.DistanceFromEndOf(this); //The situation when the chunks intersect. We don't need to add space in this case if (dist < 0) { return(false); } } return(dist > GetCharSpaceWidth() / 2.0f); }
public virtual bool IsAtWordBoundary(ITextChunkLocation previous) { // In case a text chunk is of zero length, this probably means this is a mark character, // and we do not actually want to insert a space in such case if (startLocation.Equals(endLocation) || previous.GetEndLocation().Equals(previous.GetStartLocation())) { return(false); } float dist = DistanceFromEndOf(previous); if (dist < 0) { dist = previous.DistanceFromEndOf(this); //The situation when the chunks intersect. We don't need to add space in this case if (dist < 0) { return(false); } } return(dist > GetCharSpaceWidth() / 2.0f); }