Copy link to clipboard
Copied
"I'm developing an InDesign plugin using C++. I have a panel, and I want to dynamically set different font families, font colors, and font sizes for the controls on the panel, such as EVEStaticTextWidget, EVEButtonWidget, and others. I couldn't find any information on this in the SDK documentation, and there are no relevant examples in the sample code. Does the SDK itself not support this? Does anyone know how to do this?"
Copy link to clipboard
Copied
Hmm, haven't tried that in years.
You can/could create derived boss classes that aggregate IID_IUIFONTSPEC, kUIFontSpecImpl and IID_IUICOLORSPEC, kUIColorSpecImpl. Also extend their types following the examples of widgets.fh so you could preset values in fr resources. Sometimes the IControlView implementation picks them up.
Looking across my sources my widgets that support those interfaces also implement an own IControlView, could be that this feature was dropped when the UI was "modernized" to maximum boring/neutral. E.g. ScriptUI also lost the means to render specified colors years ago (when darkUI came along?).
Also note that some of the UI color constants differ from used values, and most font constants produce the normal style even when their name still mentions "bold" etc., variation is mostly in size.
The remnants of traditional widget UI are now emulated on top of another library "Drover" rather than wired to the OS. Only few of the Drover API is exposed in SDK – some DV wrapper methods, and it uses a different color theme.
Copy link to clipboard
Copied
Here the UI colors and fonts of 19.4.
One example where the current UI uses different colors would be kInterfaceTooltipBackground.
Copy link to clipboard
Copied
I think there is also a way to specify own font constants backed by different fonts, but I've never done that.
When you want to show text in any document font, that's also doable but by custom drawing - your IControlView would deal with GraphicsPort, RasterPort and alike. I once wrote a mini composer for a preview similar to glyphs panel.