Custom fonts in webgl

Setting the font on the main panel of the application does not seem to affect anything in webgl builds. This works on other build targets. I get no visible fontloading errors. Is there a font issue on webgl builds?

Hi Håvard,

Not that we know of. However, some fonts may fail to load in the browser for various reasons, and the browser falls back to some sort of default font.

What font are you using? Can you reproduce this with a simple test case?

This happens with Roboto-Regular (https://dl.dropboxusercontent.com/u/1881490/Roboto-Regular.ttf) This worked in an earlier build (1500 somewhere) but stopped working. I’ll make a simple testcase later tonight if/when I get the time.

Code:

<App Theme="Basic" ClearColor="#eeeeeeff">
    <Font ux:Global="RobotoBold" File="Assets/Roboto-Bold.ttf"/>
    <Font ux:Global="RobotoRegular" File="Assets/Roboto-Regular.ttf"/>
    <DockPanel Font="RobotoRegular">
        <StatusBarBackground DockPanel.Dock="Top" />
        <ScrollViewer ClipToBounds="true">
            <StackPanel>
                <Text FontSize="18" IsMultiline="true" TextWrapping="Wrap" Margin="0,0,0,10"> The quick brown fox jumped over the super fast rabbit???</Text>
                <Text FontSize="24" IsMultiline="true" TextWrapping="Wrap" Margin="0,0,0,10"> The quick brown fox jumped over the super fast rabbit???</Text>
                <Text FontSize="30" IsMultiline="true" TextWrapping="Wrap" Margin="0,0,0,10"> The quick brown fox jumped over the super fast rabbit???</Text>
            </StackPanel>
        </ScrollViewer>
    </DockPanel>
</App>

http://attensi.com/static/outracks/fonttest/index.html

Should look like http://attensi.com/static/outracks/fonttest/fontimage.png

Found the bugs, working on a fix. Hope to get this out shortly

In $PreloadBuffer ($uno.js:199) you use the check name.endsWith(’.ttf’) to determine if the file should load as font or not. This method is experimental ES6 and currently only supported by Chrome and Firefox (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith#Browser_compatibility)

A workaround could be done by extending the String prototype manually or just do a manual check (http://rickyrosario.com/blog/javascript-startswith-and-endswith-implementation-for-strings/).