From da875fcb62c801b8d19b3d4d984ad963574fb356 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 2 Mar 2023 21:01:10 +0100 Subject: Adding upstream version 1.6.0. Signed-off-by: Daniel Baumann --- examples/fontforge-old/demoExecuteScript.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 examples/fontforge-old/demoExecuteScript.py (limited to 'examples/fontforge-old/demoExecuteScript.py') diff --git a/examples/fontforge-old/demoExecuteScript.py b/examples/fontforge-old/demoExecuteScript.py new file mode 100755 index 0000000..22a3094 --- /dev/null +++ b/examples/fontforge-old/demoExecuteScript.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python +'FontForge: Demo code to paste into the "Execute Script" dialog' +__url__ = 'http://github.com/silnrsi/pysilfont' +__copyright__ = 'Copyright (c) 2013 SIL International (http://www.sil.org)' +__license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)' +__author__ = 'David Raymond' + +import sys, os, fontforge +sys.path.append(os.path.join(os.environ['HOME'], 'src/pysilfont/scripts')) +import samples.demoFunctions # Loads demoFunctions.py module from src/pysilfont/scripts/samples +reload (samples.demoFunctions) # Reload the demo module each time you execute the script to pick up any recent edits +samples.demoFunctions.callFunctions("Colour Glyphs",fontforge.activeFont()) + +'''Demo usage: +Open the "Execute Script" dialog (from the FontForge File menu or press ctrl+.), +paste just the code section this (from "import..." to "samples...") into there then +run it (Alt+o) and see how it pops up a dialogue with a choice of 3 functions to run. +Edit demoFunctions.py and alter one of the functions. +Execute the script again and see that that the function's behaviour has changed. + +Additional functions can be added to demoFunctions.py and, if also defined functionList() +become availably immdiately. + +If you want to see the output from print statements, or use commands like input, (eg +for degugging purposes) then start FontForge from a terminal window rather than the +desktop launcher. + +When starting from a terminal window, you can also specify the font to use, +eg $ fontforge /home/david/RFS/GenBasR.sfd''' \ No newline at end of file -- cgit v1.2.3