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

Bridge 15 beta - Cannot set font via script

LEGEND ,
Sep 04, 2024 Sep 04, 2024

I have a script which sets font size for an edittext box. This works in Bridge 12 but not in Bridge 15 beta.

Below is a demo script that shows the problem.

 

 

try{
testWindow = new Window ('palette', 'font demo', undefined, {closeButton:true});
testWindow.orientation = 'column';
testWindow.alignChildren = ['fill', 'fill'];
testWindow.minimumSize = [300, 200];
testPanel = testWindow.add('panel', undefined, 'Test');
testPanel.orientation = 'column';
testPanel.alignChildren = ['fill', 'top'];
testPanel.margins = [10, 10, 10, 10];
testPanel.minimumSize = [250, 175];
testPanel.textbox = testPanel.add('edittext', undefined, 'ABC');
testPanel.checkbox = testPanel.add('checkbox', undefined, 'Larger');
testPanel.checkbox.value = false;
testPanel.checkbox.onClick = function(){
    if(testPanel.checkbox.value == true){
        if(Folder.fs == 'Windows'){
            testPanel.textbox.graphics.font = 'Tahoma:16';
            }
        else{
            testPanel.textbox.graphics.font = 'Arial:18';
            }
        }
    else{
        if(Folder.fs == 'Windows'){
            testPanel.textbox.graphics.font = 'Tahoma:12';
            }
        else{
            testPanel.textbox.graphics.font = '.AppleSystemUIFont:13';
            }
        }
    }
testWindow.layout.layout(true);
testWindow.show();
}
catch(e){
Window.alert(e + e.line);
}

 

TOPICS
Beta , Bug , Problem or error , Scripting
94
Translate
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
no replies

Have something to add?

Join the conversation