diff --git a/assets/DMSans-Black.ttf b/assets/DMSans-Black.ttf new file mode 100644 index 0000000..8ce7649 Binary files /dev/null and b/assets/DMSans-Black.ttf differ diff --git a/assets/DMSans-BlackItalic.ttf b/assets/DMSans-BlackItalic.ttf new file mode 100644 index 0000000..df12ca1 Binary files /dev/null and b/assets/DMSans-BlackItalic.ttf differ diff --git a/assets/DMSans-Bold.ttf b/assets/DMSans-Bold.ttf new file mode 100644 index 0000000..809e978 Binary files /dev/null and b/assets/DMSans-Bold.ttf differ diff --git a/assets/DMSans-BoldItalic.ttf b/assets/DMSans-BoldItalic.ttf new file mode 100644 index 0000000..a22b782 Binary files /dev/null and b/assets/DMSans-BoldItalic.ttf differ diff --git a/assets/DMSans-ExtraBold.ttf b/assets/DMSans-ExtraBold.ttf new file mode 100644 index 0000000..30871f4 Binary files /dev/null and b/assets/DMSans-ExtraBold.ttf differ diff --git a/assets/DMSans-ExtraBoldItalic.ttf b/assets/DMSans-ExtraBoldItalic.ttf new file mode 100644 index 0000000..883833c Binary files /dev/null and b/assets/DMSans-ExtraBoldItalic.ttf differ diff --git a/assets/DMSans-ExtraLight.ttf b/assets/DMSans-ExtraLight.ttf new file mode 100644 index 0000000..99f9a11 Binary files /dev/null and b/assets/DMSans-ExtraLight.ttf differ diff --git a/assets/DMSans-ExtraLightItalic.ttf b/assets/DMSans-ExtraLightItalic.ttf new file mode 100644 index 0000000..d6eb5cd Binary files /dev/null and b/assets/DMSans-ExtraLightItalic.ttf differ diff --git a/assets/DMSans-Italic.ttf b/assets/DMSans-Italic.ttf new file mode 100644 index 0000000..3319ec3 Binary files /dev/null and b/assets/DMSans-Italic.ttf differ diff --git a/assets/DMSans-Light.ttf b/assets/DMSans-Light.ttf new file mode 100644 index 0000000..1acb39b Binary files /dev/null and b/assets/DMSans-Light.ttf differ diff --git a/assets/DMSans-LightItalic.ttf b/assets/DMSans-LightItalic.ttf new file mode 100644 index 0000000..5102817 Binary files /dev/null and b/assets/DMSans-LightItalic.ttf differ diff --git a/assets/DMSans-Medium.ttf b/assets/DMSans-Medium.ttf new file mode 100644 index 0000000..c29713e Binary files /dev/null and b/assets/DMSans-Medium.ttf differ diff --git a/assets/DMSans-MediumItalic.ttf b/assets/DMSans-MediumItalic.ttf new file mode 100644 index 0000000..841221e Binary files /dev/null and b/assets/DMSans-MediumItalic.ttf differ diff --git a/assets/DMSans-Regular.ttf b/assets/DMSans-Regular.ttf new file mode 100644 index 0000000..28ff3c8 Binary files /dev/null and b/assets/DMSans-Regular.ttf differ diff --git a/assets/DMSans-SemiBold.ttf b/assets/DMSans-SemiBold.ttf new file mode 100644 index 0000000..4dde304 Binary files /dev/null and b/assets/DMSans-SemiBold.ttf differ diff --git a/assets/DMSans-SemiBoldItalic.ttf b/assets/DMSans-SemiBoldItalic.ttf new file mode 100644 index 0000000..115a954 Binary files /dev/null and b/assets/DMSans-SemiBoldItalic.ttf differ diff --git a/assets/DMSans-Thin.ttf b/assets/DMSans-Thin.ttf new file mode 100644 index 0000000..b379d1a Binary files /dev/null and b/assets/DMSans-Thin.ttf differ diff --git a/assets/DMSans-ThinItalic.ttf b/assets/DMSans-ThinItalic.ttf new file mode 100644 index 0000000..1340c64 Binary files /dev/null and b/assets/DMSans-ThinItalic.ttf differ diff --git a/assets/Figtree-ExtraBold.woff b/assets/Figtree-ExtraBold.woff deleted file mode 100644 index 73d320f..0000000 Binary files a/assets/Figtree-ExtraBold.woff and /dev/null differ diff --git a/assets/Figtree-Medium.woff b/assets/Figtree-Medium.woff deleted file mode 100644 index e254793..0000000 Binary files a/assets/Figtree-Medium.woff and /dev/null differ diff --git a/assets/Figtree-Regular.woff b/assets/Figtree-Regular.woff deleted file mode 100644 index 783b05e..0000000 Binary files a/assets/Figtree-Regular.woff and /dev/null differ diff --git a/assets/OFL.txt b/assets/OFL.txt new file mode 100644 index 0000000..6bde33e --- /dev/null +++ b/assets/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2014-2017 Indian Type Foundry (info@indiantypefoundry.com). Copyright 2019 Google LLC. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/lib/render.js b/lib/render.js index 298ea15..b39d37c 100644 --- a/lib/render.js +++ b/lib/render.js @@ -1,31 +1,117 @@ import html2png, { renderHtml as htmlParser } from '@besties/html2png' import fs from 'node:fs' -const figtreeRegular = fs.readFileSync('./assets/Figtree-Regular.woff') -const figtreeMedium = fs.readFileSync('./assets/Figtree-Medium.woff') -const figtreeExtraBold = fs.readFileSync('./assets/Figtree-ExtraBold.woff') - const css = fs.readFileSync('./assets/style.css', 'utf8') const renderOptions = { fonts: [ { - name: 'Figtree', - data: figtreeRegular, + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-Thin.ttf'), + weight: 100, + style: 'normal' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-ThinItalic.ttf'), + weight: 100, + style: 'italic' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-ExtraLight.ttf'), + weight: 200, + style: 'normal' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-ExtraLightItalic.ttf'), + weight: 200, + style: 'italic' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-Light.ttf'), + weight: 300, + style: 'normal' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-LightItalic.ttf'), + weight: 300, + style: 'italic' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-Regular.ttf'), weight: 400, style: 'normal' }, { - name: 'Figtree', - data: figtreeMedium, + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-Italic.ttf'), + weight: 400, + style: 'italic' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-Medium.ttf'), weight: 500, style: 'normal' }, { - name: 'Figtree', - data: figtreeExtraBold, + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-MediumItalic.ttf'), + weight: 500, + style: 'italic' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-SemiBold.ttf'), + weight: 600, + style: 'normal' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-SemiBoldItalic.ttf'), + weight: 600, + style: 'italic' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-Bold.ttf'), + weight: 700, + style: 'normal' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-BoldItalic.ttf'), + weight: 700, + style: 'italic' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-ExtraBold.ttf'), weight: 800, style: 'normal' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-ExtraBoldItalic.ttf'), + weight: 800, + style: 'italic' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-Black.ttf'), + weight: 900, + style: 'normal' + }, + { + name: 'DM Sans', + data: fs.readFileSync('./assets/DMSans-BlackItalic.ttf'), + weight: 900, + style: 'normal' } ] } diff --git a/views/layout.eta b/views/layout.eta index f9e82ea..79479b6 100644 --- a/views/layout.eta +++ b/views/layout.eta @@ -5,7 +5,7 @@