From 71a2590641f30ff11031468812d698dd19358683 Mon Sep 17 00:00:00 2001 From: pyoor Date: Tue, 25 Apr 2017 10:12:48 -0400 Subject: [PATCH] Refactored font class names --- lib/make/fonts.js | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/make/fonts.js b/lib/make/fonts.js index 927aba2..7397583 100644 --- a/lib/make/fonts.js +++ b/lib/make/fonts.js @@ -2,52 +2,49 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -make.fonts = { - fontStyles: function () { +make.font = { + style: function () { return ["italic", "normal", "oblique", "inherit"]; }, - fontVariants: function () { + variant: function () { return ["normal", "small-caps", "inherit"]; }, - fontWeights: function () { + weight: function () { return ["normal", "bold", "bolder", "lighter"]; }, - fontSizeAbsolute: function () { + size: function () { return ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"]; }, - fontFamiliesGeneric: function () { + genericFamily: function () { return ["serif", "sans-serif", "cursive", "fantasy", "monospace"]; }, - fontFamilies: function () { - return ["'Times New Roman'", "Arial", "Courier", "Helvetica"]; + fammilyName: function () { + return ["Times New Roman", "Arial", "Courier", "Helvetica"]; }, - fontFamily: function () { + family: function () { let s = random.pick(make.fonts.fontFamilies); if (random.chance(8)) { s += ", " + random.pick(make.fonts.fontFamiliesGeneric); } return s; }, - fontSize: function () { - return make.numbers.unsignedNumber() + make.fonts.lengthUnit(); - }, font: function () { let s = ""; if (random.chance(4)) { - s += random.pick(make.fonts.fontStyles) + " "; + s += random.pick(make.fonts.style) + " "; } if (random.chance(4)) { - s += random.pick(make.fonts.fontVariants) + " "; + s += random.pick(make.fonts.variant) + " "; } if (random.chance(4)) { - s += random.pick(make.fonts.fontWeights) + " "; + s += random.pick(make.fonts.weight) + " "; } if (random.chance(4)) { s += make.numbers.number() + "/"; } - s += make.fonts.fontSize(); + s += make.fonts.size(); s += " "; - s += make.fonts.fontFamily(); + s += make.fonts.family(); return "'" + s + "'"; } };