#326 TkpMeasureCharsInContext bugs in Tk Cocoa

closed-accepted
5
2012-02-22
2012-02-13
No

For Chinese and other text where a UTF character is more than one byte, TkpMeasureCharsInContext returns "1" when called by the text widget to determine tag-under-mouse whether mouse is in fact over first or second character. (The attached script demonstates.) Tracing revealed this was because CTTypesetterSuggestClusterBreak() refuses to return a zero, even if the cluster break goes past the max. Added code to detect and correct this. While debugging a couple of other apparent errors were found and fixed.

Finally, some special code to ignore user-specified threshold and disable antialiasing for fixed-width fonts below 10-point was disabled. If this is going to be present, it should be exposed through a ::tk::mac variable so the user or application can turn it off, since this behavior is nonstandard.

Discussion

  • Adrian Robert

    Adrian Robert - 2012-02-13

    Demonstrates the bug

     
  • Adrian Robert

    Adrian Robert - 2012-02-22

    Replaces earlier file (garbled by SF)

     
  • Kevin Walzer

    Kevin Walzer - 2012-02-22
    • status: open --> closed-accepted