- {
- int cmp = (lo + hi) / 2;
- b = fm->get_char (cmp);
- if (b[Y_AXIS].empty_b () || b[Y_AXIS].length () > y)
- hi = cmp;
- else
- lo = cmp;
-
- if (lo == count - 1 && b[Y_AXIS].length () < y && relative_size < 10)
- {
- /*
- ugh: 7
- We have four fonts: feta-braces0-3.mf
-
- In the style-sheet, all paper relative sizes need to start
- looking at the feta-braces0 font.
-
- The smallest paper size, feta11 or -3, has to make 5 steps
- to get to feta26 or +2. Only after that, from +3 to +8 are
- the real bigger sizes, so worst case we need 11 steps to get
- to the font we need. */
- fm = Font_interface::get_font
- (me,
- gh_list (gh_list (gh_cons (ly_symbol2scm ("font-relative-size"),
- gh_int2scm (++relative_size)),
- SCM_UNDEFINED),
- me->mutable_property_alist_,
- me->immutable_property_alist_,
- font_defaults,
- SCM_UNDEFINED));
-#if 0
- b = fm->get_char (0);
- count = fm->count () >? 2;
-#else
- count = 255;
-#endif
- lo = 0;
- hi = count;
- }
- }
+ {
+ int cmp = (lo + hi) / 2;
+ b = fm->get_indexed_char (cmp);
+ if (b[Y_AXIS].is_empty () || b[Y_AXIS].length () > y)
+ hi = cmp;
+ else
+ lo = cmp;
+ }