Closed
Bug 45762
Opened 25 years ago
Closed 25 years ago
[PP]Linux - Message displayed with variable width font despite prefs
Categories
(MailNews Core :: MIME, defect, P2)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: pmock, Assigned: nhottanscp)
References
Details
(Keywords: platform-parity, Whiteboard: [dogfood+][nsbeta3+][PDTP2]patch in hand (reviewed).)
Attachments
(1 file)
1.10 KB,
patch
|
Details | Diff | Splinter Review |
Build Date & Platform Bug Found:
win32 commercial seamonkey build 2000-071709-m17 installed on P500 Win98
linux commercial seamonkey build 2000-071709-m17 installed on P200 RedHat 6.2
Overview Description:
Related to bug 38511. On linux only, the message displayed with variable font
despite preference setting.
Steps to Reproduce:
1) Start Seamonkey mail
2) Start a plain text mail message
3) Address the message to yourself, add a subject title
4) In the message body add the following text line
IIIIIIIII Hello
XXXXXXXXX Hello
5) Sent the plain text message
6) Retrieve the mail message
7) Set the "View Message" preference to use fixed font
8) Save changes
9) View the mail message
The message body is displayed in a variable font
Note: if you set the pref to use a variable font, it displays the character
in a courier type font but the font spacing is still variable font.
Actual Results:
The type is displayed in a variable font even though you set to use a fix font.
You can tell it's a variable font by the font style and the character spacing if
not the same. The letter "I" should take the same space as the letter "X"
Expected Results:
The correct font and font spacing should be used.
Additional Builds and Platforms Tested On:
win32 commercial seamonkey build 2000-071709-m17 installed on P500 Win98
macos commercial seamonkey build 2000-071708-m17 installed on G3/400 OS 9.04
Additional Information:
This problem does not occur on win32 or Macos. I view the same message on the
other platforms.
Changing qa assign to myself.
QA Contact: lchiang → pmock
Summary: [PP]Linux - Message displayed with variable width font despite prefs → [PP]Linux - Message displayed with variable width font despite prefs
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•25 years ago
|
||
Addding selmer and ftang to cc.
Steve, this is not an i18n bug and I need your help. Do you think this is
nsbeta3?
Assignee | ||
Comment 3•25 years ago
|
||
Put nsbeta3 and reassign to selmer so this will be reviewed by the mail triage
meeting.
Comment 4•25 years ago
|
||
Naoki, thanks for pinging us, please go ahead and fix this.
Assignee: selmer → nhotta
Whiteboard: [nsbeta3+]
Assignee | ||
Comment 5•25 years ago
|
||
I see this in win32 too.
Ben, could you take a look at this? GetMailNewsFont() returns "Time-New-Roman"
when I select variable font display for plain text. So I don't think this is my
problem.
Assignee: nhotta → mozilla
Comment 6•25 years ago
|
||
I don't understand this bug. Are you saying that you see Courier as variable
width font? Courier is by definition a fixed width font.
Also, I don't understadn nhotta's last comment. Peter said, he sat the pref to
fixed width font.
What I do see, however, is that the msg is displayed in a vaiable width font, if
I select fixed width font, but smaller as if variable widith font is selected.
Will investigate.
Comment 7•25 years ago
|
||
Oh, misread the description. Yes, I see the bug. However, variable width font
works fine for me, and did all the time (it is my preference). (But still don't
understand how Courier can be variable width.)
Comment 8•25 years ago
|
||
> Yes, I see the bug.
No, I don't. What I saw was a problem in my local changes. Peter, could you
please attach screenshots for msg display with both variable width and fixed
width and tell me your general font settings (font and size for each fixed
width, serif and sans-serif, and the serif/sans-serif pref)?
What I see is that a message with this header:
Content-Type: text/plain; charset=us-ascii; format=flowed
(which is what Mozilla generates) is displayed on a proportional font, while a
message with this header:
Content-Type: TEXT/PLAIN; charset=US-ASCII
(which is what Pine generates) is displayed in a fixed font.
Comment 10•25 years ago
|
||
Yes, can reproduce with M17 now (not sure, what I saw before).
Reporter | ||
Comment 11•25 years ago
|
||
Sorry for not replying... I couldn't figure out how to take a screen shot on
linux. I glad you can reproduce the issue. :-)
Comment 12•25 years ago
|
||
I don't need them anymore, but for the next time: Just start GIMP, then
Xtns|Screenshot. If you don't have the GIMP installed, there're other apps which
do the same, but I forgot which ones.
Reporter | ||
Comment 13•25 years ago
|
||
Thanks for the tip Ben. Gimp works great. I never used this utility before but
I will from now on. :)
Comment 14•25 years ago
|
||
*** Bug 50185 has been marked as a duplicate of this bug. ***
Updated•25 years ago
|
Priority: P3 → P1
Comment 15•25 years ago
|
||
This makes mail really painful to use for reading bugzilla mail, or any other
ascii mail where people send out tables with columns that are supposed to be
aligned. It's semi-dogfood for me since I get a lot of bugzilla mail. Are you
still looking for a screenshot? I can produce one easily enough if you need
one.
Comment 16•25 years ago
|
||
*** Bug 50322 has been marked as a duplicate of this bug. ***
Comment 17•25 years ago
|
||
Nominating as "dogfood". This is making it very hard for me to decipher bugzilla
mail, newsgroup posts, and patches.
Keywords: dogfood
Comment 19•25 years ago
|
||
PDT downgrading to P2
Priority: P1 → P2
Whiteboard: [dogfood+][nsbeta3+] → [dogfood+][nsbeta3+][PDTP2]
Comment 20•25 years ago
|
||
Tenthumbs' data shows that format=flowed is the culprit, right? (TEXT/PLAIN vs.
lowercase same can't be it, or our MIME typing is insane.) Ben, what's the
outlook for a fix?
/be
Updated•25 years ago
|
Status: NEW → ASSIGNED
Priority: P2 → P1
Comment 21•25 years ago
|
||
Phil, unless you intend to pay me, this is P1 for me. You're welcome to add your
evaluations to the status whiteboard, though.
Brendan, from what I saw, this seems to be a style bug.
We insert a font-style via e.g. <div class="text-plain" style="font-family:
schumacher-clean-iso8859-1; font-size: 13px;"> and (for non-flowed) then
overwrite the fixed-width font (because the user might have enabled variable
width fonts) of the following <pre> via .text-plain pre { font-family: inherit;}
in a stylesheet. This should (and did in the past) produce a fixed-width font
for the msg. Obviously, that's not what we see. If I remove the "inherit", the
msg is displayed in the fixed-width font that the div specifies (not the default
fixed-width font NGLayout would use (see bug 26182 for why they are different)).
It is even more wierd for flowed-msgs: We output the same div, but a different
class. No tt, no pre follows it, so we don't even have to use style tricks.
Nevertheless, a variable width-font is used.
In short, I have no idea what is going on. Everything libmime outputs/uses looks
OK.
Comment 22•25 years ago
|
||
> Tenthumbs' data shows that format=flowed is the culprit, right?
No, bugzilla mails are not format=flowed, nevertheless they show the bug (now
that bug 41637 is resolved).
Comment 23•25 years ago
|
||
Is it possible, that font-family in inline CSS is screwed? If I load
<html><body>
<div style="font-family: adobe-courier-iso8859-1; font-size: 40px;">
ftang@netscape.com changed:
</div>
</body></html>
into the browser, I get a huge, variable-width font. (If the font name is wrong,
this would be nhotta's bug.)
REASSINGing to Style System default owner (pierre) for investigation.
Assignee: mozilla → pierre
Status: ASSIGNED → NEW
Priority: P1 → P2
Whiteboard: [dogfood+][nsbeta3+][PDTP2] → [dogfood+][nsbeta3+][PDTP2][NEED INFO]
Comment 24•25 years ago
|
||
Wait, this is pp, so it seems more likely that the font name is wrong.
REASSIGNing to nhotta.
Assignee: pierre → nhotta
Keywords: pp
Assignee | ||
Comment 25•25 years ago
|
||
Ben, do you have Linux build? Could you dump the font name?
Assignee: nhotta → mozilla
Comment 26•25 years ago
|
||
If you want courier, just say "font-family: courier;"
Assignee | ||
Comment 27•25 years ago
|
||
I dumped a font name on linux (pulled this morning). I put a printf in
GetMailNewsFont() in mimemoz2.cpp.
A dumped font name was adobe-courier-iso-8859-1 which was the font name I
selected for MonoSpace in the font preference.
My message display option was "Fixed width font" for plain text messages.
So the font name is correct (used the mono space font set in the pref).
Below is the message which I used for my testing. I saw the width of 'I' and 'X'
were not the same even the message is plain text and my display pref option was
fixed font.
From - Thu Aug 31 15:49:50 2000
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
Return-Path: <nhotta@netscape.com>
Received: from dredd.mcom.com ([205.217.237.54]) by
judge.mcom.com (Netscape Messaging Server 4.15) with ESMTP id
FYY3DD00.46H for <naoki2@judge.mcom.com>; Mon, 7 Aug 2000 16:17:37
-0700
Received: from netscape.com ([208.12.37.221]) by dredd.mcom.com
(Netscape Messaging Server 4.15 dredd Jun 22 2000 16:29:39) with
ESMTP id FYY3DD00.OZS for <naoki2@netscape.com>; Mon, 7 Aug 2000
16:17:37 -0700
Message-ID: <398F4466.EDF739A8@netscape.com>
Date: Mon, 07 Aug 2000 16:21:10 -0700
From: nhotta@netscape.com (Naoki Hotta)
X-Mailer: Mozilla 4.7 [en]C-AOLNSCP (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: naoki2@netscape.com
Subject: linux test case
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
IIIIIIIII Hello
XXXXXXXXX Hello
Comment 28•25 years ago
|
||
Names like adobe-courier-iso-8859-1 will work in prefs, but not in CSS'
font-family: XXX.
Comment 29•25 years ago
|
||
Note that this worked fine for 1 or 2 months.
Comment 30•25 years ago
|
||
OK, maybe I was wrong in my previous comment. I don't know why it stopped
working for you.
Comment 31•25 years ago
|
||
I'm also seeing this bug, and I set my fixed-width font via the prefs dialog to
"clean", which maps in prefs.js to
user_pref("font.name.monospace.x-western", "schumacher-clean-iso8859-1");
This had been working fine (I saw plaintext mail in schumacher-clean-iso8859-1)
up through the beginning of August; I believe it regressed sometime between
August 4 and 14, though I might be off by a few days (I don't always run mail
every day).
Assignee | ||
Comment 32•25 years ago
|
||
As previously mentioned by Ben, the current behavior is not mail specific.
By using browser to show the example below, the first case is shown in fixed
width but the second case is not shown in fixed width.
Reassign to Erik for investigation.
<div style="font-family: courier;">
IIIII<br>
XXXXX<br>
</div><br>
<div style="font-family: adobe-courier-iso8859-1;">
IIIII<br>
XXXXX<br>
</div><br>
Assignee: mozilla → erik
Comment 33•25 years ago
|
||
ben and nhotta, where are the code which generate those CSS ? I don't think CSS
spec said that we could use
font-family: adobe-courier-iso8859-1;
I think css spec said we shoud use
font-family: courier;
where is the code which generate
font-family: adobe-courier-iso8859-1;
Are they hard coded ?
Is that here ?
mailnews/mime/src/mimethtm.cpp#68
66 if (NS_SUCCEEDED(GetMailNewsFont(obj, PR_FALSE, fontName,
sizeof(fontName), &fontSize)))
67 {
68 PR_snprintf(buf, 256, "<div style=\"font-family: %s; font-size:
%dpx;\">", (const char *) fontName, fontSize);
69 status = MimeObject_write(obj, buf, nsCRT::strlen(buf), PR_FALSE);
70 }
nhotta- is the following routine used to get the font name for mail/news
erik- maybe you can help them twick the routine so it will return the *right*
family name.
http://lxr.mozilla.org/seamonkey/source/mailnews/mime/src/mimemoz2.cpp#1992
1991
1992 nsresult GetMailNewsFont(MimeObject *obj, PRBool styleFixed, char
*fontName, PRUint32 nameBuffSize, PRInt32 *fontPixelSize)
1993 {
1994 nsresult rv = NS_OK;
1995
1996 nsIPref *aPrefs = GetPrefServiceManager(obj->options);
1997 if (aPrefs) {
1998 MimeInlineText *text = (MimeInlineText *) obj;
1999 nsCAutoString aCharset;
2000 PRUnichar *unicode = nsnull;
2001 nsCAutoString convertedStr;
2002 nsCAutoString variableFontType; // serif, sans-serif
2003
2004 // get a charset
2005 if (!text->charset || !(*text->charset))
2006 aCharset.Assign("us-ascii");
2007 else
2008 aCharset.Assign(text->charset);
2009
2010 // get variable font type
2011 char* variable_font_type = nsnull;
2012 rv = aPrefs->CopyCharPref("font.default", &variable_font_type);
2013 if (NS_FAILED(rv))
2014 return rv;
2015 if (!variable_font_type)
2016 return NS_ERROR_FAILURE;
2017 variableFontType.Assign(variable_font_type);
2018 PR_FREEIF(variable_font_type);
2019
2020 // if indicated by the pref, do language sensitive font selection
2021 PRBool languageSensitiveFont = PR_FALSE;
2022 rv = aPrefs->GetBoolPref("mailnews.language_sensitive_font",
&languageSensitiveFont);
2023 if (NS_SUCCEEDED(rv) && languageSensitiveFont) {
2024 nsCOMPtr<nsICharsetConverterManager> aCharSets;
2025 nsCOMPtr<nsIAtom> aLangGroup;
2026 const PRUnichar* langGroup = nsnull;
2027 nsCAutoString aPrefStr;
2028
2029 if (styleFixed) {
2030 aPrefStr.Assign("font.name.monospace.");
2031 }
2032 else {
2033 aPrefStr.Assign("font.name.");
2034 aPrefStr.Append(variableFontType);
2035 aPrefStr.Append(".");
2036 }
2037
2038 aCharset.ToLowerCase();
2039
2040 aCharSets = do_GetService(NS_CHARSETCONVERTERMANAGER_PROGID);
2041 if (!aCharSets)
2042 return NS_ERROR_FAILURE;
2043
2044 // get a language, e.g. x-western, ja
2045 nsAutoString u;
2046 u.AssignWithConversion(aCharset);
2047 rv = aCharSets->GetCharsetLangGroup(&u, getter_AddRefs(aLangGroup));
2048 if (NS_FAILED(rv))
2049 return rv;
2050 rv = aLangGroup->GetUnicode(&langGroup);
2051 if (NS_FAILED(rv))
2052 return rv;
2053
2054 // append the language to the pref string
2055 aPrefStr.AppendWithConversion(langGroup);
2056
2057 // get a font name from pref, could be non ascii (need charset
conversion)
2058 // this is not necessary if we insert this tag after the message is
converted to UTF-8
2059 rv = aPrefs->CopyUnicharPref(aPrefStr, &unicode);
2060 if (NS_FAILED(rv))
2061 return rv;
2062
2063 rv = nsMsgI18NConvertFromUnicode(nsCAutoString("UTF-8"),
nsAutoString(unicode), convertedStr);
2064 PR_FREEIF(unicode);
2065 if (NS_FAILED(rv))
2066 return rv;
2067
2068 if (convertedStr.Length() >= nameBuffSize)
2069 return NS_ERROR_FAILURE;
2070
2071 PL_strcpy(fontName, convertedStr.GetBuffer());
2072
2073 // get a font size from pref
2074 aPrefStr.Assign(!styleFixed ? "font.size.variable." :
"font.size.fixed.");
2075 aPrefStr.AppendWithConversion(langGroup);
2076 rv = aPrefs->GetIntPref(aPrefStr, fontPixelSize);
2077 if (NS_FAILED(rv))
2078 return rv;
2079
2080 }
2081 // otherwise, use the mailnews font setting from pref
2082 else {
2083
2084 // get a font name from pref, could be non ascii (need charset
conversion)
2085 // this is not necessary if we insert this tag after the message is
converted to UTF-8
2086 rv = aPrefs->CopyUnicharPref(!styleFixed ? "mailnews.font.name.html"
: "mailnews.font.name.plain", &unicode);
2087 if (NS_FAILED(rv))
2088 return rv;
2089
2090 rv = nsMsgI18NConvertFromUnicode(nsCAutoString("UTF-8"),
nsAutoString(unicode), convertedStr);
2091 PR_FREEIF(unicode);
2092 if (NS_FAILED(rv))
2093 return rv;
2094
2095 if (convertedStr.Length() >= nameBuffSize)
2096 return NS_ERROR_FAILURE;
2097
2098 PL_strcpy(fontName, convertedStr.GetBuffer());
2099
2100 // get a font size from pref
2101 rv = aPrefs->GetIntPref(!styleFixed ? "mailnews.font.size.html" :
"mailnews.font.size.plain", fontPixelSize);
2102 if (NS_FAILED(rv))
2103 return rv;
2104
2105 }
2106 }
2107
2108 return NS_OK;
2109 }
Comment 34•25 years ago
|
||
nhotta and I work out a fix by change the GetMailNewsFont routine.
reassign to nhotta. and wait erik to review the code.
Assignee: erik → nhotta
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 35•25 years ago
|
||
Updated•25 years ago
|
Whiteboard: [dogfood+][nsbeta3+][PDTP2][NEED INFO] → [dogfood+][nsbeta3+][PDTP2]patch in hand need code review.
Assignee | ||
Updated•25 years ago
|
Whiteboard: [dogfood+][nsbeta3+][PDTP2]patch in hand need code review. → [dogfood+][nsbeta3+][PDTP2]patch in hand (reviewed).
Assignee | ||
Comment 36•25 years ago
|
||
Checked in the patch.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 37•25 years ago
|
||
Verified fixed on linux using today commercial build.
linux commercial seamonkey build 2000-092008-m18 installed on P200 RedHat 6.2
Also checked on win32 and macos for regression test.
win32 commercial seamonkey build 2000-092009-m18 installed on P500 Win98
macos commercial seamonkey build 2000-092008-m18 installed on G3/400 OS 9.04
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Product: MailNews → Core
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•