Closed Bug 121148 Opened 23 years ago Closed 10 years ago

Need ability to know if a font is scalable or not.

Categories

(Core :: MathML, defect)

Sun
Solaris
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: rbs, Unassigned)

References

Details

[spin off of bug 87285]

The ability to get more specific information about fonts is often needed (e.g.,
if a font is scalable or not; if a font is serif or not, etc...) Although many
of these are open issues on Unix, it can be known if a font is scalable or not.
This bug is about allowing the code outside the font substem to query that
information as proposed in bug 87285#c95.
Is this different than the test already in the code:

http://lxr.mozilla.org/seamonkey/source/gfx/src/gtk/nsFontMetricsGTK.cpp#3675

3675     // check if bitmap non-scaled font
3676     if ((pixelSize[0] != '') || (pointSize[0] != '')) {
3677       SCALED_FONT_PRINTF(("bitmap (non-scaled) font: %s", fName));
3678     }
3679     // check if bitmap scaled font
3680     else if ((pixelSize[0] == '') && (pointSize[0] == '')
3681           && (resolutionX[0] != '') && (resolutionY[0] != '')) {
3682       SCALED_FONT_PRINTF(("bitmap scaled font: %s", fName));
3683     }
3684     // check if outline scaled font
3685     else if ((pixelSize[0] == '') && (pointSize[0] == '')
3686           && (resolutionX[0] == '') && (resolutionY[0] == '')) {
3687       outline_scaled = PR_TRUE;
3688       SCALED_FONT_PRINTF(("outline scaled font: %s", fName));
3689     }
3690     else {
3691       SCALED_FONT_PRINTF(("unexpected font values: %s", fName));
3692       SCALED_FONT_PRINTF(("      pixelSize[0] = %c", pixelSize[0]));
3693       SCALED_FONT_PRINTF(("      pointSize[0] = %c", pointSize[0]));
3694       SCALED_FONT_PRINTF(("    resolutionX[0] = %c", resolutionX[0]));
3695       SCALED_FONT_PRINTF(("    resolutionY[0] = %c", resolutionY[0]));
3696       static PRBool already_complained = PR_FALSE;
3697       // only complaing once 
3698       if (!already_complained) {
3699         already_complained = PR_TRUE;
3700         NS_ASSERTION(pixelSize[0] == '', "font scaler type test failed");
3701         NS_ASSERTION(pointSize[0] == '', "font scaler type test failed");
3702         NS_ASSERTION(resolutionX[0] == '', "font scaler type test failed");
3703         NS_ASSERTION(resolutionY[0] == '', "font scaler type test failed");
3704       }

cc:'in shanjian
The intention is to propagate that information outside the font subsystem so 
that MathML layout (higher up) can use it to pick the most suitable fonts for 
stretching MathML characters.

See http://bugzilla.mozilla.org/show_bug.cgi?id=87285#c89 and its next siblings.
QA Contact: ian → mathml
Status: NEW → ASSIGNED
Bug 663740 would be useful for comment 2, but bitmap fonts are not very common today, so I'm not aware of situations where detecting scalability would help.
Depends on: 663740
Assignee: roland.mainz → nobody
Status: ASSIGNED → NEW
Karl: I'm not sure I understand what problems this could solved... Should this be WONTFIX?
This would have been more important when there were fewer scalable fonts and many fonts were fixed size bitmap fonts.

When nsMathMLChar tries to use a bitmap font at a different size, it may find that the font can't be rendered at that size, and gfxFontGroup will select a different font for rendering.

If nsMathMLChar knows that a font is not scalable, then it wouldn't try to use it at a different size.

But let's not worry about this unless there are real cases showing problems.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.