fontpie icon indicating copy to clipboard operation
fontpie copied to clipboard

Option to specify @font-face's src url() when non-root directory?

Open PapiPeppers opened this issue 2 years ago • 0 comments

If running from root of {someDirectory} where the font files are located in {someDirectory}/{otherDir}/{fontDir}, is there a way to output in the @font-face rules a src url() pointing to ./{otherDir}/{fontDir} instead of the root directory?

Currently, output looks like:

@font-face {
  font-family: 'PPFraktionMono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('PPFraktionMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'PPFraktionMono Fallback';
  font-style: normal;
  font-weight: 400;
  src: local('Arial');
  ascent-override: 76.51%;
  descent-override: 14.75%;
  line-gap-override: 21.75%;
  size-adjust: 131.49%;
}

html {
  font-family: 'PPFraktionMono', 'PPFraktionMono Fallback';
}

But need output to be this:

@font-face {
  font-family: 'PPFraktionMono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('**/{otherDir}/{fontDir}/**PPFraktionMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'PPFraktionMono Fallback';
  font-style: normal;
  font-weight: 400;
  src: local('Arial');
  ascent-override: 76.51%;
  descent-override: 14.75%;
  line-gap-override: 21.75%;
  size-adjust: 131.49%;
}

html {
  font-family: 'PPFraktionMono', 'PPFraktionMono Fallback';
}

PapiPeppers avatar Aug 05 '23 14:08 PapiPeppers