Skip to content

feat(Text): text rendering using OpenGL#145

Merged
Miou-zora merged 22 commits intomainfrom
38-text-plugin
Mar 26, 2025
Merged

feat(Text): text rendering using OpenGL#145
Miou-zora merged 22 commits intomainfrom
38-text-plugin

Conversation

@ripel2
Copy link
Contributor

@ripel2 ripel2 commented Mar 25, 2025

Related to:

image

Can be tested on OpenGL-Example/text-rendering

Notes:

  • Font paths are relative to the project, system-wide fonts are not supported (there are different APIs for each platform, should be done in a new issue)
  • The text component contains too much information but we are lacking components for 2D transforms
  • Kerning is hard to get right so it is not implemented for now

@ripel2 ripel2 added the enhancement New feature or request label Mar 25, 2025
@ripel2 ripel2 requested a review from a team March 25, 2025 19:42
@ripel2 ripel2 self-assigned this Mar 25, 2025
@ripel2 ripel2 linked an issue Mar 25, 2025 that may be closed by this pull request
@ripel2
Copy link
Contributor Author

ripel2 commented Mar 25, 2025

image
todo: fix memory issues?

@ripel2
Copy link
Contributor Author

ripel2 commented Mar 26, 2025

image todo: fix memory issues?

done

@ripel2 ripel2 marked this pull request as ready for review March 26, 2025 08:54
explicit Font(const std::string &fontPath, int fontSize);
~Font() = default;

void RenderText(const std::string &text, float x, float y, float scale, GLuint VAO, GLuint VBO) const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels strange to have this method inside a font class that should maybe only store data

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a lot of our utils classes have methods inside so it should be okay, I could rewrite it inside the gltextbuffer but it would be a spaghetti

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, I made it in the buffer instead and it is cleaner, please look at it

@sonarqubecloud
Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

@ripel2 ripel2 requested a review from Miou-zora March 26, 2025 13:00
@Miou-zora Miou-zora merged commit c7181ef into main Mar 26, 2025
4 checks passed
@Miou-zora Miou-zora deleted the 38-text-plugin branch March 26, 2025 14:08
MasterLaplace pushed a commit that referenced this pull request Mar 29, 2025
Related to:
- #38

![image](https://github.com/user-attachments/assets/be22a7a3-d65b-4692-902b-c5a7faa1b62e)

Can be tested on
[OpenGL-Example/text-rendering](https://github.com/EngineSquared/OpenGL-Example/tree/text-rendering)

Notes:
- Font paths are relative to the project, system-wide fonts are not
supported (there are different APIs for each platform, should be done in
a new issue)
- The text component contains too much information but we are lacking
components for 2D transforms
- Kerning is hard to get right so it is not implemented for now

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text plugin

2 participants