Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
leodevbro opened this issue Mar 15, 2021 · 5 comments
Labels
feature-request Request for new features or functionality
Milestone

Comments

@leodevbro
Copy link

leodevbro commented Mar 15, 2021

[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

@leodevbro
Copy link
Author

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

@leodevbro
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants
@jrieken @leodevbro and others