Font not showing up in Windows build

Was trying to use a font on a windows build, couldn’t make it happen.
Though it did show up in a flash build of the same project but clipping some characters on the right side.
Read a bit around the forum, decided to test AddingText example, worked with said font on windows and flash and no clipping.
Moved my code inside the AddingText example, works. Have no clue what is going on.
First project was initiated in HaxeDevelop, that’s the only difference I can tell.

Can you post the project.xml file you’re using? Or at least post the <assets /> tag.

Sure.

<?xml version="1.0" encoding="utf-8"?>
<!-- metadata, make sure 'package' is at least 3 segments (ie. com.mycompany.myproject) -->
<meta title="STP17" package="STP17" version="1.0.0" company="Francisco Teixeira" />

<!-- output -->
<app main="Main" file="STP17" path="bin" />

<window background="#f7bd00" fps="100" />
<window width="960" height="1620" unless="mobile" />
<window orientation="landscape" vsync="true" antialiasing="4" if="cpp" />

<!-- classpath, haxe libs -->
<source path="src" />
<haxelib name="openfl" />
<haxelib name="actuate" />

<haxelib name="haxeui-core" />
<haxelib name="haxeui-openfl" />

<haxelib name="extension-networking" />

<!-- assets -->
<icon path="assets/openfl.svg" />
<assets path="assets/img" rename="img" />

<library path="Assets/STP17.swf" preload="false" />

<!-- optimize output
<haxeflag name="-dce full" /> -->

Is the font embedded in your SWF? OpenFL projects currently require that you separately embed any SWF fonts for use on non-Flash targets

That’s the thing I tried with it embedded and without embedding. Nothing seemed to work.
Than I just tried the example and it worked… boggled even further by some partial cut on some of the last characters in flash. Not happening anymore since I picked up from the example project. Font works, no partial trims.

Can you give a small example or a link on how to embed a font separately from the .swf file? We too have the problem that fonts that are embedded in a .swf do not show up in HTML5 target but work fine on the Flash target.

Try adding the TTF for your font in your “Assets” directory, usually that’s all that’s required :slight_smile:

1 Like