Create a font provider interface, create a RocketTrueType lib and implement a new font provider #34

wants to merge 26 commits into

This request contains the ability to have different font providers. Rocket core does not depend from truetype anymore and a RocketTrueTypeLib has been created. A BMFont provider ( font create with AngelCode's BMFont tool ) is also provided.

This implementation does not support effects for the moment.


Anything we should do for this request to be reviewed?

libRocket member

Hey guys, just grabbed a copy of this and had a play, looks really good.

There's a couple adjustments I'd like to make before commiting it to core though, I'm happy to make these adjustments or leave it up to you, whichever you prefer.

  1. I'd like to generalise the LoadFont stuff, so rather than having to specifically talk to the correct FontProvider and get it to load the fonts, I'd like it so you just ask Rocket::Core::FontDatabase::LoadFont and it asks each provider to attempt the load, (provider could just check file extension etc). This way we don't need specific load code, we can just try load any font.

  2. I think the providers should be compiled directly into the Core library rather than being separate and we have a Config.h or something that allows you to enable which providers are compiled into the core. This way the providers can be initialised along with the core and we once again don't need any special initialisation.

These two changes will be the external rocket API's for loading fonts won't change so people won't be forced to update their projects, they can simply switch on and off FontProviders as they see fit.


Ok, I'll work on that in the next days

crazyjul added some commits Jul 6, 2012
@crazyjul crazyjul Merge Freetype and Bitmap font implementation inside RocketCore
CMake now contains an option to build without freetype

@crazyjul crazyjul Font provider can be accessed by old FontDatabase interface
The system now allows a single entry point for loading and using fonts.

Tha cmake option ROCKET_WITH_FREETYPE allows to build with our without freetype lib.

Samples have been updated to use this single entry point as well
@crazyjul crazyjul Fix samplers and debugger 8b19daa

Change made as expected. I added an option in Cmake to compile without freetype. Otherwise, everything can be done through the unified interface of Rocket::Core::FontDatabase


Any idea if these changes are going to be accepted?


bitmap font would be great! please accept this merge


Bump ! Is this 2 years old pull request abandoned ?

libRocket member

It is something I definitely think would benefit the project, but it's kinda huge ;_; I'll try to take a look at it soon


bump !


Would be nice to have merged but I suppose the changeset has bitrotted by now..

libRocket member

Age would be the primary blocker, getting a fresh version against master would be a start. It needs to merge cleanly and compile across the various supported platforms and actually work on them. Also as lloydw suggested, it'd need to not break backwards compat from an ABI perspective in order to go in sooner rather than later.


@crazyjul I don't know where to ask this, but your fork (the master branch) is way behind the official libRocket master. Are you planning to merge the latest changes into your fork (which contains this very useful font provider feature) ?

libRocket member

superceded by #267

@wheybags wheybags closed this Sep 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment