go-text / typesetting

High quality text shaping in pure Go.
Other
88 stars 11 forks source link

Implement language-based font rules #82

Open whereswaldon opened 1 year ago

whereswaldon commented 1 year ago

This issues is a reminder to eventually implement the TODO language-sensitive font matching rules:

Yes, that's it. You can find some examples in the substitutions_table.go file.

What is missing to implement language substitutions properly is :

  • inferring the languages supported by a font from its rune coverage : fontconfig does it by using a rune set for each common language (based on text samples), and testing for the inclusion of the language set into the font runes set. It requires a bit more work, that's why I haven't included it in this PR.
  • adding a language parameter in the Query type, which must be set by the toolkits

_Originally posted by @benoitkugler in https://github.com/go-text/typesetting/pull/63#discussion_r1178729447_