Skip to main content
Inspiring
August 26, 2024
Question

In InDesign plugin development, how do you set the font size and color of controls?

  • August 26, 2024
  • 1 reply
  • 355 views

"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?"

 
 
This topic has been closed for replies.

1 reply

Legend
August 26, 2024

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.

Legend
August 26, 2024

Here the UI colors and fonts of 19.4.

One example where the current UI uses different colors would be kInterfaceTooltipBackground.