calref / cboe

Classic Blades of Exile
http://spiderwebforums.ipbhost.com/index.php?/forum/12-blades-of-exile/
Other
168 stars 41 forks source link

Allow loading bitmap fonts #229

Open clort81 opened 4 years ago

clort81 commented 4 years ago

I want to load bdf or pcx fonts.

Trying to add more types beyond "ttf" got me this error:

src/fileio/resmgr/res_font.hpp:30:29: error: redefinition of ‘type* ResMgr::resLoader<type>::operator()(boost::filesystem::path) [with type = sf::Font]’
  template<> inline BDFRsrc* resLoader<FontRsrc>::operator() (fs::path fpath) {

Files changed (.cpp and .hpp cannot be uploaded, so they are 'txt')

src/fileio/fileio.cpp fileio.txt

src/fileio/resmgr/restypes.cpp restypes.txt

src/fileio/resmgr/res_font.hpp res_font.txt

Since we're using SFML the minimum code would be:

sf::Font plain_font;
plain_font.loadFromFile("./rsrc/fonts/ClortSans-11.bdf"))

Can someone please modify the three files linked here to allow other font types besides ttf to be loaded? That would be great.

clort81 commented 4 years ago

xq gave me a patch that provides a hacky fix, but i'll leave issue open because it's not a final solution.