diff options
author | culler <culler> | 2020-05-19 02:31:05 (GMT) |
---|---|---|
committer | culler <culler> | 2020-05-19 02:31:05 (GMT) |
commit | d71a648c788bdbe6f17db19dcb90cafb174abc83 (patch) | |
tree | 7e79c1683b7f2af97c3ada42eb57e436de32b56e /macosx | |
parent | 742aa6e5578759ae3d318aa05164df0b9e3982d3 (diff) | |
download | tk-d71a648c788bdbe6f17db19dcb90cafb174abc83.zip tk-d71a648c788bdbe6f17db19dcb90cafb174abc83.tar.gz tk-d71a648c788bdbe6f17db19dcb90cafb174abc83.tar.bz2 |
Add surrogate-aware TkUtfAtIndex and TkNumUtfChars. This is enough to allow editing emoji text (without variant selectors) in Entry widgets on macOS.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXFont.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 7fc0113..70bb9e8 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -105,7 +105,7 @@ static void DrawCharsInContext(Display *display, Drawable drawable, * To avoid an extra copy, a TKNSString object wraps a Tcl_DString with an * NSString that uses the DString's buffer as its character buffer. It can be * constructed from a Tcl_DString and it has a DString property that handles - * converting from an NSString to a Tcl_DString + * converting from an NSString to a Tcl_DString. */ @implementation TKNSString @@ -1056,7 +1056,7 @@ TkpMeasureCharsInContext( [attributedString release]; [string release]; length = ceil(width - offset); - fit = (Tcl_UtfAtIndex(source, index) - source) - rangeStart; + fit = (TkUtfAtIndex(source, index) - source) - rangeStart; done: #ifdef TK_MAC_DEBUG_FONTS TkMacOSXDbgMsg("measure: source=\"%s\" range=\"%.*s\" maxLength=%d " |