Skip to content

Commit

Permalink
Merge pull request #53 from itsFelixH/add-font-path
Browse files Browse the repository at this point in the history
Setting for specifying font (path)
  • Loading branch information
InsertDisc authored Feb 12, 2024
2 parents ddbb685 + a1e74d5 commit dc5d002
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ overlay_save_folder: overlays/
# PATTRMM will ATTEMPT to create it.
# Default location is the default PMM 'overlays' folder and does not need specified.

font_path: fonts/Juventus-Fans-Bold.ttf
# Specify a path to a font file to use for the overlays. Your PMM config folder
# (where your config.yml is), will always be the BASE location.
# Default font path is 'fonts/Juventus-Fans-Bold.ttf' and does not need specified.

trakt_list_privacy: private
# Specify public/private trakt list privacy for returning soon list. Can be set per library.
# Default is private and does not need specified.
Expand Down
12 changes: 11 additions & 1 deletion pattrmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def log_setup():
trakt_list_privacy: private
save_folder: "metadata/"
overlay_save_folder: "overlays/"
font_path: "fonts/Juventus-Fans-Bold.ttf"
refresh: 30 # Full-refresh delay for library
days_ahead: 30 # How far ahead to consider 'Returning Soon'
extensions:
Expand Down Expand Up @@ -920,6 +921,12 @@ def librarySetting(library, value):
entry = pref['libraries'][library]['overlay_save_folder']
except KeyError:
entry = 'overlays/'
if value == 'font_path':
try:
entry = pref['libraries'][library]['font_path']
except KeyError:
entry = 'fonts/Juventus-Fans-Bold.ttf'
if value == 'trakt_list_privacy':
try:
Expand Down Expand Up @@ -1486,6 +1493,9 @@ def get_missing_episodes_count(self, series_id):
# overlay template path
rs_overlay_template_file = "./preferences/" + library_clean_path + "-status-template.yml"

# font file path (font folder and font file)
rs_overlay_font_path = vars.librarySetting(library, 'font_path')


# Just some information
print("Checking folder structure for " + library + ".")
Expand Down Expand Up @@ -1603,7 +1613,7 @@ def get_missing_episodes_count(self, series_id):
horizontal_align: <<horizontal_align>>
vertical_offset: <<vertical_offset>>
vertical_align: <<vertical_align>>
font: config/fonts/Juventus-Fans-Bold.ttf
font: config/{rs_overlay_font_path}
font_size: <<font_size>>
font_color: <<color>>
group: <<group>>
Expand Down
6 changes: 6 additions & 0 deletions vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,12 @@ def librarySetting(library, value):
entry = pref['libraries'][library]['save_folder']
except KeyError:
entry = ''

if value == 'font_path':
try:
entry = pref['libraries'][library]['font_path']
except KeyError:
entry = 'fonts/Juventus-Fans-Bold.ttf'

if value == 'overlay_save_folder':
try:
Expand Down

0 comments on commit dc5d002

Please sign in to comment.