Custom fonts no longer working

Prior to daily 3244 my custom fonts were working perfectly ( apart from in native text fields ) however now in the latest they don’t seem to be loading. This can be seen here - http://www.glitchgames.co.uk/labs/swingshot/

 I had this problem with previous daily builds, but from 3244 custom fonts working perfectly!

Strange. Mine are in a sub directory rather than simply in the project root. Are yours?

I just did a test and my custom fonts are working, but they are in the root. I need to find a project where they are in a sub-directory.

Rob

from 3244 text renderer uses browser’s fonts

What?

I need custom? for example :slight_smile:

I meant Operation system fonts. ‘Howto’ use custom fonts will be soon

It will be great. Our new game work perfectly on HTML5! I am impressed! Shaders, physics - all work smoothly!

But custom fonts were working in subdirectories and don’t seem to be now. Will they work differently from the regular builds?

Custom fonts should be placed in web app folder in server.  And needs to add @font-face rule into index.html 

Here a sample of using Web Font Loader to load custom fonts. Tested on FF, Opera, Chrome, Safari - works. 

   <head>

         <style type = “text/css”>

            @font-face {

            font-family: “Exo2-Regular”;

            src: url(“Exo2-Regular.ttf”);

            }

            @font-face {

            font-family: “OpenSans-Regular”;

            src: url(“OpenSans-Regular.ttf”);

            }

        </style>

        <script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"></script>

<script>

  WebFont.load({

    google: {

      families: [‘Exo2-Regular’, ‘OpenSans-Regular’]

    }

  });

</script>

    </head>

a bit later it will be integrated in html5 builder

Why the change? Or will this make things like alignment etc work?

yes, making it fully compatible with other platforms

Hi,

I guess I’ll wait for the integration. I was not able to get this code to work. Tried many different attempts and different fonts. Fonts that are already installed on my system do work though without any font loading, but that isn’t portable.

-dev

Improved code. Working for me!

 \<style type = "text/css"\> @font-face { font-family: "myCustomFont1"; src: url("myCustomFont1.ttf"); } @font-face { font-family: "myCustomFont2"; src: url("myCustomFont2.ttf"); } \</style\> \<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"\>\</script\> \<script\> WebFont.load({ custom: { families: ['myCustomFont1', 'myCustomFont2'] } }); \</script\> 

Dr.

really? putting fonts in a sub folder is common web practise!

 @font-face { font-family: "myfont"; src: url("/fonts/myfont.ttf"); }

Special for you :slight_smile:
 

 \<style type = "text/css"\> @font-face { font-family: "myCustomFont1"; src: url("fonts/myCustomFont1.ttf"); } @font-face { font-family: "myCustomFont2"; src: url("fonts/myCustomFont2.ttf"); } \</style\> \<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"\>\</script\> \<script\> WebFont.load({ custom: { families: ['myCustomFont1', 'myCustomFont2'] } }); \</script\> 

It works perfect!

 

Implemented font loader. From build 3248 embedded .ttf fonts should work as usual

Hi,

Awesome! Just a note that on a non-debug build the console outputs:

font \<font-name\> loaded

Not sure if that is intended or not.

-dev