zyantific / IDASkins

Advanced skinning plugin for IDA Pro
MIT License
912 stars 150 forks source link

Hex-Rays font incorrect #3

Closed williballenthin closed 8 years ago

williballenthin commented 9 years ago

Please see the below images of IDA 6.8 with IDASkins 1.3 using the basic IDA theme in both disassembly and Hex-Rays views. I don't recognize the font for the Hex-Rays view, and I wasn't able to find the appropriate selector in the .qss file to modify. I'd like it to be the same fixed width font as the disassembly view. How can I change the font of the Hex-Rays view?

Its important for me to fix because with the incorrect font selected, currently-selected word highlighting is broken (perhaps character width computations are incorrect?), which makes it difficult to rename symbols, etc.

disassembly hexrays

athre0z commented 9 years ago

Thanks for reporting. Sadly, I don't own a license for the decompiler so I can't really help you here directly, however I've seen people using my plugin with Hex-Rays without any problems. Seems like I really need to implement some kind of object-inspector that allows you do reflect the object names and classes by hovering.

What platform is that, by the way? Looks like some Linux with IDA in Wine to me?

williballenthin commented 9 years ago

Alright, I understand. It may be a bug under Wine (as you correctly identified). The object-inspector would be neat, though I hesitate to request it, since I imagine it may be a fair amount of work. Let me know if there's any information I can provide to debug, otherwise, I'll have to avoid using Hex-Rays ;-)

AlexWMF commented 9 years ago

Try this one:

TEAViewer {
    font-family: "<DISASSEMBLY_FONT_FAMILY>";
    font-size: <DISASSEMBLY_FONT_SIZE>;
    font-style: <DISASSEMBLY_FONT_STYLE>;
    font-weight: <DISASSEMBLY_FONT_WEIGHT>;
}

this works for me image

athre0z commented 9 years ago

Does it fix the issue?

williballenthin commented 9 years ago

Unfortunately, it doesn't. I haven't had a chance yet to see if it works as expected under Windows. When I do, I'll update this thread.

athre0z commented 9 years ago

I implemented a basic object inspector and plan to release it with the final 1.4 version of the plugin. Could you try determining a rule that fixes the HR-view with that? I'd really like to get that fixed in the same version.

Here is a pre-compiled binary: https://mainframe.pw/seafile/f/cd2224c605/

If you prefer to build the plugin yourself, you find the updated source in the "develop" branch.

Edit: You find the button to open the object-inspector in the theme selection dialog, by the way.

williballenthin commented 9 years ago

Here's the object hierarchy (from child to ancestor) of the Hex-Rays view.

Type: QWidget
Name: qt_scrollarea_viewport
Number of children: 0

Type: TEAViewer
Name: <none>
Number of children: 5

Type: CustomCodeViewer
Name: <none>
Number of children: 3

Type: PluginForm
Name: <none>
Number of children: 2

Type: IDADockWidget
Name: Pseudocode-A
Number of children: 3
williballenthin commented 9 years ago

I've got both good and bad news:

While I had the plugin running, I went into IDA's font menu and manually set the fonts to use for the various views. From that point on, IDA displayed the correct font in all views (don't even need the TEAViewer rule). Since this is a fairly new installation, perhaps IDA's font configuration was not completely initialized until I applied the settings? In any case, I'm not able to reproduce the bug anymore.

Thanks very much for your patience and rapid response in handling this issue. Please let me know if there's any more info or testing I can provide to help out. Otherwise, I'd consider the issue closed (since it doesn't appear to be this plugins fault).

williballenthin commented 9 years ago

BTW, the object inspector is neat. It'll make developing new themes quick and easier!

athre0z commented 9 years ago

Ahh, okay. I think I know what the problem is. As IDA's SDK doesn't provide any functions to query for the configured fonts, I read those from the registry manually (well, using Qt's QSettings API which is also used by IDA itself so it works cross-platform). My guess is that those keys are not set in the registry until you alter them in the font settings dialog once. So it's still an issue of this plugin, somehow. I'll see how I can come around that in the next few days.