community icon indicating copy to clipboard operation
community copied to clipboard

Use Pango as text renderer

Open goffi-contrib opened this issue 8 years ago • 11 comments

Currently, Kivy use sdl2 or PIL text renderer, and doesn't handle fallback, multilingual text or complex processing and in addition some bugs are present (https://github.com/kivy/kivy/issues/4741).

The use of Pango should resolve all these issues, and it integrate well with OpenGL, it would be a great addition to Kivy.

goffi-contrib avatar Jan 08 '17 21:01 goffi-contrib

The link markup is wrong :)

illright avatar Jan 09 '17 10:01 illright

@Leva7 fixed, thanks :)

goffi-contrib avatar Jan 09 '17 11:01 goffi-contrib

@goffi-contrib, I don't have any experience with this, but i've heard people recommending harfbuzz instead of the pango abstraction. What is the reason for preferring pango in this specific case?

dessant avatar Jan 16 '17 10:01 dessant

@dessant not a expert either, but Pango handle layout and text rendering, and is using Harfbuzz actually (which do text shaping)

You give text to Pango and it returns a ready-to-use rendered image, it's more high level than Harfbuzz, and hopefully should not be too hard to integrate with Kivy.

It's used by at least Firefox, and GTK+, so it's solid project.

goffi-contrib avatar Jan 16 '17 15:01 goffi-contrib

I did it in the paste, but when it came to packaging, it was cumbersome to get the whole glib, gdk, pangs stack juste for that, so it never land into master.

Maybe it changed now.

tito avatar Feb 05 '17 15:02 tito

@tito could you point me at source code / commits of your previous attempt? Sounds useful (even if it's not complete)

vanschelven avatar Feb 10 '17 12:02 vanschelven

14:10 tito@mintel code  $ find . -iname 'text_pango.py'
14:11 tito@mintel code  $ 

Looks like i don't have it anymore :(

tito avatar Feb 10 '17 13:02 tito

I did run into this (not tito's)

https://github.com/kivy/kivy/compare/master...kived:text-pango https://github.com/kivy/kivy/compare/master...kived:text-pango2

vanschelven avatar Feb 10 '17 14:02 vanschelven

I was into pango / harfbuzz for last few days,and realised that pango is using harfbuzz is as its layout engine but not using harfbuzz shapers. Pango provides a low-level API from which we can build their own layout engine.I am currently testing a (pango-cairo) code with kivy and will send the pr in few days.

susmit avatar Feb 15 '17 10:02 susmit

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 07 '17 04:10 stale[bot]

I wonder if there's any current plans for this, or something similar that can effectively handle rendering multilingual text?

Currently, doing something like this:

sb_ml

... requires a major hack that involves mapping various Unicode code points to selecting predefined fonts by using text markup.

markqvist avatar Jan 04 '24 23:01 markqvist