#545 Missing widths[] after insert in TextPosition

open
nobody
None
9
2012-03-09
2012-03-09
Anonymous
No

I read the source code of TextPosition.insertDiacritic(int i, TextPosition diacritic, TextNormalize normalize). I don't understand why width2[i+1] is set to 0. This will lead to an error where after I insert a character, the corresponding width is 0. If I do another insert, this yields an error. I replace that line to:

width2[i+1] = diacritic.getWidth();

Please let me know if you mean to set it to zero and if I misunderstand your implementation.

Discussion


  • Anonymous
    2012-03-09

    • priority: 5 --> 9
     

  • Anonymous
    2012-03-09

    Let me paraphrase my question. I intend to group chars into words and therefore extend the TextPosition class with my own mergeDiacritic(). I want all chars within one word to be stored in one TextPosition object. The word contains the width of each char and the spacing between every two adjacent chars. That's where I found the problem of missing widths elements after merging one char.