Closed Bug 87664 Opened 24 years ago Closed 24 years ago

before bitmap scaling look for other font foundries

Categories

(Core :: Layout, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: tenthumbs, Assigned: ftang)

References

Details

(Keywords: fonts)

Attachments

(2 files, 1 obsolete file)

Mozilla needs to look outside the font foundry for fonts, particularly large ones. Right now it always sticks with one foundry. My default font is helvetica so mozilla uses -adobe-helvetica-* fonts using scaled bitmap variants when it wants to. Not surprisingly, that looks crappy. It could look better because I have scalable type1 helvetica fonts available. If fact there listed before the scaled bitmap ones. The font path goes /usr/X11R6/lib/X11/fonts/75dpi/:unscaled ... /usr/X11R6/lib/X11/fonts/urw/ /usr/X11R6/lib/X11/fonts/Math/Mathematica/type1 ... /usr/X11R6/lib/X11/fonts/75dpi so xlsfonts shows -adobe-helvetica-bold-o-normal--10-100-75-75-p-60-iso8859-1 [ a bunch more unscaled bitmap varieties ] -adobe-helvetica-medium-r-normal--34-240-100-100-p-176-iso8859-1 -urw-helvetica-bold-o-normal--0-0-0-0-p-0-iso8859-1 -urw-helvetica-bold-r-normal--0-0-0-0-p-0-iso8859-1 -urw-helvetica-medium-o-normal--0-0-0-0-p-0-iso8859-1 -urw-helvetica-medium-r-normal--0-0-0-0-p-0-iso8859-1 -wri-helvetica-bold-o-normal--0-0-0-0-p-0-iso8859-1 -wri-helvetica-bold-r-normal--0-0-0-0-p-0-iso8859-1 -wri-helvetica-medium-o-normal--0-0-0-0-p-0-iso8859-1 -wri-helvetica-medium-r-normal--0-0-0-0-p-0-iso8859-1 [ repeated unscaled adobe varieties ] -adobe-helvetica-bold-o-normal--0-0-100-100-p-0-iso8859-1 -adobe-helvetica-bold-r-normal--0-0-100-100-p-0-iso8859-1 -adobe-helvetica-medium-o-normal--0-0-100-100-p-0-iso8859-1 -adobe-helvetica-medium-r-normal--0-0-100-100-p-0-iso8859-1 So, when it's looking for a largish font, say 42pt, it ignores the scalable URW and WRI fonts and goes for the ugly scaled bitmaps. Using http://bugzilla.mozilla.org/showattachment.cgi?attach_id=39772 as an example, mozilla goes for this: loaded -adobe-helvetica-medium-r-normal--8-80-75-75-p-46-iso8859-1 loaded -adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1 loaded -adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1 loaded -adobe-helvetica-medium-r-normal--24-240-75-75-p-130-iso8859-1 loaded -adobe-helvetica-medium-r-normal--31-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--32-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--33-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--34-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--35-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--36-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--37-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--38-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--39-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--40-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--41-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--42-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--43-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--44-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--45-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--46-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--47-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--48-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--49-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--51-*-*-*-p-*-iso8859-1 loaded -adobe-helvetica-medium-r-normal--52-*-*-*-p-*-iso8859-1 Lots of ugliness there.
interesting idea: before chosing a bitmap scaled font wildcard the foundry and search for a better fit.
this patch looks for an outline scaled font from any foundry in place of a bitmap scaled font. Unfortunately, the -adobe-helvetica-medium-r-normal--0-0-0-0-p-*-iso8859-1 looks awful at large sized.
The image above is *not* magnified. It was taken by "xmag -mag 1". At small pixel sizes the adobe-helvetica looks good while the wri-helvetica looks jaggy. Oddly, at larger sizes the adobe-helvetica font is jaggy/ugly at while the wri-helvetica looks pretty good. Very strange.
Status: NEW → ASSIGNED
Target Milestone: --- → Future
FWIW, I've attached an example of how mozilla displays scalable and scaled bitmap fonts at large sizes. I had to add some font aliases so that I could specify exactly which fotn to use but it does give the idea. For 28pt, mozilla decided to use a 24pt bitmap font which is why it's smaller. That's the only exception.
The patch in attachment 40228 [details] [diff] [review] does not work. I thought if I asked for a font with this spec "-*-%s-%s-%s-%s-%s-0-0-0-0-%s-*-%s" it would return an outline scaled font. Not true. Hence the what I thought were outline scaled adobe-helvetica glyphs were in fact bitmap scaled.
The current Mozilla font code has two layers: 1) select a foundry/family that can display the glyph 2) select a size within that foundry/family So when the code finds out that only a bitmap scaled font will work we are not at a level where we can choose a different foundry or family. Maybe if I added a test to the upper loop, wouldBitmapScale, it could then check other foundries before accepting the bitmap scaled font.
Summary: [Unix] Mozilla needs to look at different font foundries for fonts → before bitmap scaling look for other font foundries
I believe that bug 94327 will solve the most common cases of this bug.
Attachment #40228 - Attachment is obsolete: true
Keywords: fonts
Depends on: 94327
--> ftang
Assignee: bstell → ftang
Status: ASSIGNED → NEW
bulk move NEW FUTURE bug to ASSIGN
Status: NEW → ASSIGNED
now that bug 94327 is fixed this should be fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: