diff --git a/Makefile b/Makefile index d77a125..27f0f04 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,6 @@ FONTS_DIR := fonts GLYPH_FILES := $(foreach dir, $(OUTPUT_DIRS), $(shell find $(dir) -name '*.glyphs' | grep -v ' (Autosaved).glyphs')) SAMPLE_DIR := samples -SAMPLE_TEXT := "ܥܠ ܐܪܥܐ ܫܠܡܐ ܘܣܒܪܐ ܛܒܐ ܠܒܪܢܫ̈ܐ" all: build generate-png install test @@ -59,7 +58,10 @@ generate-png: venv . venv/bin/activate && \ for file in $(FONTS_DIR)/*.otf; do \ font=$$(basename "$$file" .otf); \ - python3 scripts/render_text.py "$$file" $(SAMPLE_TEXT) "$(SAMPLE_DIR)/$$font.png"; \ + python3 scripts/render_text.py "$$file" "ܥܠ ܐܪܥܐ ܫܠܡܐ ܘܣܒܪܐ ܛܒܐ ܠܒܪܢܫ̈ܐ" "$(SAMPLE_DIR)/$$font.png"; \ + python3 scripts/render_text.py "$$file" "ܢܘܗܕܪܐ" "$(SAMPLE_DIR)/$$font-nohadra-sample.png"; \ + python3 scripts/render_text.py "$$file" "ܣܦܢܐ" "$(SAMPLE_DIR)/$$font-nohadra-sapna-text.png"; \ + python3 scripts/render_text.py "$$file" "ܐܡܕܝܐ" "$(SAMPLE_DIR)/$$font-nohadra-amedia-text.png"; \ done .PHONY: clean test install build open venv all generate-svg generate-png diff --git a/README.md b/README.md index df41972..4fa9141 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ ![CI Status](https://github.com/SargisYonan/NohadraSyriacFonts/actions/workflows/fontbakery.yml/badge.svg) Nohadra fonts are a bold, geometric, and monospaced Syriac typeface. +![Nohadra - Sapna](samples/NohadraSyriac-Sapna-nohadra-sample.png) +![Nohadra - Amedia](samples/NohadraSyriac-Amedia-nohadra-sample.png) ## Introduction @@ -11,12 +13,14 @@ The Nohadra Syriac Font family includes Syriac typefaces with square, block-like ## Samples ### Nohadra - Sapna -![Nohadra - Sapna](samples/NohadraSyriac-Sapna.png) +![Nohadra - Amedia](samples//NohadraSyriac-Sapna-nohadra-sapna-text.png) Sapna is a monospaced and minimal block style Syriac typeface. +![Nohadra - Sapna](samples/NohadraSyriac-Sapna.png) ### Nohadra - Amedia -![Nohadra - Amedia](samples//NohadraSyriac-Amedia.png) +![Nohadra - Amedia](samples//NohadraSyriac-Amedia-nohadra-amedia-text.png) Amedia offers the same look and feel as Sapna, but with rounder edges. +![Nohadra - Amedia](samples//NohadraSyriac-Amedia.png) ### More to come diff --git a/samples/NohadraSyriac-Amedia-nohadra-sample.png b/samples/NohadraSyriac-Amedia-nohadra-sample.png new file mode 100644 index 0000000..3a5a23a Binary files /dev/null and b/samples/NohadraSyriac-Amedia-nohadra-sample.png differ diff --git a/samples/NohadraSyriac-Amedia.png b/samples/NohadraSyriac-Amedia.png index 7df0205..923522f 100644 Binary files a/samples/NohadraSyriac-Amedia.png and b/samples/NohadraSyriac-Amedia.png differ diff --git a/samples/NohadraSyriac-Sapna-nohadra-sample.png b/samples/NohadraSyriac-Sapna-nohadra-sample.png new file mode 100644 index 0000000..aa5f879 Binary files /dev/null and b/samples/NohadraSyriac-Sapna-nohadra-sample.png differ diff --git a/samples/NohadraSyriac-Sapna.png b/samples/NohadraSyriac-Sapna.png index 29561b4..276fcf7 100644 Binary files a/samples/NohadraSyriac-Sapna.png and b/samples/NohadraSyriac-Sapna.png differ diff --git a/scripts/render_text.py b/scripts/render_text.py index d042876..6b2195e 100644 --- a/scripts/render_text.py +++ b/scripts/render_text.py @@ -9,7 +9,11 @@ def clean_text(text): return ''.join(c for c in text if unicodedata.category(c).startswith('L') or c.isspace()) def render_text_to_image(font_path, text, output_path): - width, height = 4600, 500 + + font_size = 400 + + width = int((len(text)*font_size) / 2.2) + height = 350 # Create a new image with a white background image = Image.new('RGB', (width, height), color='white') @@ -18,7 +22,6 @@ def render_text_to_image(font_path, text, output_path): reshaped_text = arabic_reshaper.reshape(clean_text(text)) # Load the font - font_size = 400 font = ImageFont.truetype(font_path, font_size) # Calculate text width and height for centering @@ -26,7 +29,7 @@ def render_text_to_image(font_path, text, output_path): bbox = draw.textbbox((0, 0), reshaped_text, font=font) text_width, text_height = bbox[2] - bbox[0], bbox[3] - bbox[1] text_x = (width - text_width) // 2 - text_y = ((height - text_height) // 2) - text_height/2 + text_y = ((text_height) // 2) - text_height # Draw the text on the image text_color = (0, 0, 0) # Black color