hyude Posted November 20, 2014 Share Posted November 20, 2014 Hello, Is there any way I can use .tiff as Font? I have read in docs, and I can't find it.BitmapFont can only use font from png, or using google webfont. Is there any way I can use .tiff file for font in my game? Thank you Link to comment Share on other sites More sharing options...
fuze Posted November 20, 2014 Share Posted November 20, 2014 I found this yesterday while trying to figure out the same thing but with True Type fonts. It should work for tiff fonts too http://www.html5gamedevs.com/topic/2214-how-to-use-a-tffotf-font-with-phaser/ Link to comment Share on other sites More sharing options...
Sam Posted November 20, 2014 Share Posted November 20, 2014 cocoonJS support .ttf natively.@fontface works with ttf for browser that support ttf - your type of font has to match your targeting device / platform. Link to comment Share on other sites More sharing options...
rvizcaino Posted November 20, 2014 Share Posted November 20, 2014 Tiff or ttf? Link to comment Share on other sites More sharing options...
Sam Posted November 20, 2014 Share Posted November 20, 2014 .TTFI'm aware that the question was about .tiff - which even seems to be the wrong format for all kinds of usage as a font.You can easily import .TIFF into Photoshop (or something even) and export a .png or whatever you need.and with the exported files you can also generate an bitmap font if you wish so.still as a Designer I can tell you that every "good" font comes in ttf / otf Formats..tiff as a font format is probably wrong. and .otf should be used for print media. Link to comment Share on other sites More sharing options...
i3Designer Posted November 20, 2014 Share Posted November 20, 2014 Load font with @font-face @font-face { font-family: "blopF"; src: url('assets/font/blop.ttf') format("truetype"), url('assets/font/blop.woff') format('woff'), url('assets/font/blop.eot') format('embedded-opentype'); } this.text = game.add.text(10,10,'test',{fill:'#000',font:'150px blopF'});//blopF is name of font. Link to comment Share on other sites More sharing options...
hyude Posted November 25, 2014 Author Share Posted November 25, 2014 Hello. I have tried using fontface for .ttf file. However strange things occured. Somehow, the font is not loaded (thus using default font) when the first time I use it. However, when I retart the game state (using Game.state.play('statename')), the font works. My guess is, the cause for that is because the font hasn't finished loaded when phaser object created.This is more confusing because I create phaser object at window.onload event (so, it will fired after all resources load finished).Even more so, I go through Boot State and Preloader State before going into Play State. Can anyone give me insight on that?What might cause this behavior Link to comment Share on other sites More sharing options...
Recommended Posts