Files
xhsautopublisher/backup/config.py
2025-09-05 17:20:14 +08:00

61 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# config.py
#定义内容字体
fonts_path = {
'title': 'fonts/LXGWWenKai-Medium.TTF',
'subtitle': 'fonts/LXGWWenKai-Medium.TTF',
'body': 'fonts/LXGWWenKai-Light.TTF',
'signature': 'fonts/LXGWWenKai-Light.TTF'
}
#定义底图模版
templates = {
'minimal': {
'background': 'backgrounds/IMG_5784.JPG',
'padding': 50
},
'modern': {
'background': 'backgrounds/IMG_5789.JPG',
'padding': 60
},
'vintage': {
'background': 'backgrounds/IMG_5793.JPG',
'padding': 70
}
}
#定义各部分内容样式
styles = {
'title': {
'size': 48,
'letter_spacing': 0,
'color': (30, 30, 30),
'line_spacing': 10,
'top_spacing': 0,
'bottom_spacing': 20
},
'subtitle': {
'size': 32,
'letter_spacing': 0,
'color': (60, 60, 60),
'line_spacing': 10,
'top_spacing': 20,
'bottom_spacing': 20
},
'body': {
'size': 24,
'letter_spacing': 0,
'color': (20, 20, 20),
'line_spacing': 15
},
'signature': {
'size': 28,
'letter_spacing': 2,
'color': (80, 80, 80),
'position': 'right', # 水平位置left, center, right
'vertical_position': 'bottom', # 垂直位置bottom, flow
'offset': 30 # 距离底部的偏移量
}
}