w3c / w3c/csswg-drafts

[css-fonts] Support 1 @font-face (1 file) providing both normal and italic font-styles

Open
#3,908 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-fonts-4
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

@nyshadhr9 pointed out today that this doesn't work as expected:

<html>
  </head>
    <style>
      @font-face {
        font-family: 'Sample VF';
        font-weight: 400;
        font-style: normal;
        src: url("VfItalSlnt-Regular.ttf") format('truetype');
      }
      @font-face {
        font-family: 'Sample VF';
        font-weight: 400;
        font-style: italic;
        src: url("VfItalSlnt-Regular.ttf") format('truetype');
      }
      p1 {
        font-family: 'Sample VF', display;
        font-style: normal;
      }
      p2 {
        font-family: 'Sample VF', display;
        font-style: italic;
      }
    </style>
  </head>

<body>
  <p1>hello world</p1><br>
  <p2>hello world</p2>
</body>
</html>

Screen Shot 2019-05-10 at 9 53 27 AM

VfItalSlnt-Regular.zip

Perhaps rather than duplicating the @font-face, this should be possible:

      @font-face {
        font-family: 'Sample VF';
        font-weight: 400;
        font-style: normal italic;
        src: url("VfItalSlnt-Regular.ttf") format('truetype');
      }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the reported @font-face example and the proposed font-style: normal italic syntax. Determine the intended behavior when one font file supplies both styles, and define completion as supporting the example without duplicating the @font-face rule.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.