… | |
… | |
816 | XFreeFontNames (list); |
816 | XFreeFontNames (list); |
817 | |
817 | |
818 | // this loop only iterates when the guessed font-size is too small |
818 | // this loop only iterates when the guessed font-size is too small |
819 | for (;;) |
819 | for (;;) |
820 | { |
820 | { |
821 | font_weight *best = fonts + count - 1; |
821 | font_weight *best = fonts; |
822 | |
822 | |
823 | for (font_weight *w = fonts; w < best; w++) |
823 | for (font_weight *w = fonts + 1; w < fonts + count; w++) |
824 | if (w->diff <= best->diff) |
824 | if (w->diff < best->diff) |
825 | best = w; |
825 | best = w; |
826 | |
826 | |
827 | if (!best->name |
827 | if (!best->name |
828 | || !(f = XLoadQueryFont (disp, best->name))) |
828 | || !(f = XLoadQueryFont (disp, best->name))) |
829 | break; |
829 | break; |