Visual Studio and .NET Framework Home
Visual Studio editor considers ligatures to be a single character
as By Design
8/10/2006 6:50:42 PM
User(s) can reproduce this bug
If I switch my Visual Studio font to something that contains ligatures (for example, "Calibri" has a ligature for "fi") then Visual Studio will consider that ligature a single character. It should either not use ligatures at all for such combinations, or at least handle the "backspace" and cursor-ing properly.
Note the steps and "expected"/"actual" behaviour I describe below is only one symptom. There are other, for example, if you put your cursor to the left of the "fi" ligature, and press the right-arrow, it'll move the cursor to the right of the "i", not in between the "f" and the "i" as you would expect. Also, you cannot select just the "f" or just the "i", you can only select both.
Of course, this doesn't just affect the "fi" ligature, but any ligatures in the font. It's just that I hit the "fi" one quite a bit (I seem to have lots of variables with the word "file" in them...
I've attached a screenshot of the bug. The "fi" immediately to the left of the cursor is a ligature, and if I were to hit "backspace" at this point, it would delete the whole "fi" ligature, rather than just the "i".
Visual Studio 2005 Professional Edition
Windows XP Professional
Operating System Language
Steps to Reproduce
1. Change the font of the Visual Studio editor to Calibri (for example)
2. Type in "fi"
3. Hit backspace
Visual Studio will delete both the "i" AND the "f"
Only the "i" should be deleted.
to post a comment.
Please enter a comment.
on 6/11/2008 at 9:40 AM
I totally agree with the previous comment.
I believe that this problem is a result of trying to support Indic Complex scripts. OpenType says that once a 'ligature' (they call complex characters something else there) is formed it cannot be decomposed. It is unfortunate that in the process of trying to accommodate much complex things, established technology has to suffer.
on 6/5/2008 at 8:35 AM
The problem is greater than editing convenience; it also affects consistency: The problem causes the IDE uses to use a different character counting scheme than the runtime. This means that for applications where the count of characters in string literals is important (yes, some still exist, e.g. writing to an LCD display), counting characters by pressing the arrow keys or using the Col indicator in the status bar gives incorrect results. Such a subtle source for bug introduction at least warrants a warning in the font selection dialog box when a vulnerable font is selected.
on 9/14/2006 at 5:05 PM
Thank you for your bug report!
We have reviewed your bug and have decided that we will not be able to fix it for this version of Visual Studio. We are now closing the bug for archival purposes. Thank you for using Visual Studio!
-VS DTP Code Essentials QA
on 8/15/2006 at 4:18 PM
Well, let's be fair here. It's not something that you are UNABLE to address, it's something that you don't feel you NEED to address. Which I guess is fair enough.
on 8/15/2006 at 2:26 PM
Hi, thank you for reporting this issue. We do realise that some fonts are not optimal for code editing, so while this is a problem, this is not something we are able to address.
Prasadi de Silva
VS Program Manager
to post a workaround.
Please enter a workaround.
on 6/5/2008 at 8:42 AM
Use a font without without ligatures. Tradeoff: Modern fonts like Calibri have been optimized for easy reading on an LCD display. Fonts without ligatures tend to either be non-proportional (use more screen space) or not render as clearly on LCD displays.
© 2013 Microsoft