Git Product home page Git Product logo

Comments (2)

melix99 avatar melix99 commented on May 23, 2024 2

Thank you! I looked at the example to fix it. The problem that I occurred is that I didn't know I could create an ImGui::Context manually and then pass it to ImGuiIntegration, so this has confused me on how I could add the font in between the two.

from magnum-integration.

mosra avatar mosra commented on May 23, 2024

Hi,

the desired usage was calling AddFontFromFileTTF() before instantiating ImGuiIntegration::Context, so it then picks it up as a default font. In order to correctly handle HiDPI rendering, it needs to do some additional setup on the fonts. so if you did that after, there already was a default font and it didn't expect any further changes.

In d774aeb I made it possible to make font changes after ImGuiIntegration::Context is instantiated, but in order to make it pick up the changes correctly and upload an updated glyph cache, you need to explicitly call relayout() after. The docs about font handling were all over the place, so I consolidated them to a single section in 8408dd2, hopefully making everything clearer. Will upload the updated docs later today, I have some other pending edits to make.

Let me know if the above works for you. In case you run into further issues, the ports branch of magnum-examples has a modified imgui example where it loads a font that looks better on HiDPI screens, so you can compare to the code from there.

from magnum-integration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.