21
Views
6
Comments
Solved
 PROBLEM ADDING FONT TYPE, IN RESOURCE LIBRARY
Question

I'm having problems trying to add a downloaded font type to resource in Outsystems ODC , 
since it doesn't create a path like in react to add to the theme .

I need help.





2025-10-13 10-41-52
João Simões
Solution

Hi Felipe,

Libraries in ODC don't have runtime path, so your src it's not right.

Try:

@font-face {        

font-family: 'Poppins', sans-serif;

src: url('/MTS_Theme/Poppins-Regular.woff2') format('woff2');

font-weight: 400; 

font-style: normal;

}


The scr must be: "/{name_of_the_library}/{name_of_the_file}" it doesn't matter the folders you create.


Cheers!

2023-01-18 14-18-26
Tiago Filipe

Hello!! Try not including the 'resources' and the folder 'FontsMTS', for example:

src: url('/MTS_Theme/Poppins-Regular.woff2') format('woff2')

I believe the 'resources' and the folders inside don't need to be mentioned in the url, just the module name and the font file name.

See if that way works.

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi,

I explain how to override that problem with JS in the follow article:

https://itnext.io/how-to-import-a-text-font-into-a-library-in-outsystems-odc-b6aff4f9b450

I believe that the problem is not to be in ODC, but because you are trying that in a Library.

Hope this can help.


Best regards,

Ricardo

2024-05-01 02-52-20
Felipe Guerra

Eso es lo que se supone que debe hacer la biblioteca: definir un tema, sus fuentes, paleta de colores, etc. 
Previously, sources could be defined as resources in Reactive, but now I don't know what to call them. I saw your article but I didn't really understand it. 

2025-11-18 12-43-07
Mariana Junges
Champion

Hi,

You don't need JS to do this.

You can keep it simple, with the URL in the theme, even in the ODC library.

@font-face {        

src: url('"/{name_of_the_library}/{name_of_the_file}".woff2') format('woff2');

}


2025-10-13 10-41-52
João Simões
Solution

Hi Felipe,

Libraries in ODC don't have runtime path, so your src it's not right.

Try:

@font-face {        

font-family: 'Poppins', sans-serif;

src: url('/MTS_Theme/Poppins-Regular.woff2') format('woff2');

font-weight: 400; 

font-style: normal;

}


The scr must be: "/{name_of_the_library}/{name_of_the_file}" it doesn't matter the folders you create.


Cheers!

2019-01-07 16-04-16
Siya
 
MVP

@Felipe Guerra : Here is what I have done to make it work

  1. Fonts added in a Sample Library ( SampleLib) and set Deploy Action to "Deploy to Target Directory"
  2. Created a Sample Application - Demo App
    1. @font-face declaration and sample classNote : When you run the application, the font is referenced as https://environmenturl/DemoApp/css/Poppins-Regular.woff2 if you simply say 'src: url('Poppins-Bold.woff2') format('woff2'); '. In order to circumvent the /css/ path I applied "../"  and it generates the correct path at runtime as https://environmenturl/DemoApp/Poppins-Regular.woff2  
    2. Added two Text widgets and applied the .testClass to one of them. I have noticed that they are not applied inside the ODC Studio but works on Browser. 
      1.  
      2. On Browser
      3. You can see the font is loaded

So in your theme replace the existing path with ../ i.e  url('../Poppins-Regular,woff2') and see it works for you.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.