Add PyInstaller packaging for Windows and Linux
- label_app.spec: one-file build bundling fonts, emoji data, ttkbootstrap themes and (on Windows) fribidi.dll so Pillow can shape emoji sequences - build-windows.ps1 helper; assets/icon.ico app icon - Fonts resolved from assets/fonts first, then system dirs, so the app runs from a bundle or a checkout on any OS - Bump Pillow pin to 12.3
This commit is contained in:
@@ -149,6 +149,27 @@ printer.print_image(image, density=density, model="d101")
|
||||
|
||||
`prepare_print` clamps density to the model's maximum, rotates, and raises `ValueError` if the image is wider than the print head. `print_image` raises `PrinterError` if the printer stops responding or rejects a command.
|
||||
|
||||
## Standalone executable (Windows / Linux)
|
||||
|
||||
A PyInstaller spec (`label_app.spec`) bundles the app, fonts, emoji data and themes into a single file. Build on the target OS — PyInstaller does not cross-compile.
|
||||
|
||||
**Windows** (PowerShell, with Python 3.10+ from python.org):
|
||||
|
||||
```
|
||||
.\build-windows.ps1
|
||||
```
|
||||
|
||||
produces `dist\NiimbotLabel.exe` (~30 MB, no installation needed). Bluetooth uses the Windows RFCOMM socket API, so pair the printer in Windows Bluetooth settings first, then enter its MAC address in the app. For USB, enter the `COMx` port or leave the address blank to auto-detect.
|
||||
|
||||
`assets/win/fribidi.dll` is bundled because Pillow's Windows wheel needs it for emoji sequences (flags, skin tones, 🧑💻-style ZWJ emoji); see `assets/win/README.md`.
|
||||
|
||||
**Linux**:
|
||||
|
||||
```
|
||||
.venv/bin/pip install pyinstaller
|
||||
.venv/bin/pyinstaller --noconfirm label_app.spec # -> dist/NiimbotLabel
|
||||
```
|
||||
|
||||
## Licence
|
||||
|
||||
[MIT](https://choosealicense.com/licenses/mit/). Originally developed by [kjy00302](https://github.com/kjy00302), forked & enhanced by [AndBondStyle](https://github.com/AndBondStyle)
|
||||
|
||||
Reference in New Issue
Block a user