Skip to content

Conversation

@classabbyamp
Copy link
Member

The intention here is to provide a system for depending on a font without depending on a specific font. Typically, font dependencies are for programs that need TTF/OTF fonts via fontconfig, not console, bitmap, or Xorg fonts, so this system is primarily designed for them.

There are several categories a font could fall into, that come from the fontconfig names for the different styles (see /usr/share/fontconfig/conf.avail/*):

  • font:sans-serif
  • font:serif
  • font:monospace
  • font:math
  • font:emoji

Further expansion could be made for things like non-latin scripts. I could imagine a system like font:lang-hi for a font that covers Hindi, or font:lang-ko for Korean (but do we encode script or language? fontconfig uses :lang=hi). fontconfig's fc-scan could provide some objective information about languages a font declares support for, but i fear this could become bloated fast, like this for Linux Libertine G Regular:

lang: aa|ab|af|ast|av|ay|az-az|ba|bm|be|bg|bi|bin|br|bs|bua|ca|ce|ch|chm|co|cs|cv|cy|da|de|el|en|eo|es|et|eu|fi|fj|fo|fr|ff|fur|fy|ga|gd|gl|gn|gv|ha|haw|he|ho|hr|hu|ia|ig|id|ie|ik|io|is|it|kaa|ki|kk|kl|kum|kv|kw|ky|la|lb|lez|ln|lt|lv|mg|mh|mi|mk|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|sah|sco|se|sel|sh|shs|sk|sl|sm|sma|smj|smn|sms|so|sq|sr|ss|st|sv|sw|tg|tk|tl|tn|to|tr|ts|tt|tw|tyv|uk|uz|ve|vi|vo|vot|wa|wen|wo|xh|yap|yi|yo|zu|ak|an|ber-dz|crh|csb|ee|fat|fil|hsb|ht|hz|jv|kab|kj|kr|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|nv|pap-an|pap-aw|qu|quz|rn|rw|sc|sg|sn|su|ty|za|agr|ayc|bem|dsb|lij|mfe|mhr|miq|mjw|nhn|niu|rif|sgs|szl|tpi|unm|wae|yuw(s)

Automation of this might be possible, but I'm not sure of a simple way to give us sans-serif/serif/monospace/math/emoji from fonts directly, as some of this seems to be post-processing by fontconfig's config files.

Overall, once this is merged, other fonts could add these categories through attrition, and other packages that need "a font" can received dependencies on the virtual package instead of forcing dejavu or ignoring the dependency.

Testing the changes

  • I tested the changes in this PR: YES

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.

1 participant