Giter VIP home page Giter VIP logo

Comments (8)

naveen521kk avatar naveen521kk commented on June 10, 2024 1

After ManimCommunity/ManimPango#28 it should be possible to use ManimPango :)

from moderngl-window.

einarf avatar einarf commented on June 10, 2024 1

After ManimCommunity/ManimPango#28 it should be possible to use ManimPango :)

Yep! That would be fun to try out. After this is done :)

from moderngl-window.

einarf avatar einarf commented on June 10, 2024 1

If I may join this conversation, does text rendering have to be a feature of moderngl? Would user code be able to alternatively use any particular other (python) library to draw text into a bitmap, then embed it in a texture provided to moderngl for actual rendering? or will that fall short of handling all the concerns inherent to getting clean text on a display?

Text rendering will never be a part of moderngl. You can of course use any library you want to implement this yourself. This repository is not moderngl, but moderngl-window. it's a windowing and utility library for moderngl.

Making a good text renderer in moderngl would have the same challenges as any other library or language. I did already make a bitmapped text renderer and the plan was at least to use freetype-py to get something started. It would use the (incomplete) texture atlas in the master branch (or a specific variant for glyphs)

from moderngl-window.

lordmauve avatar lordmauve commented on June 10, 2024

Doing some research previously I found that rendering freetype glyphs is not enough for correct text rendering; you to use Harfbuzz for shaping Unicode code point sequences, which gives positioned glyphs from the font including chains of accents. Harfbuzz is the only complete open source implementation of this and almost everything uses it.

I don't know if freetype-py uses Harfbuzz itself, but there are Python bindings for Harfbuzz available.

from moderngl-window.

einarf avatar einarf commented on June 10, 2024

Considering adding a simple bitmapped monospaced text rendere using veramono just so we have something for now.

from moderngl-window.

matanox avatar matanox commented on June 10, 2024

If I may join this conversation, does text rendering have to be a feature of moderngl? Would user code be able to alternatively use any particular other (python) library to draw text into a bitmap, then embed it in a texture provided to moderngl for actual rendering? or will that fall short of handling all the concerns inherent to getting clean text on a display?

from moderngl-window.

matanox avatar matanox commented on June 10, 2024

Thanks for commenting and I guess I had missed the most related thread in moderngl which was probably moderngl/moderngl#203.

I guess you mean that perhaps (or at most) moderngl would go one step in the direction of enabling better text rendering performance by implementing a texture atlas, which would allow user code to choose a font library such as freetype-py and throw its outputs into the atlas. And that one can currently, without such a feature added in moderngl, and at the cost of (especially in dynamic scenes) incurring less than optimal performance, cast fonts rendered with other libraries, into a plain moderngl texture if they are okay with having less optimal performance.

And that this all without something like harfbuzz, would probably work in a visually correct, or in a visually pleasing way, only for orthographically feature-poor languages like English and not for many/most other of the world's languages that have character adjoining rules and/or accents that need to be laid out in specific orders from their unicode representations.

Maybe I'm a bit behind on rendering pipelines and architectures though, so I may well suffice with what I learned from your earlier comment.

from moderngl-window.

lordmauve avatar lordmauve commented on June 10, 2024

Just wanted to comment in this thread that to get towards state of the art font rendering you need harfbuzz, sure, but you should be looking towards something like msdf-atlas-gen to generate the atlases.

from moderngl-window.

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.