Jump to content
Developer Wiki and Function Reference Links ×

Text Font Menu Plug-ins


Recommended Posts

Working with word processors, I always try to have my favorite fonts handy in a set of pre-defined styles. But with Vectorworks, it seems that pre-defined text styles are not one of its fortes. Thanks to Vectorscript though, I was able to make plug-ins that define text styles.

The strange thing about fonts in Vectorworks is that every font is identified by a number, which can either be positive or negative. And each Vectorworks installation has its own unique set of font numbers. I was able to use Julian Carr's Font ID script to get the font IDs (it dates from the MiniCad era). I keep this script on a palette in a Vectorworks document for future use.

----------(Copy script below into a document script palette):---------------

{?1997 Julian Carr Design

This command returns the font ID number of a selected text block}

Procedure TextInfo;

BEGIN IF (FSActLayer<>NIL)&(NumSObj(ActLayer)=1)& (GetType(FSActLayer)=10) THEN Message(Concat('The Font ID Number is : ',GetTextFont(FSActLayer, 0))) ELSE AlrtDialog('Please select one text block of the desired font.');

END;

RUN(TextInfo);

----------------End of Script ----------------------

Using the Font ID script on text blocks set to various fonts, I got the numbers, and then went to work on the text menu plug-ins.

I entered the VectorScript Plug-In Script Editor and put the number in the TextFont value of the script below. This script sets the class to "AR-TEXT", which can be changed (or just omit the line). The TextSize in the sample script is 12 point. It helps to name the menu plug-in with the font and size. For example, I named one plug-in "T-Arial 12Plain" (having a plain text style).

------------(Copy script below into a text menu plug-in):---------------

NameClass('AR-TEXT');

TextFont(2969);

TextSize(12);

TextFace([]);

TextSpace(1);

SetTool(5);

----------------End of Script ----------------------

After making one menu plug-in, it is easy to use the VectorScript Plug-In Editor to duplicate it to make more plug-ins. Then rename the new ones and enter into the script the appropriate TextFont IDs. Then it's just a matter of putting the plug-ins into the program's Text menu using the Workspace Editor, and testing the results, to make sure you get the Text Tool, and the proper Font and Size.

Edited by Bob-H
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...