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

Display sample font chosen from a list

Enthusiast ,
Aug 24, 2023 Aug 24, 2023

Copy link to clipboard

Copied

Greetings to all
I have a simple question if possible
How can I add a sample width to a font inside Dialog?
To clarify more
I have, for example, a listbox or a drop-down list with fonts
I want, when choosing a font, to display a sample font, as shown in the image

 

-- The idea is how can I display the sample font

 

 

SAMPLE.jpg

TOPICS
Actions and scripting , SDK

Views

177

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
Adobe
Community Expert ,
Aug 24, 2023 Aug 24, 2023

Copy link to clipboard

Copied

Hi @Mohamed Hameed what version of Photoshop are you on? What do you mean by "sample width"?

Current versions of Photoshop already show previews of the fonts.

kevinstohlmeyer_0-1692909592842.png

This page explains more under the "Preview Fonts" section

https://helpx.adobe.com/photoshop/using/fonts.html

 

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
Enthusiast ,
Aug 24, 2023 Aug 24, 2023

Copy link to clipboard

Copied

To make it more clear
I want to change the font of Statik Text with the same idea as the sample font in Photoshop fonts
Is this method dependent on system fonts or is it based on Photoshop fonts?
And how to bring the font to change the font static text

I took screenshots that illustrate the idea more

    var myWindow = new Window ("dialog", "Font Test");
    var statictext1 = myWindow.add('statictext {text: "محمد حميد", characters: 20, justify: "left"}'); 
    statictext1.graphics.font = ScriptUI.newFont ("Ghalam1", 100);
    //statictext1.graphics.font = ScriptUI.newFont ("DIN Next LT Arabic", 100);
    //statictext1.graphics.font = ScriptUI.newFont ("Diwani Letter", 100);
    //statictext1.graphics.font = ScriptUI.newFont ("DTP Naskh S En", 100);
    //statictext1.graphics.font = ScriptUI.newFont ("Expo Arabic Light", 100);
    //statictext1.graphics.font = ScriptUI.newFont ("GE SS Two Bold", 100);
    //statictext1.graphics.font = ScriptUI.newFont ("GE Hili", 100);
    //statictext1.graphics.font = ScriptUI.newFont ("GE Meem Medium", 100);
     //statictext1.graphics.font = ScriptUI.newFont ("AL-Mateen", 100);
          myWindow.show ();

1.jpg

In the first picture, it is clear that the font written in the design is the same as the sample font in the list of fonts
It appears with me successfully in the first line of the code

statictext1.graphics.font = ScriptUI.newFont ("Ghalam1", 100);

 

 

2.jpg

This is the end result after trying the first line of code
Great result

 

But here

And when I try this font in this line, it doesn't work with it, and it shows me a problem

 statictext1.graphics.font = ScriptUI.newFont ("AL-Mateen", 100);

3.jpg

While the font appears in the text
Also, the same font appears in the list of fonts

4.jpg
Why didn't it appear with me when using the font inside the code

 

 

 

Summary of what I want
It is why there are fonts that change with me in the static text and there are others that do not change
where is the problem ??

 

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
Enthusiast ,
Aug 24, 2023 Aug 24, 2023

Copy link to clipboard

Copied

LATEST

@Kevin Stohlmeyer 

I have clarified the idea sir in another reply
Pictures shown for what I want

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