mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
complete refactor javascript to typescript and reorg frontend files and folders
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import math
|
||||
from typing import NamedTuple
|
||||
|
||||
@@ -6,6 +7,7 @@ from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
from modules import script_callbacks, shared
|
||||
from modules.logger import log
|
||||
from modules.paths import script_path
|
||||
|
||||
|
||||
class Grid(NamedTuple):
|
||||
@@ -143,9 +145,9 @@ class GridAnnotation:
|
||||
|
||||
def get_font(fontsize: float):
|
||||
try:
|
||||
return ImageFont.truetype(shared.opts.font or "javascript/notosans-nerdfont-regular.ttf", fontsize)
|
||||
return ImageFont.truetype(shared.opts.font or os.path.join(script_path, "ui", "fonts", "notosans-nerdfont-regular.ttf"), fontsize)
|
||||
except Exception:
|
||||
return ImageFont.truetype("javascript/notosans-nerdfont-regular.ttf", fontsize)
|
||||
return ImageFont.truetype(os.path.join(script_path, "ui", "fonts", "notosans-nerdfont-regular.ttf"), fontsize)
|
||||
|
||||
|
||||
def draw_grid_annotations(im: Image.Image, width: int, height: int, x_texts: list[list[GridAnnotation]], y_texts: list[list[GridAnnotation]], margin=0, title: list[GridAnnotation] | None = None):
|
||||
|
||||
Reference in New Issue
Block a user