From 161e2a5476ead59c5bb26ad42cb8d51309f1a4b5 Mon Sep 17 00:00:00 2001 From: Gavin McDonald Date: Tue, 20 May 2025 08:23:35 -0400 Subject: [PATCH] fonts for preview --- Dockerfile | 9 +++++++++ assets/css/app.css | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/Dockerfile b/Dockerfile index 6f7b2ce..21edce3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,6 +79,15 @@ RUN sed -i 's/main/main contrib non-free/g' /etc/apt/sources.list && \ apt-get clean && \ rm -f /var/lib/apt/lists/*_* +# fonts for preview +RUN mkdir -p /app/_build/prod/lib/labelmaker/priv/static/fonts +RUN ln -s /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf /app/_build/prod/lib/labelmaker/priv/static/fonts +RUN ln -s /usr/share/fonts/truetype/msttcorefonts/Georgia.ttf /app/_build/prod/lib/labelmaker/priv/static/fonts +RUN ln -s /usr/share/fonts/truetype/msttcorefonts/Impact.ttf /app/_build/prod/lib/labelmaker/priv/static/fonts +RUN ln -s /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf /app/_build/prod/lib/labelmaker/priv/static/fonts +RUN ln -s /usr/share/fonts/opentype/urw-base35/NimbusMonoPS-Regular.otf /app/_build/prod/lib/labelmaker/priv/static/fonts/Courier.otf +RUN ln -s /usr/share/fonts/opentype/urw-base35/NimbusSans-Regular.otf /app/_build/prod/lib/labelmaker/priv/static/fonts/Helvetica.otf + # Debian version still uses 'convert' RUN ln -s $(which convert) /usr/local/bin/magick diff --git a/assets/css/app.css b/assets/css/app.css index 5dccbd4..b76e9cf 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -3,3 +3,45 @@ @import 'tailwindcss/utilities'; /* This file is for your main application CSS */ + +@font-face { + font-family: 'Comic-Sans-MS'; + src: url('/fonts/Comic_Sans_MS.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'Georgia'; + src: url('/fonts/Georgia.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'Impact'; + src: url('/fonts/Impact.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'Verdana'; + src: url('/fonts/Verdana.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'Courier'; + src: url('/fonts/Courier.otf') format('opentype'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'Helvetica'; + src: url('/fonts/Helvetica.otf') format('opentype'); + font-weight: normal; + font-style: normal; +}