瀏覽代碼

remove FONT + FONT_BOLD configs

Noah Vogt 2 周之前
父節點
當前提交
8532401262
共有 3 個文件被更改,包括 6 次插入10 次删除
  1. 2 4
      README.md
  2. 0 2
      config/default_config.py
  3. 4 4
      slides/classic_song_slide.py

+ 2 - 4
README.md

@@ -190,16 +190,14 @@ This is so that when the text width on maximum font size collides with the playe
 
 #### Font Configuration
 
-Slidegen uses two font styles, *normal* and *bold*. `BOLD_FONT_PATH` should point the respecting ttf/otf file for the bold style font and `FONT_PATH` for the normal style font. `FONT` and `BOLD_FONT` should be defined as the name of the font as accepted by ImageMagick. This is as some submodules for ImageMagick - or at least their wand python bindings - cannot reliably convert between name and path of the font and has sometimes problems accessing the system font config. Hence we use these four variables. The default config
+Slidegen uses two font styles, *normal* and *bold*. `BOLD_FONT_PATH` should point the respecting ttf/otf file for the bold style font and `FONT_PATH` for the normal style font. The default config
 
 ```python
 BOLD_FONT_PATH = "/usr/share/fonts/TTF/century-gothic/CenturyGothicBold.ttf"
 FONT_PATH = "/usr/share/fonts/TTF/century-gothic/CenturyGothic.ttf"
-FONT = "Century-Gothic"
-BOLD_FONT = "Century-Gothic-Bold"
 ```
 
-is made to use the [ttf-century-gothic](https://aur.archlinux.org/packages/ttf-century-gothic) font on the AUR on Arch Linux (-based distros). For different operating systems you may need to use another naming convention for `FONT` and `FONT_BOLD` like using spaces instead of dashes, but check out the ImageMagick documentation for more details.
+is made to use the [ttf-century-gothic](https://aur.archlinux.org/packages/ttf-century-gothic) font on the AUR on Arch Linux (-based distros).
 
 #### Metadata
 

+ 0 - 2
config/default_config.py

@@ -41,8 +41,6 @@ PLAYER_HEIGHT = 315
 
 BOLD_FONT_PATH = "/usr/share/fonts/TTF/century-gothic/CenturyGothicBold.ttf"
 FONT_PATH = "/usr/share/fonts/TTF/century-gothic/CenturyGothic.ttf"
-FONT = "Century-Gothic"
-BOLD_FONT = "Century-Gothic-Bold"
 
 METADATA_FONT_SIZE = 36
 METADATA_X = 70

+ 4 - 4
slides/classic_song_slide.py

@@ -103,7 +103,7 @@ class ClassicSongSlide(SongSlide):
                 draw.fill_color = Color(const.TEXT_COLOR)
                 draw.text_interline_spacing = const.INTERLINE_SPACING
                 draw.font_size = font_size
-                draw.font = const.FONT
+                draw.font = const.FONT_PATH
                 draw.text(0, font_size, slide_text)
                 with Image(
                     width=const.WIDTH,
@@ -125,16 +125,16 @@ class ClassicSongSlide(SongSlide):
         with Drawing() as draw:
             draw.fill_color = Color(const.TEXT_COLOR)
             draw.font_size = const.INFODISPLAY_FONT_SIZE
-            draw.font = const.FONT
+            draw.font = const.FONT_PATH
             for current_index, item in enumerate(structure):
                 if current_index == index:
-                    draw.font = const.BOLD_FONT
+                    draw.font = const.BOLD_FONT_PATH
                     draw.text(
                         current_index * const.INFODISPLAY_ITEM_WIDTH,
                         const.INFODISPLAY_FONT_SIZE,
                         item,
                     )
-                    draw.font = const.FONT
+                    draw.font = const.FONT_PATH
                 else:
                     draw.text(
                         current_index * const.INFODISPLAY_ITEM_WIDTH,