Merge pull request #13 from pyoor/master

Refactored font class names
This commit is contained in:
pyoor 2017-04-25 10:13:26 -04:00 committed by GitHub
commit 99e4b89738

View file

@ -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 + "'";
}
};