• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Explorer ,
Aug 25, 2024 Aug 25, 2024

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

 
 
TOPICS
SDK

Views

171

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Aug 25, 2024 Aug 25, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Aug 26, 2024 Aug 26, 2024

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.

 

DirkBecker_0-1724658730320.png

DirkBecker_1-1724659001853.png

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Aug 26, 2024 Aug 26, 2024

Copy link to clipboard

Copied

LATEST

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.

DirkBecker_2-1724661005052.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines