Skip to main content
18-Opal
Jul 8, 2019 6:46 AM UTC
Solved

How to add font style?

Hi,

 

Can I add my own font file (* .TTF) as a resource for "Vuforia Studio" instead of an external font?
Can I use the resource font I have added?
Or is it possible to use only external fonts via unconditional URL like below?

@import url (// fonts.googleapis.com/css?family=Bowlby One);
.specialfont {
  font-family: 'Bowlby One';
}

Thanks,

 

Warm Regards,

SeonHo

14-Alexandrite
Jul 8, 2019 11:15 AM UTC

Hello @CHASEONHO

Maybe this will help. I prefer to store different fonts in Resources\Fonts folder:

 

/// Creating a new font style:
@font-face {
font-family: digital;
src: url('#{$resources}/Fonts/DIGITALDREAM.ttf');
}

/// Using the new font style:
.digital {
font-family: digital;
}

Regards

 

Tomas

4 replies

5-Regular Member
Jul 8, 2019 10:48 AM UTC

@CHASEONHO Custom CSS can be added easily in the application CSS section, if you also have custom files to add to the project with the font definitions, you can upload them via the resources upload action and then reference them from the CSS file.

 

Adding fonts to the CSS file via CSS import should work, and one can also add fonts via javascript in the home.js file by creating the link tag with the URL to the font.

I think the 3d label widget can use the CSS fonts if they exist already in the page.  See some examples about how to import fonts such from this post:

https://stackoverflow.com/questions/14676613/how-to-import-google-web-font-in-css-file

  @import url('https://fonts.googleapis.com/css?family=Open+Sans')

 

-Durgesh

Translate
14-Alexandrite
Jul 8, 2019 11:15 AM UTC

Hello @CHASEONHO

Maybe this will help. I prefer to store different fonts in Resources\Fonts folder:

 

/// Creating a new font style:
@font-face {
font-family: digital;
src: url('#{$resources}/Fonts/DIGITALDREAM.ttf');
}

/// Using the new font style:
.digital {
font-family: digital;
}

Regards

 

Tomas

Translate
CHASEONHO18-OpalAuthor
18-Opal
Jul 9, 2019 12:00 AM UTC

Thank you for answer.
That's correct!
Is there a way to add as a default resource without adding fonts to every project?

Translate
1-Visitor
Jul 9, 2019 3:35 PM UTC

Just a note that I was seeing an issue with local custom fonts on iOS a few months back. Not sure if this has been resolved.

https://community.ptc.com/t5/Studio/Custom-Fonts-not-working-on-iOS/m-p/609780

Translate