+static int find_min_distance(int min_size, int height)
+{
+ /* find a minimum distance between two alignzones so
+ that when they both, due to pixel snapping, move
+ into opposite directions, the subsequent character
+ scaling doesn't cause the upper/lower end of the char
+ to move outwards more than m pixels */
+ int m = 4;
+ double scale = min_size / 1024.0;
+ double max_move = (2 * 1.0 / scale)/m;
+ return (int)(height*max_move);
+}
+