Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different usage of the facename font field #38

Closed
eXpl0it3r opened this issue Oct 3, 2016 · 3 comments
Closed

Different usage of the facename font field #38

eXpl0it3r opened this issue Oct 3, 2016 · 3 comments

Comments

@eXpl0it3r
Copy link
Contributor

GWork's font abstraction builds on the idea that in order to use a font you just have to know the font's facename (e.g. Arial). However some renderers such as SFML (and SDL?) don't load fonts from the system and instead require a filename. GWork uses a workaround where it will just use the font field facename as filename. This seems to work just fine when you can ensure that you only operate with one specific renderer, but it gets more difficult for things like the GWork tests.

For example the Label API test fails to run with the SFML renderer because it only specifies OpenSans without file extension and thus SFML can't load the OpenSans.tff font.

SFML Error:

Failed to load font "OpenSans" (failed to create the font face)

Question is whether this should be refactored by maybe adding another field to the font struct to specify an actual font file or whether there's a more general approach to it, that I currently don't know of.

@billyquith
Copy link
Owner

This is from GWEN. Other Renderers just append the file extension.

https://github.com/billyquith/GWork/blob/gwork/source/platform/renderers/Allegro5/Allegro5.cpp#L137

It would be nice to move all the hardcoded values to config file at some point in the future, then perhaps you'd reference this font like CSS, via a config set, which might be different per-platform. Then you'd have proper skinning.

@billyquith
Copy link
Owner

See issue #33. Be a nice little project for someone who just found some spare time... 😄

@eXpl0it3r
Copy link
Contributor Author

Hehe, well I at first want to get some proper CMake configurations working. Building in release with SFML is currently broken (it seems to mix debug/release stuff). Additionally I want to get static linking fully working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants