Skip to content

Conversation

@wezm
Copy link
Contributor

@wezm wezm commented May 13, 2025

  • Call default_substitute and config_substitute in sort_fonts.
  • Make sort_fonts a method of Pattern, which makes it consistent with font_match.
  • Expose default_substitute and config_substitute in public API in case they are needed in other situations.

Fixes #45

@wezm
Copy link
Contributor Author

wezm commented May 13, 2025

@kjarosh does this seem reasonable?

@kjarosh
Copy link

kjarosh commented May 14, 2025

Thanks @wezm for the fixes, I appreciate it!

I think it's a good move to expose default_substitute and config_substitute. Calling them in sort_fonts also works for me.

However, I'm wondering if there's a reason those calls are separate in fontconfig. I'm not experienced enough with fontconfig to say it for sure, but it's possible there are some use cases which require not calling substitutions before sorting or matching fonts.

Edit: or maybe it's about selecting a different config for substitutions or using FcConfigSubstituteWithPat.

@wezm
Copy link
Contributor Author

wezm commented May 19, 2025

However, I'm wondering if there's a reason those calls are separate in fontconfig. I'm not experienced enough with fontconfig to say it for sure, but it's possible there are some use cases which require not calling substitutions before sorting or matching fonts.

I'm not sure if there are such cases either, but since this just brings sort_fonts in line with font_match I think it reasonable unless someone cites other use cases.

@wezm wezm merged commit d5d498c into master May 19, 2025
2 checks passed
@wezm wezm deleted the sort-substitute branch May 19, 2025 23:51
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.

No way of performing substitutions when sorting fonts

3 participants