moho-font for Python
نسخة Python من موهو فوند توفر كتالوجًا موحدًا للخطوط العربية المفتوحة، مع البحث والتصفية والإحصاءات وبناء روابط CSS من Google Fonts وFontsource. اسم التوزيعة هو moho-font، واسم الاستيراد هو moho_font.
التثبيت
pip install moho-font
الاستخدام
from moho_font import (
catalog_facets,
catalog_stats,
font_css_url,
get_font,
list_fonts,
)
fonts = list_fonts(
search="naskh",
subset="arabic",
variable=True,
weight=700,
limit=10,
)
for font in fonts:
print(font.family, font.license, font.source_url)
cairo = get_font("Cairo")
print(font_css_url(cairo, source="fontsource", weight=700))
print(catalog_stats())
print(catalog_facets()["tags"])
الواجهة
| الدالة | الغرض |
|---|---|
list_fonts(...) |
البحث والتصفية والترتيب والحد من النتائج. |
get_font(name_or_id) |
العثور على عائلة بالاسم أو المعرّف. |
get_font_by_id(font_id) |
العثور على عائلة بالمعرّف المستقر. |
catalog_facets() |
إرجاع قيم الفلاتر المتاحة. |
catalog_stats() |
إرجاع إحصاءات الكتالوج. |
google_fonts_css_url(...) |
بناء رابط Google Fonts CSS2. |
fontsource_css_url(...) |
بناء رابط Fontsource CDN لعائلة معروفة. |
font_css_url(...) |
اختيار المزوّد وبناء الرابط. |
create_css_import(...) |
إنشاء قاعدة CSS @import. |
create_font_face_css(...) |
إنشاء قاعدة @font-face للاستضافة الذاتية. |
التصفية
تدعم list_fonts الوسائط search وcategory وtag وprovider وlicense وsubset وscript وstyle وweight وvariable وsort وdescending وlimit.
serif = list_fonts(category="serif")
kufi = list_fonts(tag="kufi")
recent = list_fonts(sort="lastModified", descending=True, limit=20)
التطوير المحلي
cd python
python -m venv .venv
.venv\\Scripts\\activate # Windows
python -m pip install -U pip pytest build twine
python -m pytest
python -m build
python -m twine check dist/*
لا تُضمّن ملفات الخطوط نفسها داخل التوزيعة. يحتفظ كل سجل بالـ provider وsource_url وlicense وبيانات التحديث، ويجب مراجعة ترخيص العائلة قبل إعادة توزيع ملفاتها أو استخدامها تجاريًا.
الترخيص
كود الحزمة مرخّص بموجب MIT. تراخيص الخطوط الخارجية مستقلة ويجب احترامها كما هي.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moho_font-0.3.1.tar.gz.
File metadata
- Download URL: moho_font-0.3.1.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
769aad971f75fd58b1f5ef418d19f027182e2b784ba8fbc07d43038dccb246ca
|
|
| MD5 |
7a95e7c9bec4cb2a60225a68a5c94e45
|
|
| BLAKE2b-256 |
6a82a3e5c6237a7f1b5c360d686164095759a09a9b5b982130c6c6f9c4c326c2
|
File details
Details for the file moho_font-0.3.1-py3-none-any.whl.
File metadata
- Download URL: moho_font-0.3.1-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
214f80c5b17cec3e4ebbcaa704d736f6b5d8f9fefa8d466990aea5cb5ba36705
|
|
| MD5 |
0a1d2dbcebc57bcd51a98441dd58549d
|
|
| BLAKE2b-256 |
5cd9726a0d02a1d464020a257943aaceef856fb90a54fc419e1d45276dcb4f9b
|