Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language constructor #157

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Language constructor #157

wants to merge 2 commits into from

Conversation

benoitkugler
Copy link
Contributor

@benoitkugler benoitkugler commented Apr 4, 2024

I've tried and implemented @dominikh suggestion for a better language API.

This should be a gain for library users. The only concern I have is that we now have to use NewLanguage even on constant, obviously well formatted strings (think NewLanguage("en")).

Not sure if there is a better way. Perhaps adding a NewLanguageRaw(string) constructor which does nothing and would be inlined ?

@hajimehoshi
Copy link
Contributor

I was wondering if typesetting would use the semi-standard libraries for languages and scripts.

@benoitkugler
Copy link
Contributor Author

I was wondering if typesetting would use the semi-standard libraries for languages and scripts.

Hum.. I'm not sure what would be the complications on the various generated tables. We would need a very compelling use case.
I also note that these types are mostly internal to the package : for most users, scripts are computed from the input text, and language are constructed via strings. For advanced users, converting to our types shouldn't be very difficult, should it ?

@hajimehoshi
Copy link
Contributor

hajimehoshi commented Apr 4, 2024

I felt that redefiniting types for languages and scripts was reinventing a wheel, but this is just out of curiosity.

I also note that these types are mostly internal to the package

This is used in the public API to determine glyphs correctly, right? (e.g. specifying ar and Arab was necessary to render Arabic texts correctly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants