question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid src:url for font-face when building a library

See original GitHub issue

Version

3.0.1

Reproduction link

https://github.com/qspoerri/vue-cli-font

Node and OS info

Yarn 1.6.0 / Node 8.11.3 / Windows 7 professional

Steps to reproduce

run yarn build-lib to generate a library build

What is expected?

The font-face’s src:url should be set correctly.

What is actually happening?

When generating a library containing fonts, the dist directory has the following structure:

.
 -- fonts
|    -- FiraSans-Bold.bf0aaa9c.woff
|    -- FiraSans-Book.6d4e4a15.woff
|    -- FiraSans-Light.29430787.woff
|-- img
|     -- logo.82b9c7a5.png
 -- logo.82b9c7a5.png
 -- myLib.common.js
 -- myLib.css
 -- myLib.umd.js

Unfortunately, in myLib.css the urls for the font-faces seems incorrect moving to the parent directory:

@font-face{font-family:FiraSans-Book;font-style:normal;font-weight:400;src:url(../fonts/FiraSans-Book.6d4e4a15.woff)} 

Therefore, when using the library the font-face is not loaded correctly.


The problem occured when I was trying to create a library of shared components to be reused across serveral different application.

For consistency, the fonts should be included in the library

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
crazyxhzcommented, Aug 21, 2018

@yyx990803 can you release this bug fix? I’m also having a library who’s font is broken now 😂

0reactions
katerlouiscommented, Sep 12, 2018

Bam, and then why not go straight to 3.0.3 😄 image

So the change wasn’t in there although it got commited before 3.0.1? Crazy! Just when I think I started to understand Git 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

font-face - CSS: Cascading Style Sheets - MDN Web Docs
Chrome Edge @font‑face Full support. Chrome1. Toggle history Full support... OpenType CBDT and CBLC rendering Full support. Chrome66. Toggle history Full support... OpenType COLRv0 rendering Full...
Read more >
Overriding @font-face src URL? - css - Stack Overflow
The solution is to be VERY CAREFUL when overriding the @font-face, making sure to provide all of the same formats used in the...
Read more >
Best practices for fonts - web.dev
This article discusses performance best practices for fonts. There are a variety of ways in which web fonts impact performance:.
Read more >
How to Add Custom Fonts in WordPress - WPBeginner
I just want to be able to use my font for my Headers. What am I doing wrong here? For this tutorial to...
Read more >
Chapter 6: Using fonts in pdfHTML - iText Knowledge Base
The "iText core" library supports Type1 fonts ( . ... in that last sentence means that you don't have to embed these fonts...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found