by IDEAL Software Support » Wed Feb 09, 2005 3:12 pm
"Binary search" is a standard algorithm, you can read about in many books or also in the internet.
For finding a matching font, the algorithm must be modified to turn over to linear search after an approximation has bee made. This is necessary, because it is unlikely that an *exact* matching font size will be found, i.e. it will be a maximum font size, which makes the given text fit into the given rectangle. For this reason the search must be done with a tolerance factor. If the search result is within the tolerance range, turn over to linear search.
Regards
Thorsten Radde
IDEAL Software GmbH