Closed
Bug 227452
Opened 21 years ago
Closed 6 months ago
super/subscript offset : platform parity
Categories
(Core :: Layout: Text and Fonts, defect)
Core
Layout: Text and Fonts
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: jshin1987, Unassigned)
References
Details
Attachments
(2 files)
8.68 KB,
patch
|
Details | Diff | Splinter Review | |
100.46 KB,
image/jpeg
|
Details |
Different Gfx ports use different (fallback) values for the superscript offset and the subscript offset. 1. Win32 : try to get the value via Win32 API. if not available, use mXHeight for both offsets 2. Gtk-Xft: try to get the value from the OS/2 table if available. guarantee that it's at least a pixel. if not, use mXHeight for both offsets 3. Gtk-X11(Xlib/Xprint included) : try to get the value via X11 API (XA_*) if available. guarantee that it's at least a pixel. if not, use mXHeight for both offsets 4. Gtk-FT2(including PS printing with FT2) would be the same as Gtk-Xft with my patch for bug 226288. At the moment without it, it always uses mXHeight for both offsets 5. PS module (non-FT2, type1), BeOS, Photon : always uses mXHeight for both offsets 6. MacOS : mMaxAscent / 2 - 1 pixel for both offsets 7. OS/2 : mXHeight for the superscript offset mXHeight / 3 for the subscript offset It seems to me that falling back to what OS/2 is doing after trying to get the values from a font is about right. Using mXHeight for the subscript offset makes subscripts too far away from the baseline. We need to do some experiment.
Reporter | ||
Comment 1•20 years ago
|
||
Setting the subscript offset to a third of 'xheigh' doesn't seem to be a good idea. In this patch, I set it to a half of 'xheight'.
Reporter | ||
Comment 2•20 years ago
|
||
The left shot was taken with Mozilla 1.6 and the right was with firebird trunk build with the patch. The first three rows are identical because they're truetype fonts and Xft builds read off the subscript offset from the OS2 table. The bottom two are postscript type1 fonts and the fallback was taken. In the left, the fallback is to set it to xheight. With the patch, it's set to a half of xheight. BTW, I found that the line height depends on the subscript offset, which is unexpected.
Comment 3•20 years ago
|
||
> --- gfx/src/xlib/nsFontMetricsXlib.cpp 5 Feb 2004 01:57:06 -0000 > 1.162 > +++ gfx/src/xlib/nsFontMetricsXlib.cpp 25 Feb 2004 13:18:48 -0000 > @@ -1979,15 +1979,15 @@ void nsFontMetricsXlib::RealizeFont() > mSuperscriptOffset = mXHeight; > } > > if (ft->subscript_y(val)) { > mSubscriptOffset = nscoord(PR_MAX(f, NSToIntRound(val * f))); > } > else { >- mSubscriptOffset = mXHeight; >+ mSubscriptOffset = NSToCoordRound(mXHeight / 2.0); > } What happened to [3], e.g. using the XA_* attributes (see X11 FT engine fixes in http://bugs.xfree86.org/show_bug.cgi?id=1163 , too) for that purpose ?
Reporter | ||
Comment 4•20 years ago
|
||
(In reply to comment #3) > What happened to [3], e.g. using the XA_* attributes (see X11 FT engine fixes What does [3] refer to?
Comment 5•20 years ago
|
||
(In reply to comment #4) > (In reply to comment #3) > > > What happened to [3], e.g. using the XA_* attributes (see X11 FT engine fixes > > What does [3] refer to? -- snip -- 3. Gtk-X11(Xlib/Xprint included) : try to get the value via X11 API (XA_*) if available. guarantee that it's at least a pixel. if not, use mXHeight for both offsets -- snip --
Reporter | ||
Comment 6•20 years ago
|
||
The following takes care of that case. @@ -2096,15 +2096,15 @@ void nsFontMetricsXlib::RealizeFont() mSubscriptOffset = nscoord(PR_MAX(f, NSToIntRound(pr * f))); #ifdef REALLY_NOISY_FONTS printf("subscriptOffset=%d\n", mSubscriptOffset); #endif } else { - mSubscriptOffset = mXHeight; + mSubscriptOffset = NSToCoordRound(mXHeight / 2.0);
Comment 7•20 years ago
|
||
Jungshik Shin wrote: > The following takes care of that case. > > else > { > - mSubscriptOffset = mXHeight; > + mSubscriptOffset = NSToCoordRound(mXHeight / 2.0 Yeah, you're right... the code already uses the XA_*-attributes if available... I did only look at the patch and not at the code itself... somehow I expected something which actually adds some (more) XA_*-attribute related code.. :)
Comment 8•19 years ago
|
||
*** Bug 301819 has been marked as a duplicate of this bug. ***
Updated•15 years ago
|
QA Contact: ian → layout.fonts-and-text
Comment 9•14 years ago
|
||
I don't know the relationship between this bug and bug 225109, but I just made a rather long comment there that might be of interest: bug 225109 comment 14.
Comment 10•2 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months.
:jfkthame, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee: jshin1987 → nobody
Flags: needinfo?(jfkthame)
Updated•2 years ago
|
Severity: normal → S3
Comment 11•6 months ago
|
||
Sub- and superscripts are now handled by gfxFontStyle::AdjustForSubSuperscript
using constant factors that are uniform across platforms, so I think we can close this as WFM.
Status: NEW → RESOLVED
Closed: 6 months ago
Flags: needinfo?(jfkthame)
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•