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

Added glyph ranges manager for ImGuiPresenter, added ability to use glyph ranges for Inspector's font #1936

Merged
merged 7 commits into from
May 29, 2024

Conversation

IamSanjid
Copy link
Contributor

@IamSanjid IamSanjid commented May 28, 2024

Describe your changes

Added ability to use custom or imgui pre-defined glyph ranges for specific font with ImGuiPresenter.
Added simple interface to use any glyph ranges for Inspector's font.

How to easily use ImGui's pre-defined glyph ranges for Simplified Chinese characters in the Inspector's font.

ImGuiPresenter::getInstance()->addGlyphRanges(ImGuiPresenter::GLYPH_RANGES::CHINESE_GENERAL);
auto inspector = Inspector::getInstance();
inspector->setFontPath(R"(C:\Windows\Fonts\msyh.ttc)");
inspector->setFontSize(20.f);
inspector->setFontGlyphId(
    ImGuiPresenter::getGlyphRangesId(ImGuiPresenter::GLYPH_RANGES::CHINESE_GENERAL));
// or
inspector->setFontGlyphId(ImGuiPresenter::GLYPH_RANGES_CHINESE_GENERAL_ID);

Issue ticket number and link

Checklist before requesting a review

For each PR

  • Add Copyright if it missed:
    - "Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."

  • I have performed a self-review of my code.

    Optional:

    • I have checked readme and add important infos to this PR.
    • I have added/adapted some tests too.

For core/new feature PR

  • I have checked readme and add important infos to this PR.
  • I have added thorough tests.

@halx99 halx99 added this to the 2.1.4 milestone May 29, 2024
@halx99 halx99 added the enhancement New feature or request label May 29, 2024
@halx99 halx99 merged commit eb0e6ef into axmolengine:dev May 29, 2024
15 checks passed
@IamSanjid IamSanjid deleted the glyph-enhance branch May 29, 2024 19:56
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.

2 participants