Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

276
Views
Why electron react with styled components doesn't load fonts?

I am setting up my first electron-react project and when I import fonts as global styles they never load:

import neuropolitical from './fonts/neuropolitical rg.ttf';

const GlobalStyle = createGlobalStyle`
  @font-face {
    font-family: 'Neuropolitical';
    src: url(${neuropolitical}) format('truetype');
    font-style: normal;
  }
  * {
    color: green;
    font-family: 'Neuropolitical';
  }
  
`;

export default function App() {
  return (
      <div>
      <GlobalStyle />
        <h1>HEY, This is supposed to be neuropolitical rg font.</h1>
      </div>
  );
}

Here, it says it uses the correct font family; also, the text is green, so global style is applied:

Render

I have tried importing both local and web fonts. None work. This is my Index.js just to show there's nothing to override it:

import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

reportWebVitals();

Here is my file heirarchy:

Heirarchy

The font supports normal latin letters. What am I missing?

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!