Made it so the font actually gets loaded, fixed run.sh
This commit is contained in:
parent
b6e7445d5f
commit
b63565646a
19
main.py
19
main.py
@ -7,23 +7,17 @@ import re
|
||||
import subprocess
|
||||
import os
|
||||
import time
|
||||
import threading
|
||||
import io
|
||||
import multiprocessing
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from flask import request
|
||||
from flask import jsonify
|
||||
|
||||
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout, QHBoxLayout
|
||||
from PyQt5.QtCore import Qt, QObject, QTimer, QRect, pyqtSignal, pyqtSlot
|
||||
from PyQt5.QtGui import QPainter, QColor, QFont, QPen, QBrush, QPixmap, QPainterPath
|
||||
from PyQt5.QtWidgets import *
|
||||
from PyQt5.QtCore import *
|
||||
from PyQt5.QtGui import *
|
||||
|
||||
from multiprocessing import Queue
|
||||
|
||||
import traceback
|
||||
|
||||
os.environ["LC_ALL"] = "C"
|
||||
os.environ["LANG"] = "C"
|
||||
|
||||
@ -37,6 +31,10 @@ M3U_URL = os.environ.get('IPMPV_M3U_URL')
|
||||
|
||||
class OsdWidget(QWidget):
|
||||
def __init__(self, channel_info, width=600, height=165, close_time=5, corner_radius=int(osd_corner_radius) if osd_corner_radius is not None else 15):
|
||||
|
||||
QFontDatabase.addApplicationFont('FiraSans-Regular.ttf')
|
||||
QFontDatabase.addApplicationFont('FiraSans-Bold.ttf')
|
||||
|
||||
global is_wayland
|
||||
super().__init__()
|
||||
|
||||
@ -138,7 +136,7 @@ class OsdWidget(QWidget):
|
||||
except Exception as e:
|
||||
print(f"Failed to load logo: {e}")
|
||||
|
||||
def paintEvent(self, event):
|
||||
def paintEvent(self, a0):
|
||||
painter = QPainter(self)
|
||||
painter.setRenderHint(QPainter.Antialiasing)
|
||||
|
||||
@ -165,7 +163,6 @@ class OsdWidget(QWidget):
|
||||
# Setup text drawing
|
||||
painter.setPen(QColor(255, 255, 255))
|
||||
|
||||
# Use Fira Sans as originally intended
|
||||
try:
|
||||
font = QFont("Fira Sans", 18)
|
||||
font.setBold(True)
|
||||
|
||||
6
run.sh
6
run.sh
@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# Check if virtual environment already exists
|
||||
if [ -d "./.venv" ]; then
|
||||
echo "Virtual environment already exists."
|
||||
@ -8,6 +10,8 @@ else
|
||||
python -m venv --system-site-packages ./.venv
|
||||
fi
|
||||
|
||||
export PYTHONUNBUFFERED=1
|
||||
|
||||
# Activate the virtual environment
|
||||
source ./.venv/bin/activate
|
||||
|
||||
@ -16,4 +20,4 @@ pip install -r requirements.txt
|
||||
|
||||
# Run the application
|
||||
echo "Starting..."
|
||||
python main.py
|
||||
python main.py &> ipmpv.log
|
||||
|
||||
Loading…
Reference in New Issue
Block a user