1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-06-25 08:38:43 +00:00

Merge branch 'master' into belono/issue665

This commit is contained in:
Patrick Kanzler 2025-02-21 10:41:12 +01:00 committed by GitHub
commit 1a72b27de9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 3 deletions

View File

@ -27,6 +27,6 @@ jobs:
sudo apt-get update -y && sudo apt-get update -y &&
sudo apt-get install -y git python3-sphinx graphviz libenchant-2-2 && sudo apt-get install -y git python3-sphinx graphviz libenchant-2-2 &&
sudo apt-get install -y gcc libcups2-dev python3-dev python3-setuptools && sudo apt-get install -y gcc libcups2-dev python3-dev python3-setuptools &&
sudo pip install tox pycups sudo pip install --ignore-installed tox pycups
- name: Test doc build - name: Test doc build
run: tox -e docs run: tox -e docs

View File

@ -19,7 +19,7 @@ jobs:
with: with:
submodules: 'recursive' submodules: 'recursive'
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.3.0 uses: actions/setup-python@v5.4.0
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies

View File

@ -22,7 +22,7 @@ jobs:
with: with:
submodules: 'recursive' submodules: 'recursive'
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.3.0 uses: actions/setup-python@v5.4.0
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies

View File

@ -0,0 +1,25 @@
""" Example for software_columns: Print text arranged into columns."""
from escpos import printer
p = printer.Dummy(profile="TM-U220")
font = "a"
p.set(font=font)
# Default: Automatic column width given the characters per line of the printer.
text_list = ["col1", "col2", "col3"]
charsxline = p.profile.get_columns(font)
p.software_columns(text_list=text_list, widths=charsxline, align="center")
# Tuning some columns:
text_list = ["col1", "col2", "col3"]
widths = [5, 20] # col1 = 5 chars width, col2 + col3 = 20 chars width
align = ["left", "center"] # col1 = left aligned, col2 + col3 = center aligned
p.software_columns(text_list=text_list, widths=widths, align=align)
# Tuning them all:
text_list = ["col1", "col2", "col3"]
widths = [5, 20, 15]
align = ["left", "center", "right"]
p.software_columns(text_list=text_list, widths=widths, align=align)