fonts icon indicating copy to clipboard operation
fonts copied to clipboard

The `local` provider does not perform font metric optimization

Open dungsil opened this issue 1 year ago • 4 comments

I'm not sure if this is intended, but it appears that the fonts available through the Local provider are not being optimised.

In the screenshot, Inter from google is displayed as ‘Fallback font: Inter’, but Pretendard from local is not.

image

dungsil avatar Jun 04 '24 11:06 dungsil

Reproduction link: https://github.com/dungsil/issues/tree/main/nuxt-fonts-171

dungsil avatar Jun 04 '24 11:06 dungsil

Hello, @dungsil! I'm here to assist you with any bugs, questions, or becoming a contributor. Let's tackle this together! 🤖

The local provider does not perform font metric optimization because the current implementation does not support reading font metrics. This is indicated by a TODO comment in the code:

// TODO: support reading font metrics

This means that while the local provider can register and resolve font files, it does not have the capability to optimize font metrics, which is why local fonts like Pretendard are not optimized. In contrast, fonts from Google, like Inter, are likely optimized because the Google provider includes font metric optimization [1][2].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Jun 04 '24 11:06 dosubot[bot]

Any ETA?

asonnleitner avatar Mar 13 '25 14:03 asonnleitner

In the meantime, is it recommended to use @nuxtjs/fontaine in addition to this module?

this-gavagai avatar Jul 07 '25 21:07 this-gavagai