Skip to content

[BUG] Inconsistent use of font type as font format #13642

@tanishqmanuja

Description

@tanishqmanuja

Astro Info

Astro                    v5.7.2
Node                     v23.11.0
System                   Windows (x64)
Package Manager          bun
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

All

Describe the Bug

Experimental font api renders this

@font-face {
	  font-family: Nothing-7e874a521bb52888;
  src: url("/_astro/fonts/ffcca724dca7a641.otf") format(otf);
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}
@font-face {
	  font-family: "Nothing-7e874a521bb52888 fallback: Courier New";
  src: local("Courier New");
  size-adjust: 82.3199%;
  ascent-override: 107.9325%;
  descent-override: 26.968%;
  line-gap-override: 0%;
}
:root { --ff-nothing: Nothing-7e874a521bb52888, "Nothing-7e874a521bb52888 fallback: Courier New", monospace; }

What's the expected result?

@font-face {
	  font-family: Nothing-7e874a521bb52888;
  src: url("/_astro/fonts/ffcca724dca7a641.otf") format("opentype");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}
@font-face {
	  font-family: "Nothing-7e874a521bb52888 fallback: Courier New";
  src: local("Courier New");
  size-adjust: 82.3199%;
  ascent-override: 107.9325%;
  descent-override: 26.968%;
  line-gap-override: 0%;
}
:root { --ff-nothing: Nothing-7e874a521bb52888, "Nothing-7e874a521bb52888 fallback: Courier New", monospace; }

Link to Minimal Reproducible Example

https://github.com/tanishqmanuja/issue.astro-local-font

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P4: importantViolate documented behavior or significantly impacts performance (priority)feat: assetsRelated to the Assets feature (scope)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions