Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
F
fontconfig
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 132
    • Issues 132
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Packages
    • Packages
    • Container Registry
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • fontconfig
  • fontconfig
  • Issues
  • #191

Closed
Open
Opened Nov 18, 2019 by Nicolas Mailhot@nim
  • Report abuse
  • New issue
Report abuse New issue

Please add <group> → <match> → <style-prefix>

This is a part of: #200

Preamble

Because width is the most recent of standard style facets, and the least likely to be supported by legacy applications, many font authors will split the width declinations of their font families into separate font families, and move width information from style to family.

However, for this same reason, the standard width position in style labels is leftwards (that keeps weight and slant rightmost in Name ID 4 regardless of naming policy choices).

Therefore, an obvious way to factor-out all the style fixes, required modernize such a font family, is just to prefix all the original style labels with the width attribute.

Purpose

The style-prefix element allows easy prefixing of all original style labels with @style_name_prefix@. As documented above, this is a common font assembly operation.

Proposed syntax

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

Behaviour

All the original style values contained in the files affected by the match block are rewritten into @style_name_prefix@ SPACE @original_style_name@, except for Regular, which is transformed by convention into @style_name_prefix@.

The result is used to generate fullname the usual group way.

Past alternatives

The past alternative is to specify the prefixing style value by style value in separate match + edit blocks.

However, that requires identifying beforehand all the style combinations, that will need this prefixing. Therefore, it is not robust against font changes.

The human must remember the Regular and variable special cases.

It does not factor-out, the non-style part of the matching

It does not factor-out, post-style-fixing common operations.

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.

Minimal real-world example

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- SPDX-License-Identifier: MIT -->
<fontconfig>
  <group>
    <target>IBM Plex Sans</family>
    <match>
      <family>IBM Plex Sans Condensed</family>
      <style-prefix>Condensed</style-prefix>
    </match>
  </group>
</fontconfig>
Edited Nov 23, 2019 by Nicolas Mailhot
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: fontconfig/fontconfig#191