Steve73 Posted May 4, 2019 Share Posted May 4, 2019 Is there a way to create a BitmapText font from a PIXI.TextStyle? I would like to combine pre-installed system fonts, that don‘t require any downloads, with the performance of BitmapText. If I use a Bitmap font consisting of a png and fnt file the download size of my app is increased by ~70kB. If I use PIXI.Text the text rendering of my app gets too slow. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 4, 2019 Share Posted May 4, 2019 No, but for pixijs v4 there is plugin that generates bitmap fonts from system fonts: https://github.com/avgjs/pixi-richtext . I'm gonna port it to v5 and make more efficient this month. Also there are ways to make PIXI Text faster, can you tell me how do you use it? Quote Link to comment Share on other sites More sharing options...
Steve73 Posted May 5, 2019 Author Share Posted May 5, 2019 Thank you for your prompt reply! Yes, the that‘s what I‘m looking for! I think this functionality would be a really nice addition to the API. Something like: const style = new PIXI.TextStyle({ fontFamily: "Verdana" }); // ### some function to convert the style into a loaded bitmap font let bitmapText = new PIXI.BitmapText("text using a fancy font!", {font: "Verdana"}); My usecase is a mmo game with many players on the screen (can be more than 100 players). Every player has a player name shown above his player sprite). Additionally players can send short messages which are also shown above the player. As a consequence I have hundreds of PIXI.Text objects. The creation of these objects during startup takes several seconds. But I want the game start instantly. Actually it does (thanks to PIXI’s incredible speed and minimal footprint!). Only the Text object creation takes too long. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 5, 2019 Share Posted May 5, 2019 Try Pixi-ui , it has DynamicText but lacks documentation, however @bQvle responds to people who get stucj in his code. Just spend a few hours with it. You didnt mention do you use v4 or v5? Text-related plugins werent ported yet pxlatedtraveler 1 Quote Link to comment Share on other sites More sharing options...
Steve73 Posted May 6, 2019 Author Share Posted May 6, 2019 Thanks. Currently I‘m using v5. I don‘t really want to go back to v4. After thinking this through, I‘m planning to use BitmapText objects and live with the increased download size until the required text-related plugins are available or I find the time to write the „TextStyle to BitmapText“ converter myself. Thanks again for your prompt feedback! It was highly appreciated. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.