Skip to content

Highlighting Text Support #8313

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

Closed
Kon-Kam opened this issue Jan 12, 2025 · 1 comment
Closed

Highlighting Text Support #8313

Kon-Kam opened this issue Jan 12, 2025 · 1 comment

Comments

@Kon-Kam
Copy link

Kon-Kam commented Jan 12, 2025

Version/Branch of Dear ImGui:

Version 1.91.7, Branch: docking

Back-ends:

imgui_impl_win32.cpp + imgui_impl_dx11.cpp

Compiler, OS:

Windows 11

Full config/build information:

No response

Details:

Is there support for highlighting text on the app?

For now it just acts like an image, meaning I can't copy numbers that I show on the application, and that's a problem when I want to have a log. Just asking if there's support because I didn't find anything in the demo window.

Also every font I use is blurry (???) except the default one for some reason. And also the default font becomes blurry when I tweak the scale (io.FontGlobalScale). But I think that's related to DPI stuff

Screenshots/Video:

Text in notepad:
Screenshot 2025-01-12 143016
While text in the app:
Screenshot 2025-01-12 143150
Apart from its blurriness, it is also not selectable, in the sense I can't highlight it and copy it. I don't want to use the in-built functions like CopyToClipboard because this extends further than just copying the text. I really want to highlight it, like it's actual text XD

Minimal, Complete and Verifiable Example code:

No response

@ocornut
Copy link
Owner

ocornut commented Jan 12, 2025

Is there support for highlighting text?

Not yet sorry. is eventually planned but not supported. There’s an open issue for it #950.
Copying is supported by CopyToXXX functions, and io.ConfigWindowsCopyContentsWithCtrlC (see https://github.com/ocornut/imgui/releases/tag/v1.91.5).

Also every font I use is blurry (???) except the default one for some reason. And also the default font becomes blurry when I tweak the scale (io.FontGlobalScale). But I think that's related to DPI stuff

Please don’t ask two unrelated questions in the same topic, as it makes it harder to label them and to allow other users to research information. Your app is probably not DPI enabled so Windows is upscaling it. We provide a helper function in the win32 backend to make your process dpi aware, but there are other ways (in theory you should setup an app manifest for it, but i find the function call easier).

@ocornut ocornut closed this as completed Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants