Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • F fontconfig
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 181
    • Issues 181
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 23
    • Merge requests 23
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • fontconfig
  • fontconfig
  • Issues
  • #192
Closed
Open
Issue created Nov 18, 2019 by Nicolas Mailhot@nim

Please add <assemble> → <merge> → <match> → <best> and <fallback>

This is a follow-up of: #187

This issue documents a solution that was mulled in the past on the fontconfig and fonts mailing list. I find it overly complex and unnecessary. So, adding it here for completeness reasons if someone disagrees with me, but not endorsing it in any way.

History has proven that using a single priority list in fontconfig is essentially unmaintainable, because making any change requires synchronizing all the declarations inside the list.

Therefore, add best and fallback containers inside merge

  1. best for elements, that should be considered before all others, in priority order
  2. fallback for low quality font blocks, that should only used if nothing else is available.

The priority resolution mecanism becomes:

  1. all the blocks, entered in best by declaration order (higher priority declared first)
  2. all the blocks, in the general list, in no particular order (fontconfig can choose whichever it likes best). General list is anything not contained in best or fallback
  3. at last resort, the blocks in fallback, in no particular order
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- SPDX-License-Identifier: MIT -->
<fontconfig>
  <assemble>
    <family>@canonical_name@</family>
    <merge>
      <family></family>
      <match>
        <best> <!-- Good high quality font blocks -->
          <family></family>
          <family></family>
        </best>
        <family></family>
        <family></family>
        <fallback> <!-- Low quality last resort font blocks -->
          <family></family>
          <family></family>
        </fallback>
      </match>
    </merge>
  </assemble>
</fontconfig>

Application example (complete example)

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- SPDX-License-Identifier: MIT -->
<fontconfig>
  <assemble>
    <family>Foo</family>
    <merge>
      <best>
        <family>Foo New</family> <!-- Better and newer font files, partial coverage to start up -->
      </best>
      <family>Foo Math</family>
      <match>
        <family>Foo Condensed</family>
        <prefix>Condensed</prefix>
      </match>
      <match>
        <family>Broken FooBar</family>
        <style>Default</style>
        <to>Regular</to>
      </match>
      <fallback>
        <match>
          <fullname>Broken Foo</fullname>
        </match>
        <family>Foo Fallback</family> <!-- High-coverage low-quality font files -->
      </fallback>
    </merge>
  </assemble>
</fontconfig>

Application example (just the best and fallback parts)

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- SPDX-License-Identifier: MIT -->
<fontconfig>
  <assemble>
    <family>Foo</family>
    <merge>
      <best>
        <family>Foo New</family> <!-- Better and newer font files, partial coverage to start up -->
      </best>
      <fallback>
        <family>Foo Fallback</family> <!-- High-coverage low-quality font files -->
      </fallback>
    </merge>
  </assemble>
</fontconfig>
Edited Nov 22, 2019 by Nicolas Mailhot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking