Pango and Android

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Pango and Android

Pere Pujal i Carabantes
Hi all,

CC [hidden email] and [hidden email]

Background for the Pango devs >>>
This year's GSOC Jianwei Zhang ported Tux Paint to Android, it uses SDL
SDL_Pango Pango for rendering text, you can find the sources and the
Android.mk file used to compile Pango at
https://github.com/perepujal/Tuxpaint-Android/tree/master/jni/pango-1.3
7.1
<<< Background

It performs fine in old(4.0.3) and new(5.0) Androids, however in some
4.3 and 4.4 non ASCII text is messed up.

I found a strange workaround that is to set

SDLPango_SetLanguage(font->pango_context, "ca")

in jni/tuxpaint/src/tuxpaint.c
This works for Catalan, Spanish and French, instead setting

SDLPango_SetLanguage(font->pango_context, "es") or "fr"

doesn't work for any language.

Any hints to debug this?

Thanks for any input
Pere
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pango and Android

Behdad Esfahbod-5
On 15-12-15 10:44 PM, Pere Pujal i Carabantes wrote:
> Any hints to debug this?

Humm.  Not really.

When you say "messed up", care to explain how?

behdad
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pango and Android

Pere Pujal i Carabantes
Hi Behdad, Thanks for replying

El dv 18 de 12 de 2015 a les 16:34 +0000, en/na Behdad Esfahbod va
escriure:
> On 15-12-15 10:44 PM, Pere Pujal i Carabantes wrote:
> > Any hints to debug this?
>
> Humm.  Not really.
>
> When you say "messed up", care to explain how?

I think better attach a screenshot, note that it is scaled by SDL then
zoomed by Android accessibility, the text inside the buttons should be
Pinta Estampa    -> Paint Stamp
Línies Formes    -> Lines Shapes

I've noticed that when applying the workaround mentioned in the
previous mail, then the font used to render the text changes from what
looks like a sans font to a serif one.


Thanks
Pere

Resent with the screenshot scaled down...
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list

Tp-And4.3.png (21K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pango and Android

Behdad Esfahbod-5
In reply to this post by Behdad Esfahbod-5
On 15-12-18 11:39 PM, Pere Pujal i Carabantes wrote:

> Hi Behdad, Thanks for replying
>
> El dv 18 de 12 de 2015 a les 16:34 +0000, en/na Behdad Esfahbod va
> escriure:
>> On 15-12-15 10:44 PM, Pere Pujal i Carabantes wrote:
>>> Any hints to debug this?
>>
>> Humm.  Not really.
>>
>> When you say "messed up", care to explain how?
>
> I think better attach a screenshot, note that it is scaled by SDL then
> zoomed by Android accessibility, the text inside the buttons should be
> Pinta Estampa    -> Paint Stamp
> Línies Formes    -> Lines Shapes

Humm; hard to tell what's going on.

> I've noticed that when applying the workaround mentioned in the
> previous mail, then the font used to render the text changes from what
> looks like a sans font to a serif one.

Is it possible that the SDL layer assumes that the text is all shaped using
the same (primary) font?  That's obviously not how Pango works...

b
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pango and Android

Pere Pujal i Carabantes
El dj 31 de 12 de 2015 a les 11:55 +0000, en/na Behdad Esfahbod va
escriure:

> On 15-12-18 11:39 PM, Pere Pujal i Carabantes wrote:
> > Hi Behdad, Thanks for replying
> >
> > El dv 18 de 12 de 2015 a les 16:34 +0000, en/na Behdad Esfahbod va
> > escriure:
> > > On 15-12-15 10:44 PM, Pere Pujal i Carabantes wrote:
> > > > Any hints to debug this?
> > >
> > > Humm.  Not really.
> > >
> > > When you say "messed up", care to explain how?
> >
> > I think better attach a screenshot, note that it is scaled by SDL
> > then
> > zoomed by Android accessibility, the text inside the buttons should
> > be
> > Pinta Estampa    -> Paint Stamp
> > Línies Formes    -> Lines Shapes
>
> Humm; hard to tell what's going on.
>
> > I've noticed that when applying the workaround mentioned in the
> > previous mail, then the font used to render the text changes from
> > what
> > looks like a sans font to a serif one.
>
> Is it possible that the SDL layer assumes that the text is all shaped
> using
> the same (primary) font?  That's obviously not how Pango works...

I think I found something to narrow down that problem:
The font used by Pango in the not working Android 4.3 is
the MotoyaLMaru font (*), if I copy that font to the working Android
4.0.3(who uses a Sans fallback), then Pango will use it instead of the
working one.

So I think I have to investigate why Pango uses that font as default
and/or why setting the language to "ca" changes the font to a one that
works and setting the language to "fr" doesn't, and/or find the way to
force Pango to use a custom font that Tux Paint provides. 

Thanks for any comments
Pere

(*) The MotoyaLMaru font was designated to support Japanese language,
and lacks many of the European accented letters
>
> b
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Loading...