Closed Bug 39811 Opened 24 years ago Closed 24 years ago

Mac text layout has bad spacing at style changes

Categories

(Core :: Layout, defect, P3)

PowerPC
Mac System 8.5
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: sfraser_bugs, Assigned: sfraser_bugs)

References

()

Details

(Keywords: platform-parity, Whiteboard: [nsbeta2+][dogfood-] fix awaiting review)

Attachments

(5 files)

Text layout on Mac is currently hosed, in that it adds lots of horizonatal space, 
or has too little space, at style changes.
Nominating for beta2.
Keywords: nsbeta2
See also bug 20211, which is similar but only applies to postscript fonts.
The horizontal space Mozilla reserves for text does not change with the computed font 

size when logical resolution is changed.



On a related note: Mac OS also lacks an implemtation of GetBoundingMetrics() for 

MathML.
Target Milestone: --- → M17
adding self to cc list.
Frank, please take a look at this. Do you know something about this bug?
This is Franks. Thanks
Assignee: dcone → ftang
Is this caused by the same problem of 36417 ?
Status: NEW → ASSIGNED
reassign to garywade@desisoftsystems.com
Assignee: ftang → garywade
Status: ASSIGNED → NEW
bug 38152 may be the same as this.
Putting on [nsbeta2-] radar.  
Whiteboard: [nsbeta2-]
whoa, have you _seen_ this? it's not just obvious and embarrasing but it makes it 
very hard to read the text on a page. i'd say this was even dogfood. removing for 
re-evaluation.
Keywords: dogfood
Whiteboard: [nsbeta2-]
I agree with pink. The Mac build sucks ass enough already without being made even 
more embarrassing by obvious text layout problems.

Gary, what's up with a fix for this?
Keywords: pp
if this were win32, this would be a beta stopper no questions asked.
Severity: normal → major
Putting on [nsbeta2+][6/15] radar to fix the additional spaces.  If problem is 
worse than attachment shown, please add a new one and resubmit.
Whiteboard: [nsbeta2+][6/15]
*** Bug 38152 has been marked as a duplicate of this bug. ***
Marked blocker: it screws up the rendering on too many pages and affects the 
verifications I can do for other style & layout bugs.

Examples of pages where the layout is obviously messed up are:
- http://www.w3.org/TR/html4/
- http://www.w3.org/MarkUp/
- http://www.w3.org/
- Viewer Demo #5 (look at the 1st line)
- Viewer Demo #0
- http://home.netscape.com/index1.html (look at the links under "Today's 
Features...")

Reassigned to myself and removed the "[nsbeta2+][6/15]" tag per leger's request. 
It should be changed to "[nsbeta2+][ASAP]".
Assignee: garywade → pierre
Severity: major → blocker
Target Milestone: M17 → M16
Status: NEW → ASSIGNED
Whiteboard: [nsbeta2+][6/15]
Robert OCallahan attached a patch to bug 36417 that has something to do with Mac 
font measurements.  Could these be related?  Maybe even the same problem?
Adding a testcase in the URL. There are two causes to this, and I have a fix for 
one (in nsGfxUtils.h:70).
Fixed. Bad port font maintenance broke text measurement.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Excellent, this is fixed ! Tested with the May 29th Mac build (2000052920).

Status: RESOLVED → VERIFIED
Attached image Still broken for me
Running 2000053011. Go to Preferences, set the font to Georgia. Now go to the About box.
Yeah, I see that too. I think that the © entity is messing up text 
measurement.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
I updated the test case to show the problem. You should set your Serif font to 
something wacky to see the problem. I'm also seeing that only the first text run 
on a line is drawing with the correct font; the rest seems to use Times. Eh?
I can see the font changes too. As for your test case, I can't see your "jazz" machine so I can't comment.
Sent back to Simon: the bug and the first part of the fix was his.
Assignee: pierre → sfraser
Status: REOPENED → NEW
Putting on [nsbeta2+][dogfood-] radar.  Does not need a fix ASAP for daily work, 
but we should fix this for beta2.
Whiteboard: [nsbeta2+][dogfood-]
So it turns out that the Mac GFX code is deficient in that it fails to look at 
font prefs when mapping generic fonts to platform fonts, at least when drawing 
non-unicode text. The Unicode case is handled properly (which is why this works 
when the string being drawn contains 8-bit ASCII).
ftang: can you review this patch? I'm making use of nsUnicodeMappingUtil, which 
already contains a lookup table of generic family -> font, taking prefs into 
account. I'm always calling it for the smRoman script, since we don't have a 
lanuage group here, and this code is only called when drawing char*s (assumed to 
be US-ASCII).

Index: nsFontMetricsMac.cpp
===================================================================
RCS file: /cvsroot/mozilla/gfx/src/mac/nsFontMetricsMac.cpp,v
retrieving revision 1.51
diff -w -c -1 -r1.51 nsFontMetricsMac.cpp
*** nsFontMetricsMac.cpp	2000/05/30 17:53:20	1.51
--- nsFontMetricsMac.cpp	2000/05/31 05:05:32
***************
*** 27,28 ****
--- 27,29 ----
  #include "nsUnicodeFontMappingMac.h"
+ #include "nsUnicodeMappingUtil.h"
  #include "nsGfxUtils.h"
***************
*** 115,117 ****
--- 116,131 ----
    // the CSS generic names (conversions from the old Mac Mozilla code for now)
+   nsUnicodeMappingUtil* unicodeMappingUtil = 
nsUnicodeMappingUtil::GetSingleton();
+   if (unicodeMappingUtil)
+   {
+     nsString*   foundFont = unicodeMappingUtil->GenericFontNameForScript(
+           smRoman,      // should we be looking at a language-group here?
+           unicodeMappingUtil->MapGenericFontNameType(aGenericFamily));
+     if (foundFont)
+     {
+       aFontFace = *foundFont;
+       return;
+     }
+   }
    
+   // fall back onto hard-coded font names
    if (aGenericFamily.EqualsIgnoreCase("serif"))
the patch looks fine to me, tested and running with it with no problems so far.
Does it work with the logical resolution set to a value other than 96 ppi?
Yes. I tried 72, and it worked fine.
Status: NEW → ASSIGNED
Whiteboard: [nsbeta2+][dogfood-] → [nsbeta2+][dogfood-] fix awaiting review
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Fixed in the June 2nd Mac Build.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: