From 761c9339ffe85f440c4e46325c29907ee1e913b6 Mon Sep 17 00:00:00 2001 From: Gavin McDonald Date: Wed, 14 May 2025 15:26:45 -0400 Subject: [PATCH 1/6] writable labels directory for Docker images --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3e8bb86..49dcb74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -86,8 +86,10 @@ ENV LC_ALL=en_US.UTF-8 WORKDIR "/app" +# configure the directory for generated images +# probably need some better permissions here RUN mkdir -p /app/_build/prod/lib/labelmaker/priv/static/labels -RUN chmod -R 775 /app/_build/prod/lib/labelmaker/priv/static/labels +RUN chmod -R 777 /app/_build/prod/lib/labelmaker/priv/static/labels RUN chown nobody /app From 37451dbfc757be33ddecc1dbcb8c2a66a2e870eb Mon Sep 17 00:00:00 2001 From: Gavin McDonald Date: Wed, 14 May 2025 15:31:32 -0400 Subject: [PATCH 2/6] tweaks to look better when used in Tabletop Simulator --- lib/labelmaker_web/constants.ex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/labelmaker_web/constants.ex b/lib/labelmaker_web/constants.ex index fc99daa..0cba645 100644 --- a/lib/labelmaker_web/constants.ex +++ b/lib/labelmaker_web/constants.ex @@ -4,8 +4,8 @@ defmodule LabelmakerWeb.Constants do link: "", font: "Helvetica", color: "black", - outline: "white", - size: "32" + outline: "none", + size: "72" } @preview %{ @@ -42,9 +42,9 @@ defmodule LabelmakerWeb.Constants do @outlines ~w(none white black gray) - @sizes 8..72 + @sizes 16..128 |> Enum.to_list() - |> Enum.take_every(4) + |> Enum.take_every(8) |> Enum.map(&Integer.to_string/1) def colors, do: @colors From ea5f6f10eb7616b72c212ecdcd59bcdd336f217a Mon Sep 17 00:00:00 2001 From: Gavin McDonald Date: Wed, 14 May 2025 16:12:56 -0400 Subject: [PATCH 3/6] README --- README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 44f8781..d07d8f3 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,71 @@ # Labelmaker -To start your Phoenix server: +**Labelmaker** is a simple web tool for generating text-based images, perfect for creating decals in [Tabletop Simulator](https://www.tabletopsimulator.com/). Just append your desired text to the URL and Labelmaker will return an image—no design tools required. - * Run `mix setup` to install and setup dependencies - * Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server` +## ✨ Features -Now you can visit [`localhost:4000`](http://localhost:4000) from your browser. +- 📦 Instant text-to-image conversion via URL +- 🎨 Customizable `color`, `outline`, `font`, and `size` via query string +- 🧩 Designed for ease of use with Tabletop Simulator +- 🧭 Interactive homepage to preview available options -Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html). +## 🚀 Usage -## Learn more +### Basic Label - * Official website: https://www.phoenixframework.org/ - * Guides: https://hexdocs.pm/phoenix/overview.html - * Docs: https://hexdocs.pm/phoenix - * Forum: https://elixirforum.com/c/phoenix-forum - * Source: https://github.com/phoenixframework/phoenix +https://labelmaker.xyz/Hello World +Generates an image of "Hello World" in the default style. + +### Set Text Color + +https://labelmaker.xyz/Hello?color=yellow +Renders "Hello" in yellow text. + +### Add Outline + +https://labelmaker.xyz/Hello?color=yellow&outline=black +Renders "Hello" in yellow with a black outline—perfect for contrast on similar backgrounds. + +### Customize Font and Size + +https://labelmaker.xyz/Hello?font=Courier&size=48 +Uses the `Courier` font at 48px size. + +## ⚙️ Query Parameters + +| Parameter | Description | Example Value | +| --------- | ------------------- | ----------------------- | +| `color` | Text color | `red`, `CornFlowerBlue` | +| `outline` | Outline color | `black`, `white` | +| `font` | Font name | `Courier`, `Helvetica` | +| `size` | Font size in pixels | `24`, `48` | + +## 🧪 Try It Live + +Visit the [Labelmaker homepage](https://labelmaker.xyz/) to: + +- Preview fonts and colors +- Test out combinations +- Copy generated URLs for use in Tabletop Simulator or elsewhere + +## 🧰 Development + +This project is powered by Elixir + Phoenix, employs ImageMagick to create the images, and uses Docker for deployment. + +### Build & Run Locally + +```sh +mix setup +mix phx.server +``` + +Or use Docker: + +```sh +docker build -t labelmaker . +docker run -p 4000:4000 labelmaker +``` + +``` + +``` From 9e2d7b26248e84a98bcdafb6657d354eaced05e3 Mon Sep 17 00:00:00 2001 From: Gavin McDonald Date: Wed, 14 May 2025 16:21:06 -0400 Subject: [PATCH 4/6] readme tweaks --- README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d07d8f3..6066f11 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Labelmaker -**Labelmaker** is a simple web tool for generating text-based images, perfect for creating decals in [Tabletop Simulator](https://www.tabletopsimulator.com/). Just append your desired text to the URL and Labelmaker will return an image—no design tools required. +[Labelmaker](https://labelmaker.xyz) is a simple web tool for generating text-based images, perfect for creating decals in [Tabletop Simulator](https://www.tabletopsimulator.com/). Just append your desired text to the URL and Labelmaker will return an image, no design tools required. ## ✨ Features @@ -14,22 +14,34 @@ ### Basic Label https://labelmaker.xyz/Hello World + Generates an image of "Hello World" in the default style. +![Hello World](https://labelmaker.xyz/Hello World) + ### Set Text Color https://labelmaker.xyz/Hello?color=yellow + Renders "Hello" in yellow text. +![Yellow Hello](https://labelmaker.xyz/Hello?color=yellow) + ### Add Outline https://labelmaker.xyz/Hello?color=yellow&outline=black -Renders "Hello" in yellow with a black outline—perfect for contrast on similar backgrounds. + +Renders "Hello" in yellow with a black outline, perfect for contrast on similar backgrounds. + +![Outlined yellow Hello](https://labelmaker.xyz/Hello?color=yellow&outline=black) ### Customize Font and Size -https://labelmaker.xyz/Hello?font=Courier&size=48 -Uses the `Courier` font at 48px size. +https://labelmaker.xyz/Courier?font=Courier&size=72&color=CornFlowerBlue&outline=white + +Uses the `Courier` font at 72px size. + +![CornFlowerBlue Courier](https://labelmaker.xyz/Courier?font=Courier&size=72&color=CornFlowerBlue&outline=white) ## ⚙️ Query Parameters From d926d6446eb180280a0aa37ba61de8a13cb0d77e Mon Sep 17 00:00:00 2001 From: Gavin McDonald Date: Wed, 14 May 2025 16:42:39 -0400 Subject: [PATCH 5/6] readme fixes --- README.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6066f11..12c33b2 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,15 @@ ### Basic Label -https://labelmaker.xyz/Hello World +[https://labelmaker.xyz/Hello World](https://labelmaker.xyz/Hello%20World) Generates an image of "Hello World" in the default style. -![Hello World](https://labelmaker.xyz/Hello World) +![Hello World](https://labelmaker.xyz/Hello%20World?outline=white) ### Set Text Color -https://labelmaker.xyz/Hello?color=yellow +[https://labelmaker.xyz/Hello?color=yellow](https://labelmaker.xyz/Hello?color=yellow) Renders "Hello" in yellow text. @@ -29,7 +29,7 @@ Renders "Hello" in yellow text. ### Add Outline -https://labelmaker.xyz/Hello?color=yellow&outline=black +[https://labelmaker.xyz/Hello?color=yellow&outline=black](https://labelmaker.xyz/Hello?color=yellow&outline=black) Renders "Hello" in yellow with a black outline, perfect for contrast on similar backgrounds. @@ -37,11 +37,19 @@ Renders "Hello" in yellow with a black outline, perfect for contrast on similar ### Customize Font and Size -https://labelmaker.xyz/Courier?font=Courier&size=72&color=CornFlowerBlue&outline=white +[https://labelmaker.xyz/Courier?font=Courier&size=96&color=CornFlowerBlue&outline=white](https://labelmaker.xyz/Courier?font=Courier&size=96&color=CornFlowerBlue&outline=white) -Uses the `Courier` font at 72px size. +Uses the `Courier` font at 96px size. -![CornFlowerBlue Courier](https://labelmaker.xyz/Courier?font=Courier&size=72&color=CornFlowerBlue&outline=white) +![CornflowerBlue Courier](https://labelmaker.xyz/Courier?font=Courier&size=72&color=CornflowerBlue&outline=white) + +### Multiple Lines + +[https://labelmaker.xyz/Multiple\nLines?font=DejaVu-Sans-Oblique&color=orange](https://labelmaker.xyz/Multiple\nLines?font=DejaVu-Sans-Oblique&color=orange) + +Use `\n` to insert line breaks. + +![Multiple\nLines](https://labelmaker.xyz/Multiple\nLines?font=DejaVu-Sans-Oblique&size=72&color=orange) ## ⚙️ Query Parameters From e6cd7cf3e3b3607aeab67625e9a3faee0c5dad87 Mon Sep 17 00:00:00 2001 From: Gavin McDonald Date: Thu, 15 May 2025 07:58:33 -0400 Subject: [PATCH 6/6] trying new fonts --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 49dcb74..6024d06 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}" FROM ${BUILDER_IMAGE} AS builder # install build dependencies -RUN apt-get update -y && apt-get install -y build-essential git imagemagick fonts-dejavu fonts-liberation fonts-freefont-ttf \ +RUN apt-get update -y && apt-get install -y build-essential git imagemagick ttf-mscorefonts-installer \ && apt-get clean && rm -f /var/lib/apt/lists/*_* # Debian version still uses 'convert' @@ -71,7 +71,7 @@ RUN mix release FROM ${RUNNER_IMAGE} RUN apt-get update -y && \ - apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates imagemagick fonts-dejavu fonts-liberation fonts-freefont-ttf \ + apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates imagemagick ttf-mscorefonts-installer \ && apt-get clean && rm -f /var/lib/apt/lists/*_* # Debian version still uses 'convert'