Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup-pango-cairo/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
id: apt-pkgs
shell: bash
run: |
pkgs="libgirepository-1.0-1 libcairo2 gir1.2-pango-1.0 pkg-config libcairo2-dev libgirepository1.0-dev python3-dev"
pkgs="libcairo2 gir1.2-pango-1.0 pkg-config libcairo2-dev libgirepository-2.0-dev python3-dev"
echo "pkgs=$pkgs" >> $GITHUB_OUTPUT
echo "hash=$(echo -n "$pkgs" | sha256sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT
echo "cache_version=1" >> $GITHUB_OUTPUT
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ RUN sed -i 's|http://|https://|g' /etc/apt/sources.list.d/*.sources
RUN apt-get update -q

# Install rendering system dependencies
RUN apt-get install -y libgirepository-1.0-1 libcairo2 gir1.2-pango-1.0 pkg-config libcairo2-dev libgirepository1.0-dev
# (pycairo and PyGObject have no Linux wheels, so they are compiled from source)
RUN apt-get install -y gcc libcairo2 gir1.2-pango-1.0 pkg-config libcairo2-dev libgirepository-2.0-dev

COPY . /pixel-renderer
WORKDIR /pixel-renderer
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ This repository contains a text renderer for PIXEL models.

## Usage

Install dependencies:
Install dependencies (conda-forge provides pre-built Cairo, Pango and PyGObject):

```shell
conda create -n pixel python=3.12 -y
conda activate pixel
conda install -c conda-forge pycairo pygobject pango -y
pip install ".[dev,pangocairo]"
```

> [!TIP]
> Having trouble installing `pycairo` and `pygobject`?
> Without conda, `pycairo` and `PyGObject` are compiled from source and need system libraries.
> On Ubuntu 24.04+ / Debian 13+:
> `sudo apt install gcc pkg-config libcairo2-dev libgirepository-2.0-dev gir1.2-pango-1.0 python3-dev`.
> On older systems (GLib < 2.80, e.g. Ubuntu 22.04), install `libgirepository1.0-dev` and `pip install "PyGObject<3.52"`.
> See [these instructions](https://pygobject.readthedocs.io/en/latest/getting_started.html#installing-pygobject).

Install:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dev = [

pangocairo = [
"pycairo", # To render images using Cairo
"PyGObject<3.52", # Use PyGObject < 3.52 which supports girepository-1.0
"PyGObject", # Python bindings for Pango (via GObject introspection)
]

[tool.setuptools]
Expand Down
Loading