silnrsi / langfontfinder

The Find A Font service code
Other
3 stars 2 forks source link

Language Font Finder Service

This project provides a micro service responder when passed language tag will return information on a possible font to use for the orthography for that language tag.

Details of the returned JSON object may be found here.

Access

The Language Font Finder service is available at https://lff.api.languagetechnology.org/docs.

Usage

The service has the following endpoints available: Endpoint Description
lang/langtag Returns a json object of the font for the BCP 47 langtag
family/familyid Returns a json object of just the font family record for the family
status/ Returns a simple version as a JSON object
docs/ FastAPI OpenAPI base documentation (Swagger)
redoc/ Prettier OpenAPI base documentation (ReDoc)
openapi.json OpenAPI schema in JSON

Examples

https://lff.api.languagetechnology.org/lang/kfc returns a JSON object with information about a font that supports the Konda-Dora language (kfc) which is written with Telugu script (Telu).

https://lff.api.languagetechnology.org/family/notoseriftibetan returns a JSON object with information about the Noto Serif Tibetan font family.

https://lff.api.languagetechnology.org/lang/und-Bali could be used to find font information suitable for the Balinese script (Bali). The language tag uses the special "und" ("Undetermined") language code and the Balinese script code ("Bali"). It returns a JSON object with information about the Noto Sans Balinese font family.

Startup

The API is built on top of FastAPI and runs using uvicorn.

To run:

python3 lib/langfontfinder/api.py

There are standalone testing programs in the test/ directory.