Bug 26478 - TextBox doesn't handle fonts with kerning well
Summary: TextBox doesn't handle fonts with kerning well
Alias: None
Product: Class Libraries
Classification: Mono
Component: Windows.Forms ()
Version: 3.4.0
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-01-27 16:27 UTC by Stephen McConnel
Modified: 2015-01-28 17:12 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Stephen McConnel 2015-01-27 16:27:05 UTC
When fonts that use kerning (such as the default "DejaVu Sans") are used in TextBox controls, the display can become garbled during typing, with the cursor getting mis-located.  This effect is quite noticeable in English for strings like the following:

over and off, over and off! AVAST and AWAY, AVAST and AWAY I say when over ALTERNATE ATLANTA!

This text doesn't make any sense, but it has several sequences that are often kerned.  Text in other languages, especially in non-Roman scripts is affected even worse since you can have English texts that make little use of kerned sequences.

This bug is easily tested in any TextBox control that uses the default DejaVu Sans font with the string given above.

I have a fix for this that I'll post as a pull request later this afternoon.  I tried to balance retaining the current, speed optimized implementation as much as possible while also maintaining accurate display on the screen.
Comment 1 Stephen McConnel 2015-01-28 17:12:53 UTC
The pull request has already been merged before I could add it to this issue (https://github.com/mono/mono/pull/1530).