diff --git a/README.md b/README.md index 0b4f29a..788b3d8 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,18 @@ https://fonts.google.com/specimen/Didact+Gothic?query=did#about License: Open Font License. https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL +### TYPEWRITER CONDENSED FONT + +By Volker Busse - F25 Digital Typeface Design +License: None given +https://www.dafont.com/typewriter-condensed.font + +### ANOTHER TYPEWRITER Font + +By Johan Holmdahl +License: None given +https://www.dafont.com/another-typewriter.font + ## Game Icons ICONS - https://game-icons.net/ diff --git a/assets/font/another-typewriter/Don't read this.txt b/assets/font/another-typewriter/Don't read this.txt new file mode 100644 index 0000000..9446007 --- /dev/null +++ b/assets/font/another-typewriter/Don't read this.txt @@ -0,0 +1,2 @@ +Another Typewriter. +Freeware by Johan Holmdahl 1999. \ No newline at end of file diff --git a/assets/font/another-typewriter/atwriter.ttf b/assets/font/another-typewriter/atwriter.ttf new file mode 100644 index 0000000..41f9c33 Binary files /dev/null and b/assets/font/another-typewriter/atwriter.ttf differ diff --git a/assets/font/typewriter-condensed/typewcond_bold.otf b/assets/font/typewriter-condensed/typewcond_bold.otf new file mode 100644 index 0000000..b4afb34 Binary files /dev/null and b/assets/font/typewriter-condensed/typewcond_bold.otf differ diff --git a/assets/font/typewriter-condensed/typewcond_demi.otf b/assets/font/typewriter-condensed/typewcond_demi.otf new file mode 100644 index 0000000..af39b61 Binary files /dev/null and b/assets/font/typewriter-condensed/typewcond_demi.otf differ diff --git a/assets/font/typewriter-condensed/typewcond_regular.otf b/assets/font/typewriter-condensed/typewcond_regular.otf new file mode 100644 index 0000000..b7b6f55 Binary files /dev/null and b/assets/font/typewriter-condensed/typewcond_regular.otf differ diff --git a/assets/img/old_paper.jpg b/assets/img/old_paper.jpg new file mode 100644 index 0000000..fb530c6 Binary files /dev/null and b/assets/img/old_paper.jpg differ diff --git a/css/deltagreen.css b/css/deltagreen.css index 81bc5b2..ba85fda 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -2,12 +2,58 @@ @import url("https://fonts.googleapis.com/css2?family=Didact+Gothic"); @import url('https://fonts.googleapis.com/css2?family=Special+Elite&display=swap'); +@font-face { + font-family: 'atwriter'; + src: url('../assets/font/another-typewriter/atwriter.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5, Opera 10+, Safari 3—5 */ +} + +@font-face { + font-family: TypeWriterCondensed; + src: url("../assets/font/typewriter-condensed/typewcond_regular.otf") format("opentype"); +} + +@font-face { + font-family: TypeWriterCondensed; + font-weight: bold; + src: url("../assets/font/typewriter-condensed/typewcond_bold.otf") format("opentype"); +} + +@font-face { + font-family: TypeWriterCondensed; + font-weight: 600; + src: url("../assets/font/typewriter-condensed/typewcond_demi.otf") format("opentype"); +} + /* Global styles */ -/* switch fonts to include "Special Elite" as option? */ + +/* .window-app { - font-family: "Martel", 'Signika', sans-serif !important; + font-family: "TypeWriterCondensed", "atwriter", "Martel", 'Signika', sans-serif !important; height: auto; } +*/ + +/* +section.window-content{ + background: url("../assets/img/old_paper.jpg") !important; +} +*/ + +.typewriter-condensed-font{ + font-family: "TypeWriterCondensed", sans-serif !important; +} + +.martel-font{ + font-family: "Martel", sans-serif !important; +} + +.signika-font{ + font-family: "Signika", sans-serif !important; +} + +.atwriter-font{ + font-family: "atwriter", sans-serif !important; +} .rollable:hover, .rollable:focus { color: #000; @@ -141,15 +187,6 @@ text-align: left; } -/* Styles limited to delta green sheets */ -.deltagreen { - font-family: "Didact Gothic", "Roboto", sans-serif; -} - -.deltagreen .item-form { - font-family: "Didact Gothic", "Roboto", sans-serif; -} - .deltagreen .sheet-header { -webkit-box-flex: 0; -ms-flex: 0 0 400px; @@ -167,7 +204,6 @@ -webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start; - } .deltagreen .sheet-header .profile-img { diff --git a/module/deltagreen.js b/module/deltagreen.js index 0b58375..31fc38b 100644 --- a/module/deltagreen.js +++ b/module/deltagreen.js @@ -4,7 +4,7 @@ import { DeltaGreenActorSheet } from "./actor/actor-sheet.js"; import { DeltaGreenItem } from "./item/item.js"; import { DeltaGreenItemSheet } from "./item/item-sheet.js"; import { sendPercentileTestToChat, sendLethalityTestToChat, sendDamageRollToChat } from "./roll/roll.js"; - +import { registerSystemSettings } from "./settings.js" import { preloadHandlebarsTemplates } from "./templates.js"; Hooks.once('init', async function() { @@ -26,6 +26,9 @@ Hooks.once('init', async function() { decimals: 0 }; + // Register System Settings + registerSystemSettings(); + // Define custom Entity classes CONFIG.Actor.entityClass = DeltaGreenActor; CONFIG.Item.entityClass = DeltaGreenItem; @@ -106,6 +109,29 @@ Hooks.once('init', async function() { return ""; } }); + + // looks at system setting for what font to use and returns the class that is then used in the handlebars template that + // generates the character sheet. + Handlebars.registerHelper('getFontFamilySystemSettingClass', function() { + let setting = game.settings.get("deltagreen", "characterSheetFont"); + + if(setting === "TypeWriterCondensed"){ + return "typewriter-condensed-font"; + } + else if(setting === "Martel"){ + return "martel-font"; + } + else if(setting === "Signika"){ + return "signika-font"; + } + else if(setting === "atwriter"){ + return "atwriter-font"; + } + else{ + return "martel-font"; + } + + }); }); Hooks.once("ready", async function() { diff --git a/module/settings.js b/module/settings.js new file mode 100644 index 0000000..16a0384 --- /dev/null +++ b/module/settings.js @@ -0,0 +1,19 @@ +export const registerSystemSettings = function() { + game.settings.register('deltagreen', 'characterSheetFont', { + name: "World Font Choice", + hint: "Choose font style for use throughout this world.", + scope: "world", // This specifies a world-stored setting + config: true, // This specifies that the setting appears in the configuration view + type: String, + choices: { // If choices are defined, the resulting setting will be a select menu + "TypeWriterCondensed": "Condensed Typewriter", + "atwriter": "Another Typewriter", + "Martel": "Martel", + "Signika": "Signika" + }, + default: "TypeWriterCondensed", // The default value for the setting + onChange: value => { // A callback function which triggers when the setting is changed + console.log(value) + } + }); +} \ No newline at end of file diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index d024c43..1f524d6 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -1,4 +1,4 @@ -