On Mon, Apr 18, 2011 at 11:16 AM, Han-Wen Nienhuys <hanw...@gmail.com> wrote:
>> } >> uses (i think) two different design sizes (one for cues, one for normal >> notes) and yet everything is fine - change from regular flags to >> shortened flags take place on note d both in cues and normal notes. >> Also when i compile this and a copy of this file with >> #(set-global-staff-size 15) the results are correct. >> Perhaps i'm not understanding something? > > You are initializing this list just once, while in principle it can > have different values for every loaded font. Even if it may work, it > is wrong. > > As a general rule we try to avoid global variables, since they always > are or become a pain in the ass. Overall, I dont see why this needs precomputation. If you give the flags sequential suffixes, eg. u3_0 u3_1 u3_2 then you can do get_flag(Real stemlength) { flagname = .. // "u3" int suffix = 0 int best = -1; Real best_dist = INFINITY; while (true) { Box b =fm->get_char (flagname + string(suffix)) if b.empty() { break; } Real dy = b[Y].length() - stemlength if abs(dy) < best_dits { best_dist = abs(dy) best = suffix } suffix ++; } Mike promised he would have a look at an alternative implementation of the C++ by the end of this week. -- Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel