aboutsummaryrefslogtreecommitdiff
path: root/exampleData/ruleSets/font/fontRules.json
diff options
context:
space:
mode:
Diffstat (limited to 'exampleData/ruleSets/font/fontRules.json')
-rw-r--r--exampleData/ruleSets/font/fontRules.json35
1 files changed, 35 insertions, 0 deletions
diff --git a/exampleData/ruleSets/font/fontRules.json b/exampleData/ruleSets/font/fontRules.json
new file mode 100644
index 0000000..297d242
--- /dev/null
+++ b/exampleData/ruleSets/font/fontRules.json
@@ -0,0 +1,35 @@
+/*
+ * fontRules.json
+ *
+ * Simple rules for checking that fonts (family/weight/size) of specific elements are
+ * in a specific set.
+ *
+ */
+
+{ 'name': 'Fonts'
+, 'description': 'Guidelines regarding site fonts'
+, 'rules': [
+ //---------------------------------------------------------
+ { 'id': 5141301
+ , 'name': 'Font properties check'
+ , 'description': 'Verify that fonts (family, size, weight) are \"standard\"'
+ , 'rule':
+ function() {
+ var allow = {
+ 'Verdana': { 'bold': [25, 22, 12, 10]
+ , 'normal': [12, 11, 10] }};
+ fiveui.query('body p,:header').each(
+ function(i, elt) {
+ var font = fiveui.font.getFont($(elt));
+ if (!fiveui.font.validate(allow, font)) {
+ report('non-standard font: ' +
+ font.family + ', ' +
+ font.size + ', ' +
+ font.weight, elt);
+ }
+ });
+ }
+ }//,
+ //---------------------------------------------------------
+]
+}