diff --git a/tests/scripts/generate.pe b/tests/scripts/generate.pe new file mode 100755 index 0000000..d023cea --- /dev/null +++ b/tests/scripts/generate.pe @@ -0,0 +1,7 @@ +#!/usr/bin/fontforge +i=1 +Open($argv[i], 1) +#Use gen_flags=Defualt fmflags value as -1 +gen_flags = -1 +Generate("" + $fontname + ".ttf", "", gen_flags) + diff --git a/tests/scripts/get-font-metadata.py b/tests/scripts/get-font-metadata.py new file mode 100644 index 0000000..b28ad84 --- /dev/null +++ b/tests/scripts/get-font-metadata.py @@ -0,0 +1,31 @@ +#!/usr/bin/python3 + +import fontforge +import sys + +if len(sys.argv) > 1: + f = fontforge.open(sys.argv[1]) +else: + print("provide fontfile path as an argument") + sys.exit(1) + +if f.fullname: + print("Fontname is {0}".format(f.fullname)) +else: + print("fontname not set") +if f.weight: + print("Given font weight is {0}".format(f.weight)) +else: + print("Given font weight not set") +if f.version: + print("Given font version is {0}".format(f.version)) +else: + print("Given font version not set") +if f.copyright: + print("Given font Copyright text is => {0}".format(f.copyright)) +else: + print("Given font copyright information not set") + +ver = fontforge.UnicodeNamesListVersion() +print("Libuninameslist version is : %s" % ver) + diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh new file mode 100644 index 0000000..83aebe3 --- /dev/null +++ b/tests/scripts/run_tests.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +/usr/bin/fontforge -script generate.pe /usr/share/fontforge/python/test.sfd +/usr/bin/python3 get-font-metadata.py ./Untitled1.ttf diff --git a/tests/tests.yaml b/tests/tests.yaml new file mode 100644 index 0000000..86bdd13 --- /dev/null +++ b/tests/tests.yaml @@ -0,0 +1,9 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + tests: + - simple: + dir: scripts/ + run: run_tests.sh