Apache OpenOffice (AOO) Bugzilla – Issue 9121
[PATCH] Math does not implement mapsTo symbol.
Last modified: 2013-08-07 14:55:55 UTC
OpenOffice Math implements many symbols also provided by TeX. One symbol frequently needed is the mapsTo symbol (unicode character 0x21A6), which is currently not implemented. The untested patch implements the mapsTo symbol. diff -Nur --exclude CVS starmath.orig/inc/parse.hxx starmath/inc/parse.hxx --- starmath.orig/inc/parse.hxx Sat Nov 9 00:21:35 2002 +++ starmath/inc/parse.hxx Fri Nov 8 22:57:48 2002 @@ -148,7 +148,7 @@ TLEFTARROW, TRIGHTARROW, TUPARROW, TDOWNARROW, TDIVIDES, TNDIBVIDES, TSETN, TSETZ, TSETQ, TSETR, TSETC, TWIDEVEC, TWIDETILDE, TWIDEHAT, TWIDESLASH, - TWIDEBACKSLASH, TLDBRACKET, TRDBRACKET, + TWIDEBACKSLASH, TLDBRACKET, TRDBRACKET, TMAPSTO, TUNKNOWN, TDEBUG }; diff -Nur --exclude CVS starmath.orig/inc/starmath.hrc starmath/inc/starmath.hrc --- starmath.orig/inc/starmath.hrc Sat Nov 9 00:21:35 2002 +++ starmath/inc/starmath.hrc Fri Nov 8 23:03:22 2002 @@ -267,6 +267,7 @@ #define RID_DLARROW (RID_APP_START + 1324) #define RID_DLRARROW (RID_APP_START + 1325) #define RID_DRARROW (RID_APP_START + 1326) +#define RID_XMAPSTOY (RID_APP_START + 1327) #define RID_XINY (RID_APP_START + 1401) #define RID_XNOTINY (RID_APP_START + 1402) @@ -709,6 +710,7 @@ #define HID_SMA_DOTSDOWN (HID_SMA_START + 240) #define HID_SMA_DOTSLOW (HID_SMA_START + 241) #define HID_SMA_DOTSVERT (HID_SMA_START + 242) +#define HID_SMA_XMAPSTOY (HID_SMA_START + 243) #define HID_SMA_SETN (HID_SMA2_START + 1) #define HID_SMA_SETZ (HID_SMA2_START + 2) diff -Nur --exclude CVS starmath.orig/inc/types.hxx starmath/inc/types.hxx --- starmath.orig/inc/types.hxx Sat Nov 9 00:21:36 2002 +++ starmath/inc/types.hxx Fri Nov 8 22:54:00 2002 @@ -215,7 +215,9 @@ MS_SETZ = (xub_Unicode) 0x2124, MS_SETQ = (xub_Unicode) 0x211A, MS_SETR = (xub_Unicode) 0x211D, - MS_SETC = (xub_Unicode) 0x2102 + MS_SETC = (xub_Unicode) 0x2102, + + MS_RIGHTWARDS_ARROW_FROM_BAR = (xub_Unicode) 0x21A6 }; diff -Nur --exclude CVS starmath.orig/source/commands.src starmath/source/commands.src --- starmath.orig/source/commands.src Sat Nov 9 00:21:37 2002 +++ starmath/source/commands.src Fri Nov 8 23:02:18 2002 @@ -106,6 +106,7 @@ String RID_XORTHOY { Text = "<?> ortho <?> " ; }; String RID_XPARALLELY { Text = "<?> parallel <?> " ; }; String RID_XTOWARDY { Text = "<?> toward <?> " ; }; +String RID_XMAPSTOY { Text = "<?> mapsTo <?> " ; }; String RID_XTRANSLY { Text = "<?> transl <?> " ; }; String RID_XTRANSRY { Text = "<?> transr <?> " ; }; String RID_XINY { Text = "<?> in <?> " ; }; @@ -553,6 +554,12 @@ Identifier = RID_XTOWARDY; HelpId = HID_SMA_XTOWARDY; Text = "a toward b"; + }; + MenuItem + { + Identifier = RID_XMAPSTOY; + HelpId = HID_SMA_XMAPSTOY; + Text = "a mapsTo b"; }; MenuItem { diff -Nur --exclude CVS starmath.orig/source/parse.cxx starmath/source/parse.cxx --- starmath.orig/source/parse.cxx Sat Nov 9 00:21:39 2002 +++ starmath/source/parse.cxx Fri Nov 8 22:57:42 2002 @@ -277,6 +277,7 @@ { "lsup", TLSUP, '\0', TGPOWER, 0}, { "lt", TLT, MS_LT, TGRELATION, 0}, { "magenta", TMAGENTA, '\0', TGCOLOR, 0}, + { "mapsto", TMAPSTO, MS_RIGHTWARDS_ARROW_FROM_BAR, TGRELATION, 0}, { "matrix", TMATRIX, '\0', 0, 5}, { "minusplus", TMINUSPLUS, MS_MINUSPLUS, TGUNOPER | TGSUM, 5}, { "mline", TMLINE, MS_LINE, 0, 0}, //! nicht in TGRBRACES, Level 0 @@ -1461,6 +1462,7 @@ case TPARTIAL : case TNABLA : case TTOWARD : + case TMAPSTO : case TDOTSAXIS : case TDOTSDIAG : case TDOTSDOWN : diff -Nur --exclude CVS starmath.orig/source/smres.src starmath/source/smres.src --- starmath.orig/source/smres.src Sat Nov 9 00:21:52 2002 +++ starmath/source/smres.src Fri Nov 8 23:25:40 2002 @@ -5712,8 +5712,18 @@ }; ToolBoxItem { + Identifier = RID_XMAPSTOY ; + HelpId = HID_SMA_XMAPSTOY ; + Text = "wird abgebildet auf" ; + Text [ ENGLISH ] = "maps to" ; + Text [ english_us ] = "Maps To" ; + }; + /* + ToolBoxItem + { Type = TOOLBOXITEM_SPACE ; }; + */ ToolBoxItem { Type = TOOLBOXITEM_BREAK ; @@ -10333,8 +10343,9 @@ RID_DLARROW ; \ RID_DLRARROW ; \ RID_DRARROW ; \ + RID_XMAPSTOY ; \ }; \ - IdCount ={ 21 ; }; + IdCount ={ 22 ; }; ImageList IL_BIOP {
Created attachment 3539 [details] The patch
The fix looks good. Though there is one big problem. The character 0x21A6 is unfortunately not in the StarSymbol font. Thus the fix won't help. I looked in tree different fonts and I didn't that character there. I's even not listed at www.unicode.org there three other mapsTo though. Unfortunately not even one of those is in the fonts I looked through. Thus there is currently only the workaround to define a new user- defined symbol (use "Tools/ Catalog" and press the "Edit" button). After that you can use the new symbol like "a %mapsTo b". As for the font I pass this bug on to the product management in order to have it inserted the next time we get an update for the font. TL->BH: Please make sure the missing character is added the next time we'll get a font update. (See also posting in the idea board.)
There is a "mapsTo" symbol in the "Arial MS Unicode" font. But it should be better to just create an appropriate glyph in the OpenSymbol font. Unfortunately, I've not been able to find it in CVS. Could you point me to the font (sources) and maybe to a font editor? :-) Then I'd do that change. Besides: Does font using work that way that?: If a given requested glyph is not found in a font, it is searched in other fonts available at the local system. If so, implementing the symbol without actually implementing the glyph would still be of use.
You may ask Ilko (ih@openoffice.org) about the fonts or font editors. Maybe he can help you. Your other question: The mechanics for glyphs is the same as for fonts. That is if the font is not found on the system a font matching mechanism takes place that maps the required font to a different available one (I don't know the details about that though). Usually, if a good match was found, everything is OK. If the match is bad the characters may look somewhat different or some characters are not even in the font. It is an idea for the future though that if a specific character is not available to look for that character again in yet another font.
Hello Ilko, as you are implementing the font, please take care of this issue. Thank you.
IH: I will include this symbol if we will have the same symbol in StarSymbol also.
IH: at this moment there is only little hope that we will see additions to StarSymbol - so we need to think about adding symbols to OpenSymbol that we not have in StarSymbol - but this would mean that we will have features in OpenOffice that we not have in StarOffice.
Another symbol that would be good to have is the 'prime' symbol 0x2032. If I'm correct this is a like a apostrophe in double size. But I'm not sure about the size issue. Also if we really like to support Math ML we should have all Math ML charcters in the font. BH should be asked about this. For Math ML in general and a list of Math ML characters have a look at: http://www.w3.org/Math and http://www.w3.org/TR/2002/WD-MathML2-20021219 Also for info about the characters you may have a look at http://www.w3.org/TR/2002/WD-MathML2-20021219/chapter6.html especially http://www.w3.org/TR/2002/WD-MathML2- 20021219/chapter6.html#chars.16x16-tables
IH: will not be implemented before OOo 2.0
IH: Unfortunately I will not have the time to create a font with this features (MathML standard needs to implement over 1000 new symbols) for OpenOffice, sorry.
IH: closed