-
Notifications
You must be signed in to change notification settings - Fork 36
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
Font support with freetype #177
Conversation
-Font Render -Load with Freetype -Support for setting the maximum font texture cache size. -Texture loaded with 32bit -New tutorial
I fix it later. |
Cool! Thank you for the contributing. |
No problem, meanwhile I will be solving these errors. |
Tutorial's 10 class |
thanks |
ok, idk how to fix these 2 minor issues, I need help ;-; , also tutorial 10 now also needs the Roboto-black font. |
It looks really promising! I will do review in a sec... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to fetch latest master
code and change number of the tutorial to 12.
engine/src/engine.cpp
Outdated
@@ -42,6 +42,7 @@ void Engine::initAll(const bool& loadUsbDriver) { | |||
banner.show(&renderer); | |||
audio.init(); | |||
pad.init(); | |||
fontInit(&renderer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New font class should be more object oriented (like font.init(...)
, etc.).
Please refactor it to make it look like the neighboring classes (pad
, audio
, etc.)
Please avoid to use extern
in following hpp file - probably is not needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about doing that but I also thought that an exception could be made 😅, since it was something that is used a lot and it would be easier to access the function directly. well now I change it.
engine/inc/font/font.hpp
Outdated
extern void unloadFont(Font* font); | ||
extern void drawText(Font* font, std::string text, float x, float y, | ||
int fontSize, Color color); | ||
// extern void drawText(std::string text, float x, float y, int fontSize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to remove all commented/temporary code
What minor issues did you encounter? Maybe I can help with smth. |
Don't worry, they were some problems with the codacy static code analysis, I already solved them. but thanks anyway. |
-font color support -individual character loading support -option to disable texture limits
I have to fix something else but this is how it looks. |
I've finished now. |
Awesome job!!! |
Is this still in the pipeline? |
not for now, it currently works, but it would be nice to update/add some things |
Would you say it's stable enough to migrate a project to in the meantime or would it be best left alone until it's ready to be merged? |
yeah it's stable, I was using it for my own project and I didn't have any problems. |
@GDQR how's it going?! |
I was busy with other things, I didn't advance on this, there are things that I think can be improved, like the spacing between letters but currently it works, later I will make another PR that has fewer commits, i clarify that i don't know when I will do it. |
? |
-Font Render
-Load with Freetype
-Set the font size.
-font color support
-Set correct color.
-Support for setting the maximum font texture cache size. -Texture loaded with 32bit
-New tutorial
Need #174 and #175 to work.
use this font for the example https://fonts.google.com/specimen/Roboto, it is licensed Apache version 2.0
helloworldtyra.mp4