summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Wang <fred.wang@free.fr>2013-07-01 21:14:53 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-07-02 07:40:30 +0000
commitbe4837c9da190b4450a7f8a46ee5b9808e5dd941 (patch)
tree2ab6906c01d10197e43ff5600039be1867f27fe9
parentfbc9c18875d1e86c9b3d7d5c13e1db13af23e3f0 (diff)
fdo#66416 - Use appropriate unicode characters for math "Brackets"
Change-Id: I43d74c92f0de65f9456f5cd8ae150466b6a43717 Reviewed-on: https://gerrit.libreoffice.org/4661 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--extras/source/truetype/symbol/OpenSymbol.sfd45
-rw-r--r--extras/source/truetype/symbol/opens___.ttfbin203292 -> 203420 bytes
-rw-r--r--starmath/inc/types.hxx4
-rw-r--r--starmath/source/cursor.cxx12
-rw-r--r--starmath/source/mathtype.cxx6
-rw-r--r--starmath/source/node.cxx6
-rw-r--r--starmath/source/ooxmlimport.cxx8
-rw-r--r--starmath/source/parse.cxx18
8 files changed, 72 insertions, 27 deletions
diff --git a/extras/source/truetype/symbol/OpenSymbol.sfd b/extras/source/truetype/symbol/OpenSymbol.sfd
index 3031e04e7192..6a7991c6ae29 100644
--- a/extras/source/truetype/symbol/OpenSymbol.sfd
+++ b/extras/source/truetype/symbol/OpenSymbol.sfd
@@ -4,7 +4,7 @@ FullName: OpenSymbol
FamilyName: OpenSymbol
Weight: Book
Copyright: (c) 2009 Sun Microsystems Inc.\nTHERE DOES NOT EXIST (c) 2011 Julien Nabet\nPRECEDES <-> DOES NOT SUCCEED (c) 2011 Olivier Hallot\nPRIME <-> TRIPLE PRIME (c) 2013 Mathias Hasselmann
-Version: 102.4
+Version: 102.5
ItalicAngle: 0
UnderlinePosition: -143
UnderlineWidth: 20
@@ -19,7 +19,7 @@ OS2Version: 0
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
CreationTime: 1144938807
-ModificationTime: 1372588273
+ModificationTime: 1372703526
PfmFamily: 81
TTFWeight: 400
TTFWidth: 5
@@ -773,7 +773,7 @@ ShortTable: maxp 16
0
0
EndShort
-LangName: 1033 "" "" "Regular" "OpenSymbol" "" "Version 102.4"
+LangName: 1033 "" "" "Regular" "OpenSymbol" "" "Version 102.5"
GaspTable: 1 65535 2 0
Encoding: Custom
UnicodeInterp: none
@@ -784,7 +784,7 @@ FitToEm: 1
WinInfo: 675 45 15
BeginPrivate: 0
EndPrivate
-BeginChars: 8834 1007
+BeginChars: 8834 1009
StartChar: Alpha
Encoding: 909 913 0
@@ -107741,5 +107741,42 @@ SplineSet
102 1407 l 1,0,-1
EndSplineSet
EndChar
+
+StartChar: verticalline
+Encoding: 996 124 1007
+Width: 813
+Flags: W
+VStem: 358 99<-440 1620>
+LayerCount: 2
+Fore
+SplineSet
+358 -440 m 1,0,-1
+ 358 1620 l 1,1,-1
+ 457 1620 l 1,2,-1
+ 457 -440 l 1,3,-1
+ 358 -440 l 1,0,-1
+EndSplineSet
+EndChar
+
+StartChar: doubleverticalline
+Encoding: 997 8214 1008
+Width: 1183
+Flags: W
+VStem: 334 98<-430 1620> 752 98<-430 1620>
+LayerCount: 2
+Fore
+SplineSet
+334 -430 m 1,0,-1
+ 334 1620 l 1,1,-1
+ 432 1620 l 1,2,-1
+ 432 -430 l 1,3,-1
+ 334 -430 l 1,0,-1
+752 -430 m 1,4,-1
+ 752 1620 l 1,5,-1
+ 850 1620 l 1,6,-1
+ 850 -430 l 1,7,-1
+ 752 -430 l 1,4,-1
+EndSplineSet
+EndChar
EndChars
EndSplineFont
diff --git a/extras/source/truetype/symbol/opens___.ttf b/extras/source/truetype/symbol/opens___.ttf
index f9e18cacf253..5fc1649e086d 100644
--- a/extras/source/truetype/symbol/opens___.ttf
+++ b/extras/source/truetype/symbol/opens___.ttf
Binary files differ
diff --git a/starmath/inc/types.hxx b/starmath/inc/types.hxx
index de027b6fd17c..7ef060e547fe 100644
--- a/starmath/inc/types.hxx
+++ b/starmath/inc/types.hxx
@@ -112,7 +112,9 @@ enum MathSymbol
MS_WP = (sal_Unicode) 0x2118,
MS_LINE = (sal_Unicode) 0x2223,
+ MS_VERTLINE = (sal_Unicode) 0x007C,
MS_DLINE = (sal_Unicode) 0x2225,
+ MS_DVERTLINE = (sal_Unicode) 0x2016,
MS_ORTHO = (sal_Unicode) 0x22A5,
MS_DOTSLOW = (sal_Unicode) 0x2026,
MS_DOTSAXIS = (sal_Unicode) 0x22EF,
@@ -176,6 +178,8 @@ enum MathSymbol
MS_RANGLE = (sal_Unicode) 0x232A,
MS_LDBRACKET = (sal_Unicode) 0x27E6,
MS_RDBRACKET = (sal_Unicode) 0x27E7,
+ MS_LMATHANGLE = (sal_Unicode) 0x27E8,
+ MS_RMATHANGLE = (sal_Unicode) 0x27E9,
MS_PLACE = (sal_Unicode) 0x2751,
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index cb63ef4d89ec..002e5fe1cf25 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -733,16 +733,16 @@ SmNode *SmCursor::CreateBracket(SmBracketType eBracketType, bool bIsLeft) {
aTok = SmToken(TLDBRACKET, MS_LDBRACKET, "ldbracket", TGLBRACES, 5);
break;
case LineBrackets:
- aTok = SmToken(TLLINE, MS_LINE, "lline", TGLBRACES, 5);
+ aTok = SmToken(TLLINE, MS_VERTLINE, "lline", TGLBRACES, 5);
break;
case DoubleLineBrackets:
- aTok = SmToken(TLDLINE, MS_DLINE, "ldline", TGLBRACES, 5);
+ aTok = SmToken(TLDLINE, MS_DVERTLINE, "ldline", TGLBRACES, 5);
break;
case CurlyBrackets:
aTok = SmToken(TLBRACE, MS_LBRACE, "lbrace", TGLBRACES, 5);
break;
case AngleBrackets:
- aTok = SmToken(TLANGLE, MS_LANGLE, "langle", TGLBRACES, 5);
+ aTok = SmToken(TLANGLE, MS_LMATHANGLE, "langle", TGLBRACES, 5);
break;
case CeilBrackets:
aTok = SmToken(TLCEIL, MS_LCEIL, "lceil", TGLBRACES, 5);
@@ -766,16 +766,16 @@ SmNode *SmCursor::CreateBracket(SmBracketType eBracketType, bool bIsLeft) {
aTok = SmToken(TRDBRACKET, MS_RDBRACKET, "rdbracket", TGRBRACES, 5);
break;
case LineBrackets:
- aTok = SmToken(TRLINE, MS_LINE, "rline", TGRBRACES, 5);
+ aTok = SmToken(TRLINE, MS_VERTLINE, "rline", TGRBRACES, 5);
break;
case DoubleLineBrackets:
- aTok = SmToken(TRDLINE, MS_DLINE, "rdline", TGRBRACES, 5);
+ aTok = SmToken(TRDLINE, MS_DVERTLINE, "rdline", TGRBRACES, 5);
break;
case CurlyBrackets:
aTok = SmToken(TRBRACE, MS_RBRACE, "rbrace", TGRBRACES, 5);
break;
case AngleBrackets:
- aTok = SmToken(TRANGLE, MS_RANGLE, "rangle", TGRBRACES, 5);
+ aTok = SmToken(TRANGLE, MS_RMATHANGLE, "rangle", TGRBRACES, 5);
break;
case CeilBrackets:
aTok = SmToken(TRCEIL, MS_RCEIL, "rceil", TGRBRACES, 5);
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index 3de5817b5885..b910a41daa10 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -463,10 +463,12 @@ sal_Bool MathType::LookupChar(sal_Unicode nChar,String &rRet,sal_uInt8 nVersion,
case 0x22f1:
pC = " dotsdown ";
break;
- case 0x2329:
+ case MS_LANGLE:
+ case MS_LMATHANGLE:
pC = " langle ";
break;
- case 0x232a:
+ case MS_RANGLE:
+ case MS_RMATHANGLE:
pC = " rangle ";
break;
case 0x301a:
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 6f9c63fec077..e69ed2c1cb35 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -1744,11 +1744,13 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
aTmpSize.Width() /= 267;
sal_Unicode cChar = pLeft->GetToken().cMathChar;
- if (cChar != MS_LINE && cChar != MS_DLINE)
+ if (cChar != MS_LINE && cChar != MS_DLINE &&
+ cChar != MS_VERTLINE && cChar != MS_DVERTLINE)
pLeft ->GetFont().SetSize(aTmpSize);
cChar = pRight->GetToken().cMathChar;
- if (cChar != MS_LINE && cChar != MS_DLINE)
+ if (cChar != MS_LINE && cChar != MS_DLINE &&
+ cChar != MS_VERTLINE && cChar != MS_DVERTLINE)
pRight->GetFont().SetSize(aTmpSize);
pLeft ->AdaptToY(rDev, nBraceHeight);
diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx
index c47b14e09c74..10c3d3b15e99 100644
--- a/starmath/source/ooxmlimport.cxx
+++ b/starmath/source/ooxmlimport.cxx
@@ -319,13 +319,13 @@ OUString SmOoxmlImport::handleD()
opening = "left lline ";
if( closing == "|" )
closing = " right rline";
- if( opening == OUString( sal_Unicode( 0x2225 )))
+ if (opening == OUString(MS_DLINE) || opening == OUString(MS_DVERTLINE))
opening = "left ldline ";
- if( closing == OUString( sal_Unicode( 0x2225 )))
+ if (closing == OUString(MS_DLINE) || closing == OUString(MS_DVERTLINE))
closing = " right rdline";
- if( opening == OUString( sal_Unicode( 0x2329 )))
+ if (opening == OUString(MS_LANGLE) || opening == OUString(MS_LMATHANGLE))
opening = "left langle ";
- if( closing == OUString( sal_Unicode( 0x232a )))
+ if (closing == OUString(MS_RANGLE) || closing == OUString(MS_RMATHANGLE))
closing = " right rangle";
// use scalable brackets (the explicit "left" or "right")
if( opening == "(" || opening == "[" )
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 4477d1006516..59294475704e 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -172,11 +172,11 @@ static const SmTokenTableEntry aTokenTable[] =
{ "ital", TITALIC, '\0', TGFONTATTR, 5},
{ "italic", TITALIC, '\0', TGFONTATTR, 5},
{ "lambdabar" , TLAMBDABAR, MS_LAMBDABAR, TGSTANDALONE, 5},
- { "langle", TLANGLE, MS_LANGLE, TGLBRACES, 5},
+ { "langle", TLANGLE, MS_LMATHANGLE, TGLBRACES, 5},
{ "lbrace", TLBRACE, MS_LBRACE, TGLBRACES, 5},
{ "lceil", TLCEIL, MS_LCEIL, TGLBRACES, 5},
{ "ldbracket", TLDBRACKET, MS_LDBRACKET, TGLBRACES, 5},
- { "ldline", TLDLINE, MS_DLINE, TGLBRACES, 5},
+ { "ldline", TLDLINE, MS_DVERTLINE, TGLBRACES, 5},
{ "le", TLE, MS_LE, TGRELATION, 0},
{ "left", TLEFT, '\0', 0, 5},
{ "leftarrow" , TLEFTARROW, MS_LEFTARROW, TGSTANDALONE, 5},
@@ -187,7 +187,7 @@ static const SmTokenTableEntry aTokenTable[] =
{ "limsup", TLIMSUP, '\0', TGOPER, 5},
{ "lint", TLINT, MS_LINT, TGOPER, 5},
{ "ll", TLL, MS_LL, TGRELATION, 0},
- { "lline", TLLINE, MS_LINE, TGLBRACES, 5},
+ { "lline", TLLINE, MS_VERTLINE, TGLBRACES, 5},
{ "llint", TLLINT, MS_LLINT, TGOPER, 5},
{ "lllint", TLLLINT, MS_LLLINT, TGOPER, 5},
{ "ln", TLN, '\0', TGFUNCTION, 5},
@@ -198,7 +198,7 @@ static const SmTokenTableEntry aTokenTable[] =
{ "magenta", TMAGENTA, '\0', TGCOLOR, 0},
{ "matrix", TMATRIX, '\0', 0, 5},
{ "minusplus", TMINUSPLUS, MS_MINUSPLUS, TGUNOPER | TGSUM, 5},
- { "mline", TMLINE, MS_LINE, 0, 0}, //! nicht in TGRBRACES, Level 0
+ { "mline", TMLINE, MS_VERTLINE, 0, 0}, //! not in TGRBRACES, Level 0
{ "nabla", TNABLA, MS_NABLA, TGSTANDALONE, 5},
{ "nbold", TNBOLD, '\0', TGFONTATTR, 5},
{ "ndivides", TNDIVIDES, MS_NDIVIDES, TGRELATION, 0},
@@ -238,16 +238,16 @@ static const SmTokenTableEntry aTokenTable[] =
{ "nprec", TNOTPRECEDES, MS_NOTPRECEDES, TGRELATION, 0 },
{ "prod", TPROD, MS_PROD, TGOPER, 5},
{ "prop", TPROP, MS_PROP, TGRELATION, 0},
- { "rangle", TRANGLE, MS_RANGLE, TGRBRACES, 0}, //! 0 to terminate expression
+ { "rangle", TRANGLE, MS_RMATHANGLE, TGRBRACES, 0}, //! 0 to terminate expression
{ "rbrace", TRBRACE, MS_RBRACE, TGRBRACES, 0}, //
{ "rceil", TRCEIL, MS_RCEIL, TGRBRACES, 0}, //
{ "rdbracket", TRDBRACKET, MS_RDBRACKET, TGRBRACES, 0}, //
- { "rdline", TRDLINE, MS_DLINE, TGRBRACES, 0}, //
+ { "rdline", TRDLINE, MS_DVERTLINE, TGRBRACES, 0}, //
{ "red", TRED, '\0', TGCOLOR, 0},
{ "rfloor", TRFLOOR, MS_RFLOOR, TGRBRACES, 0}, //! 0 to terminate expression
{ "right", TRIGHT, '\0', 0, 0},
{ "rightarrow" , TRIGHTARROW, MS_RIGHTARROW, TGSTANDALONE, 5},
- { "rline", TRLINE, MS_LINE, TGRBRACES, 0}, //! 0 to terminate expression
+ { "rline", TRLINE, MS_VERTLINE, TGRBRACES, 0}, //! 0 to terminate expression
{ "rsub", TRSUB, '\0', TGPOWER, 0},
{ "rsup", TRSUP, '\0', TGPOWER, 0},
{ "sans", TSANS, '\0', TGFONT, 0},
@@ -1805,10 +1805,10 @@ void SmParser::UnOper()
// we'll use row & column of the keyword for abs
aNodeToken.eType = TABS;
//
- aNodeToken.cMathChar = MS_LINE;
+ aNodeToken.cMathChar = MS_VERTLINE;
SmNode* pLeft = new SmMathSymbolNode(aNodeToken);
//
- aNodeToken.cMathChar = MS_LINE;
+ aNodeToken.cMathChar = MS_VERTLINE;
SmNode* pRight = new SmMathSymbolNode(aNodeToken);
pSNode->SetSubNodes(pLeft, pArg, pRight);