Closed Bug 413115 Opened 17 years ago Closed 16 years ago

infinity (∞) and other symbols are rendered as hex boxes in mathml expressions on Windows with STIX fonts.

Categories

(Core :: MathML, defect, P2)

x86
Windows XP
defect

Tracking

()

RESOLVED FIXED
mozilla1.9beta5

People

(Reporter: dagan, Assigned: karlt)

References

Details

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3pre) Gecko/2008011815 Minefield/3.0b3pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3pre) Gecko/2008011815 Minefield/3.0b3pre

The infinity symbol of a mathml expression is not properly displayed by Minefield on Windows XP with Stix fonts, (but is rendered correctly On Mac OSx).

Reproducible: Always

Steps to Reproduce:
1.Open a xhtml file mathml expression that includes the infinity symbol by Minefield on windows XP machine.
2.The symbol is not properly displayed.
3.
Actual Results:  
Instread of the infinity symbol a square appears with its hexadecimal code (221E).

Expected Results:  
The infinity symbol to be displayed.

The bug appears on wndows XP, but does not appear on Mac OSx.
Component: General → MathML
Product: Firefox → Core
QA Contact: general → mathml
Version: unspecified → Trunk
There are a few issues here:

1) The default value of the mathvariant attribute on <mi> elements with a
   single character is italic, but this should only cause alphanumeric symbols
   to take italic forms.

   http://www.w3.org/TR/2007/WD-MathML3-20071214/chapter3.html#presm.commatt:

   "By design, the only cases that have an unambiguous interpretation are
   exactly the ones that correspond to SMP Math Alphanumeric Symbol
   characters, which are enumerated in Section 6.5 Mathematical Alphanumeric
   Symbols. The mathvariant values "initial", "tailed", "looped" and
   "stretched" are expected to apply only to Arabic characters. In all other
   cases, it is suggested that renderers ignore the value of the mathvariant
   attribute if it is present."

2) The Italic subfamily of STIXGeneral does not support the infinity
   character.  The Roman subfamily does, but bug 382542 is preventing the
   Roman family from being used for fallback.

3) <mi mathvariant="normal">&#x221E;</mi> shows a glyph for the infinity
   symbol but it is from the wrong font (serif).
Blocks: mathvariant
Status: UNCONFIRMED → NEW
Depends on: 162405, 382542
Ever confirmed: true
(Adding an explicit mathvariant="normal" to an <mi> that has default mathvariant="normal" should not change the font.)
Attachment #298152 - Flags: review?(roc)
Comment on attachment 298152 [details] [diff] [review]
let mathvariant="normal" inherit the document fonts [checked-in]

This would fix issue 3 and its a low risk change.
Attachment #298152 - Flags: approval1.9?
Flags: in-testsuite?
Attachment #298152 - Flags: approval1.9? → approval1.9+
Comment on attachment 298152 [details] [diff] [review]
let mathvariant="normal" inherit the document fonts [checked-in]

checked in with a reftest for issue 3.
Attachment #298152 - Attachment description: let mathvariant="normal" inherit the document fonts → let mathvariant="normal" inherit the document fonts [checked-in]
Summary: The infinity symbol (&#x221E;) is not rendered in mathml expressions by Minefield on Windows with Stix fonts. → The infinity symbol (&#x221E;) is rendered as a hex box in mathml expressions on Windows with STIX fonts.
Summary: The infinity symbol (&#x221E;) is rendered as a hex box in mathml expressions on Windows with STIX fonts. → The infinity (&#x221E;) and other symbols are rendered as hex boxes in mathml expressions on Windows with STIX fonts.
Summary: The infinity (&#x221E;) and other symbols are rendered as hex boxes in mathml expressions on Windows with STIX fonts. → infinity (&#x221E;) and other symbols are rendered as hex boxes in mathml expressions on Windows with STIX fonts.
Assignee: nobody → mozbugz
Keywords: relnote
Either issue 1 or issue 2 (or both) needs to be fixed by FF3.
Depending on how bug 382542 is resolved (for issue 2) we may still need to resolve issue 1.
Flags: blocking1.9?
Priority: -- → P2
Whiteboard: [swag:3d]
OK.  +'ing as well, math needs infinity.
Flags: blocking1.9? → blocking1.9+
Attached patch fix for issue 1 in comment 2 (obsolete) — Splinter Review
Only change the style of default mathvariant <mi> elements to italic when
there is a corresponding italic Mathematical Alphanumeric Symbol.

Accept non-BMP characters in nsMathMLOperator::LookupInvariantChar.
Update the mathvariant entries in mathfont.properties from PUA characters to
their Plane 1 Unicode assignments.  (Remainder of bug 289938)

The mathvariant strings were generated by saving
http://www.w3.org/TR/2003/REC-MathML2-20031021/italic.html and others as text,
editting sans-serif-bold-italic.txt to remove line wrapping, and running
this command (with the line-wrapping removed):

for file in *.txt; sed -e '0,/^Unicode/d' -e '/^$/,$d' $file | perl -MEncode -wne '$SIG{__WARN__}=sub{warn "$_ ",@_;};($v,$k) = map hex, (split)[0,1]; $k < 0x80 ? print chr $k : printf "\\u%04X", $k; printf "\\u%04x\\u%04x", unpack("n*", encode "utf-16be", chr $v), 0xfffd' > $file:r.string
Attachment #309339 - Flags: review?(roc)
Comment on attachment 309339 [details] [diff] [review]
fix for issue 1 in comment 2

+    if (!(mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::mathvariant_) ||
+          mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::fontstyle_))) {
+      if (!isSingleCharacter) {
+          fontstyle.AssignLiteral("normal");
+      }
+      else if (length == 1 && // BMP
+               !nsMathMLOperators::
+                TransformVariantChar(data[0], eMATHVARIANT_italic).
+                Equals(data)) {
+       // Transformation exists.  Try to make the BMP character look like the
+       // styled character using the style system until bug 114365 is resolved.
+       fontstyle.AssignLiteral("italic");
+      }
+      // else single character but there is no corresponding Math Alphanumeric
+      // Symbol character: "ignore the value of the [default] mathvariant
+      // attribute".
+    }

Not sure what indenting rules you're using here...
Attachment #309339 - Flags: superreview+
Attachment #309339 - Flags: review?(roc)
Attachment #309339 - Flags: review+
(In reply to comment #9)
> Not sure what indenting rules you're using here...

The kind that results when I find tabs in the patch and try to remove them by hand ;)

Added another emacs mode line and updated contributors.
Attachment #309339 - Attachment is obsolete: true
There could still be some issues if italic style is explicitly applied (bug   	324857) but the normal cases should be fixed.
Blocks: 289938, 324857
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Flags: in-testsuite? → in-testsuite+
Target Milestone: --- → mozilla1.9beta5
Keywords: relnote
Whiteboard: [swag:3d]
I am satisfied. Thanks, Samy
Thanks for checking.

(In reply to comment #12)
> There could still be some issues if italic style is explicitly applied (bug    
> 324857) but the normal cases should be fixed.

In case anyone is seeing issues, I meant bug 382542 (not 324857).
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: