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
  • #187
Closed
Open
Issue created Nov 18, 2019 by Nicolas Mailhot@nim

Please add <group> → <target>

This is a part of: #200

Purpose

The target element specifies the @canonical_family_name@ being assembled.

Proposed syntax

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- SPDX-License-Identifier: MIT -->
<fontconfig>
  <group>
    <target>@canonical_family_name@</target>
  </group>
</fontconfig>

Behaviour

The group element SHOULD include all the configuration elements for the font family, named @canonical_family_name@ (the objective to assemble).

It MUST contain a single target child specifying this @canonical_family_name@.

At the end of the processing, all the font files that match the top-level @canonical_family_name@ at scan time:

  1. should have their fullname rewritten to @canonical_family_name@ SPACE @original_style_name@
    1. except for the Regular style, which is omitted from fullname by convention
    2. except for the meta no-style variable font fullname, which requires special handling

group SHOULD support the usual configuration merging mecanism :

  • when only one value for a setting is possible, the first parsed group that contains this setting for a given font family, wins
  • when several values are possible (ie substitution lists) the lists are assembled with the elements parsed first as higher priority in the list

Past alternatives

A similar result was obtained in the past with multiple uses of the following pattern.

However, this pattern requires identifying beforehand all the styles present in the technical font families. Therefore, it is not robust against font changes.

Also, the human must remember the Regular and variable special cases.

Even with a motivated human, the number of declaration blocks required to list all the styles present in the font files limits its scaling to simple font families.

  <match target="scan">
    <test name="family">
      <string>@canonical_family_name@</string>
    </test>
    <test name="style">
      <string>@original_style_name@</string>
    </test>
    <edit name="fullname">
      <string>@canonical_family_name@ @original_style_name@</string>
    </edit>
 </match>

Minimal real-world exemple

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- SPDX-License-Identifier: MIT -->
<fontconfig>
  <group>
    <!-- ADF confuses Name ID 6 construction rules with Name ID 4 rules -->
    <target>Accanthis ADF Std No2</target>
  </group>
</fontconfig>
Edited Nov 23, 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