Function GetFontID converts the string name of an available font to a font ID which can be passed to other VectorScript routines.
FUNCTION GetFontID(fontName : STRING): INTEGER;def vs.GetFontID(fontName):
return INTEGER| Name | Type | Description |
|---|---|---|
| fontName | STRING | Name of installed font. |
returns -1 if the requested font is not available
PROCEDURE Example;
VAR
str :STRING;
BEGIN
str := StrDialog('Enter the font name:', 'Arial');
AlrtDialog(Concat('The font ID is: ', GetFontID(str)));
END;
RUN(Example);def Example():
str = vs.StrDialog('Enter the font name:', 'Arial')
vs.AlrtDialog(vs.Concat('The font ID is: ', vs.GetFontID(str)))
Example()Availability: from VectorWorks8.0