Misaligned text in Thunderbird 17 message list

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

Misaligned text in Thunderbird 17 message list

Alex Taylor
In Thunderbird (using Dave's 17esr build), there is a display problem in the
message list window which is mostly obvious when Workplace Sans is not being
used.

http://www.altsan.org/os2/tbird_text.png

What I suspect is happening here is that the text is being positioned and drawn
according to the font's proper calculated line height, but the actual lines of
the list control are scaled to a constant default height, possibly on a fixed
percentage of the em size.

This is a Japanese system and the default system window text font is not
WarpSans, but "WarpSans Combined", which evidently doesn't get mapped to
Workplace Sans, so Thunderbird substitutes all text with the configured
'Unicode' font.  This is a pan-Unicode font (a modified Droid Sans Fallback,
in this case, but the same thing occurs with e.g. Arial Unicode MS), which
by necessity has a large line bounding height (max baseline extent in OS/2
jargon, or WinAscent+WinDescent in TTF terminology) - considerably larger than
the em height.  Thus, the text is being positioned based on the assumption of
the font's preferred line height, but the space provided by the actual control
isn't enough.

What I guess needs to happen is either:
(a) The list control's line height should be based on the display font's
    preferred line height (I don't know if this is possible given that the
    font in this case is a substitution); or
(b) Better logic needs to be used in order to centre the glyphs within the
    vertical space.

Also, it probably wouldn't hurt to add a mapping for "WarpSans Combined"
to "Workplace Sans" so that at least on a default system configuration,
this problem will be less prone to occur.

--
Alex Taylor
http://www.altsan.org

Please take off hat when replying.
_______________________________________________
dev-ports-os2 mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-ports-os2
Reply | Threaded
Open this post in threaded view
|

Re: Misaligned text in Thunderbird 17 message list

Steve Wendt
On 8/26/2014 9:09 AM, Alex Taylor wrote:

> What I suspect is happening here is that the text is being positioned and drawn
> according to the font's proper calculated line height, but the actual lines of
> the list control are scaled to a constant default height, possibly on a fixed
> percentage of the em size.

I don't pay sufficient attention to Thunderbird to know for certain, but
I have a vague idea that there were some cross-platform issues here.  It
may already be fixed in newer versions.

> Also, it probably wouldn't hurt to add a mapping for "WarpSans Combined"
> to "Workplace Sans" so that at least on a default system configuration,
> this problem will be less prone to occur.

That seems reasonable to me; filing a bug on the github project is
probably the best thing to do.

_______________________________________________
dev-ports-os2 mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-ports-os2
Reply | Threaded
Open this post in threaded view
|

Re: Misaligned text in Thunderbird 17 message list

Dave Yeo-3
In reply to this post by Alex Taylor
Alex Taylor wrote:
> In Thunderbird (using Dave's 17esr build), there is a display problem in the
> message list window which is mostly obvious when Workplace Sans is not being
> used.
>
> http://www.altsan.org/os2/tbird_text.png

Used to see a similar issue with TB 10 though not so extreme. Perhaps
the issue that Steve mentioned.

>
> What I suspect is happening here is that the text is being positioned and drawn
> according to the font's proper calculated line height, but the actual lines of
> the list control are scaled to a constant default height, possibly on a fixed
> percentage of the em size.
>
> This is a Japanese system and the default system window text font is not
> WarpSans, but "WarpSans Combined", which evidently doesn't get mapped to
> Workplace Sans, so Thunderbird substitutes all text with the configured
> 'Unicode' font.  This is a pan-Unicode font (a modified Droid Sans Fallback,
> in this case, but the same thing occurs with e.g. Arial Unicode MS), which
> by necessity has a large line bounding height (max baseline extent in OS/2
> jargon, or WinAscent+WinDescent in TTF terminology) - considerably larger than
> the em height.  Thus, the text is being positioned based on the assumption of
> the font's preferred line height, but the space provided by the actual control
> isn't enough.
>
> What I guess needs to happen is either:
> (a) The list control's line height should be based on the display font's
>      preferred line height (I don't know if this is possible given that the
>      font in this case is a substitution); or
> (b) Better logic needs to be used in order to centre the glyphs within the
>      vertical space.

Unluckily I'm not skillful enough to even comment on these changes, it's
possible that using pango might fix some of these issues though to be
honest from I hear, most people turn pango off as it introduces more
problems then it solves. If I ever get bored I might try using the pango
code path.
Pango as I understand is most important for some Indic scripts where
font placement is really important. Lucide also uses it.

>
> Also, it probably wouldn't hurt to add a mapping for "WarpSans Combined"
> to "Workplace Sans" so that at least on a default system configuration,
> this problem will be less prone to occur.
>

This would be easy to do. The current code is
     // check for WarpSans and as we cannot display that (yet), replace
     // it with Workplace Sans
     int pos = 0;
     if ((pos = mFamilies.Find("WarpSans", false, 0, -1)) > -1) {
         mFamilies.Replace(pos, 8, NS_LITERAL_STRING("Workplace Sans"));
     }

Would it be better to just replicate the function or how to do
"Warpsans" OR "WarpSans Combined"? Also is the internal font name
exactly "WarpSans Combined"?
Dave
_______________________________________________
dev-ports-os2 mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-ports-os2
Reply | Threaded
Open this post in threaded view
|

Re: Misaligned text in Thunderbird 17 message list

Alex Taylor
On Sat, 6 Sep 2014 04:00:37 UTC, Dave Yeo <[hidden email]> wrote:

> > What I suspect is happening here is that the text is being positioned and drawn
> > according to the font's proper calculated line height, but the actual lines of
> > the list control are scaled to a constant default height, possibly on a fixed
> > percentage of the em size.
> >...
> > What I guess needs to happen is either:
> > (a) The list control's line height should be based on the display font's
> >      preferred line height (I don't know if this is possible given that the
> >      font in this case is a substitution); or
> > (b) Better logic needs to be used in order to centre the glyphs within the
> >      vertical space.
>
> Unluckily I'm not skillful enough to even comment on these changes, it's
> possible that using pango might fix some of these issues though to be
> honest from I hear, most people turn pango off as it introduces more
> problems then it solves. If I ever get bored I might try using the pango
> code path.

I might be able to figure out what needed doing if I knew where to look in
the code for this. Unfortunately, the Mozilla code is so labyrinthine that
someone like me who's unfamiliar with it has little hope of even knowing
where to look.  I assume this is in the common widgets code, though, not
something specific to Thunderbird.  Is that likely?


> Pango as I understand is most important for some Indic scripts where
> font placement is really important. Lucide also uses it.

I think Qt4 uses it as well.  I didn't realize it was an option for Mozilla.

> > Also, it probably wouldn't hurt to add a mapping for "WarpSans Combined"
> > to "Workplace Sans" so that at least on a default system configuration,
> > this problem will be less prone to occur.
> >
>
> This would be easy to do. The current code is
>      // check for WarpSans and as we cannot display that (yet), replace
>      // it with Workplace Sans
>      int pos = 0;
>      if ((pos = mFamilies.Find("WarpSans", false, 0, -1)) > -1) {
>          mFamilies.Replace(pos, 8, NS_LITERAL_STRING("Workplace Sans"));
>      }
>
> Would it be better to just replicate the function or how to do
> "Warpsans" OR "WarpSans Combined"? Also is the internal font name
> exactly "WarpSans Combined"?

The family name in both cases is "WarpSans".  "Combined" is the style
(subfamily) name in this case, for a PM facename of "WarpSans Combined".

It looks as though the above logic simply replaces the family name and leaves
the subfamily name as-is, so perhaps "WarpSans Combined" is getting mapped to
"Workplace Sans Combined", which would surely explain why it's not working.

I don't know how these functions work, but putting an additional check inside
that condition which looks for a style name of "Combined" and changes the
subfamily name to "Regular" could perhaps work.

--
Alex Taylor
http://www.altsan.org

Please take off hat when replying.
_______________________________________________
dev-ports-os2 mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-ports-os2
Reply | Threaded
Open this post in threaded view
|

Re: Misaligned text in Thunderbird 17 message list

Dave Yeo-3
Alex Taylor wrote:

> On Sat, 6 Sep 2014 04:00:37 UTC, Dave Yeo <[hidden email]> wrote:
>
>>> What I suspect is happening here is that the text is being positioned and drawn
>>> according to the font's proper calculated line height, but the actual lines of
>>> the list control are scaled to a constant default height, possibly on a fixed
>>> percentage of the em size.
>>> ...
>>> What I guess needs to happen is either:
>>> (a) The list control's line height should be based on the display font's
>>>       preferred line height (I don't know if this is possible given that the
>>>       font in this case is a substitution); or
>>> (b) Better logic needs to be used in order to centre the glyphs within the
>>>       vertical space.
>>
>> Unluckily I'm not skillful enough to even comment on these changes, it's
>> possible that using pango might fix some of these issues though to be
>> honest from I hear, most people turn pango off as it introduces more
>> problems then it solves. If I ever get bored I might try using the pango
>> code path.
>
> I might be able to figure out what needed doing if I knew where to look in
> the code for this. Unfortunately, the Mozilla code is so labyrinthine that
> someone like me who's unfamiliar with it has little hope of even knowing
> where to look.  I assume this is in the common widgets code, though, not
> something specific to Thunderbird.  Is that likely?

It's common Mozilla code though thebes rather then widgets. The OS/2
specific code is here,
https://github.com/bitwiseworks/mozilla-os2/blob/master/gfx/thebes/gfxOS2Fonts.cpp 
with the headers, common code and other platforms in the same directory.

>
>
>> Pango as I understand is most important for some Indic scripts where
>> font placement is really important. Lucide also uses it.
>
> I think Qt4 uses it as well.  I didn't realize it was an option for Mozilla.

It's how Linux does it (freetype, pango and fontconfig) and we follow
that route more closely then others. I see that halfbuzz is also
supported now.

>
>>> Also, it probably wouldn't hurt to add a mapping for "WarpSans Combined"
>>> to "Workplace Sans" so that at least on a default system configuration,
>>> this problem will be less prone to occur.
>>>
>>
>> This would be easy to do. The current code is
>>       // check for WarpSans and as we cannot display that (yet), replace
>>       // it with Workplace Sans
>>       int pos = 0;
>>       if ((pos = mFamilies.Find("WarpSans", false, 0, -1)) > -1) {
>>           mFamilies.Replace(pos, 8, NS_LITERAL_STRING("Workplace Sans"));
>>       }
>>
>> Would it be better to just replicate the function or how to do
>> "Warpsans" OR "WarpSans Combined"? Also is the internal font name
>> exactly "WarpSans Combined"?
>
> The family name in both cases is "WarpSans".  "Combined" is the style
> (subfamily) name in this case, for a PM facename of "WarpSans Combined".
>
> It looks as though the above logic simply replaces the family name and leaves
> the subfamily name as-is, so perhaps "WarpSans Combined" is getting mapped to
> "Workplace Sans Combined", which would surely explain why it's not working.
>
> I don't know how these functions work, but putting an additional check inside
> that condition which looks for a style name of "Combined" and changes the
> subfamily name to "Regular" could perhaps work.
>

Dave
_______________________________________________
dev-ports-os2 mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-ports-os2