summaryrefslogtreecommitdiffstats
path: root/Third_Party
diff options
context:
space:
mode:
Diffstat (limited to 'Third_Party')
-rw-r--r--Third_Party/gen_atlas13
1 files changed, 5 insertions, 8 deletions
diff --git a/Third_Party/gen_atlas b/Third_Party/gen_atlas
index dfb0e61..b880ac8 100644
--- a/Third_Party/gen_atlas
+++ b/Third_Party/gen_atlas
@@ -10,7 +10,7 @@ from PIL import Image
CHAR_RANGES = [
(32, 126), # Printable ASCII
# Add more ranges here as needed, e.g.:
- # (160, 255), # Extended Latin
+ (160, 255), # Extended Latin
]
def calculate_grid_size(char_ranges):
@@ -32,21 +32,18 @@ def generate_atlas(font_path, resolution, draw_grid=False):
cmd = [
"msdf-atlas-gen/build/bin/Debug/msdf-atlas-gen.exe",
"-font", font_path,
- "-type", "mtsdf",
+ "-type", "msdf",
"-format", "png",
"-imageout", "atlas.png",
- "-json", "atlas.json",
- "-size", "32",
+ "-size", "28",
"-pxrange", "2",
"-dimensions", str(resolution), str(resolution),
"-chars", chars_str,
"-uniformgrid",
"-uniformcols", str(grid_size),
"-uniformcell", str(cell_size), str(cell_size),
- "-uniformorigin", "on",
- "-coloringstrategy", "inktrap",
+# "-uniformorigin", "on",
"-errorcorrection", "auto",
- "-miterlimit", "1.0",
"-scanline"
]
@@ -89,7 +86,7 @@ def draw_grid_lines(image, resolution):
def rearrange_atlas(resolution, cell_width, cell_height, draw_grid=False):
"""Rearrange the atlas to include gaps for non-printable characters"""
original = Image.open("atlas.png")
- new_atlas = Image.new('RGBA', (resolution, resolution), (0, 0, 0, 255))
+ new_atlas = Image.new('RGB', (resolution, resolution), (0, 0, 0))
grid_size = calculate_grid_size(CHAR_RANGES)
cell_size = resolution // grid_size