Skip to content

Persian (RTL) characters rendering as squares in labels despite correct custom font configuration #1169

Description

@Ali2kCom

First Check

  • This is not a feature request
  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the documentation, with the integrated search.
  • I already read the docs and didn't find an answer.
  • I can replicate the issue inside the Demo install.

Homebox Version

Nightly

What is the issue you are experiencing?

Describe the bug

I am using the Homebox Nightly build to enable the custom font feature for labels. However, Persian (RTL) characters are still rendered as squares (tofu) in the label preview, even though a compatible Unicode font (Vazirmatn) is correctly mounted and the environment variable is set.

Environment Information

  • Homebox Version: Nightly
  • Build ID: 2638f21
  • Installation Method: Docker Compose

Expected behavior

The label generator should use the provided custom font to render Persian/Arabic characters correctly. It should also ideally handle RTL shaping (connecting characters).

Actual behavior

Persian characters are replaced by squares in the generated label image.

Additional context

It seems the current implementation might not be passing the custom font to the specific engine responsible for rendering the PNG preview or the QR code label text for non-ASCII characters.

Image

How can the maintainer reproduce the issue?

Steps to Reproduce / My Configuration

1. Font Setup

Create a fonts directory and download a compatible Persian font (Vazirmatn):

mkdir fonts
wget https://github.com/rastikerdar/vazirmatn/raw/master/fonts/ttf/Vazirmatn-Regular.ttf -O fonts/vazir.ttf

2. Docker Compose Configuration

services:
  homebox:
    image: ghcr.io/sysadminsmedia/homebox:nightly
    environment:
      - HBOX_LABEL_MAKER_CUSTOM_FONT=/app/fonts/vazir.ttf
      - HBOX_STORAGE_DATA=/data
    volumes:
      - ./data:/data
      - ./fonts:/app/fonts:ro

3. Verification

I verified that the font file is accessible inside the container:

docker exec -it homebox ls -l /app/fonts/vazir.ttf

Output:

-rw-r--r-- 1 root root 122752 Dec 26 10:31 /app/fonts/vazir.ttf

4. Result

When creating an item with a Persian name (e.g., "آشپزخانه" or "تست نسخه جدید"), the label preview shows empty squares instead of Persian characters.

Deployment

Docker (Linux)

Database Type

SQLite

OS Architechture

x86_64 (AMD, Intel)

Deployment Details

Metadata

Metadata

Assignees

No one assigned

    Labels

    🕷️ bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions