On 16.04.2013 11:04, Vladimir Testov wrote: >> Please don't use // comments. > O.k. I won't. >> This code completely forgets the cases >> when even the first word doesn't fit in the available space. > > Mmm. It can handle this case actually. > >> The code as whole breaks some unicode concepts like e.g. bidi stack. > > Didn't get what you mean. > >> Could you reuse the already available line-vreaking algorithm in >> normal/term.c and normal/charset.c ? Since the line-breaking is >> artificially disabled for labels it should require only minor >> adjustments to be reenabled. > > Yep! Here it is (patch included)! > > Nevertheless, two problems appeared and I don't sure how exactly should I fix > them. > 1) Handling of some long word. If this word is not first in line and it's > length is more than label's width > then the length of the first fragment of the word will be counted as if it > will > be drawn on the same line, > but actually it will be printed on the next line.
Don't write any line-breaking at all yourself. > 2) There is funny handling of UTF-8 symbols. Each symbol have "device_width" > parameter, > which is used in calculation of string's length. Where is it used? Show exactly. It must be some leftover code. > How should I fix these problems? > 1st one - for example, I can slightly update line-breaking mechanism. > 2nd one - more interesting, harder. I suggest utf-8 printing mechanism > (charset.c unicode.c etc) should be remade. So symbol connections will be > counted in more intelligent way (e.g. while counting spaces - take into > consideration nearby symbols). It is interesting. :) I can do it. Would be > happy, if someone could give me some advices. We don't do any kerning. No need to change algorithm. > > Problem2.png > text = "@KEYMAP_LONG@" > t is misprinted > > Problem1.png > text = "short short short > HereWeHaveSomeVeryLongWordSoItCannotBePrintedEntirelyOnOneLine" > See how the line-breaking works. > > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel