microsoft / vscode

Visual Studio Code

Home Page:https://code.visualstudio.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please provide a function in API to get horizontal pixel coordinate of any character in any line.

leodevbro opened this issue · comments

[NEW UPDATE]:
My VS Code extension "Blockman" has already more than 100K installs.

This feature request (With VS Code extension API to be able to get horizontal pixel coordinate of any character in any line) is still valid, because there are some edge cases when Blockman cannot compute edges properly, for example when the font in not monospace, or when there are inlay hints.


[THE FEATURE REQUEST]:
The problem is about non-monospace fonts (or using two monospace fonts which have different widths).
I don't have access to pixel locations of characters, so I can only just compute px location from width of general char frame and number of characters to that character. So the problem shows up if not all the characters have the same frame-width:
blocks-problem-fonts

Please provide a function to be able to get pixel locations of any character in a line. I don't need vertical px locations, I need only horizontal px locations.

Like this:
blocks-problem-fonts-know-px222

Just for the information, the letter "ლ" is Georgian alphabet character, like: ა, ბ, გ, დ, ე, ვ, ზ, თ, ი, კ, ლ, მ, ნ, ო, პ, ჟ, რ, ს, ტ, უ, ფ, ქ, ღ, ყ, შ, ჩ, ც, ძ, წ, ჭ, ხ, ჯ, ჰ.

FYI, I already published this VSCode extension - Blockman. It has more than 7000 installs.
https://marketplace.visualstudio.com/items?itemName=leodevbro.blockman

The feature request of px locations is still valid, because there are some edge cases when Blockman cannot compute edges properly, for example when the font in not monospace, or when there are inline annotations provided by this extension:
Inline Parameters for VSCode (Liam Hammett)
https://marketplace.visualstudio.com/items?itemName=liamhammett.inline-parameters