commit 1ea1f85e77b5163db6704fb8b404d6b86832c8e8
Author: Georg Baum <[email protected]>
Date: Sun Jul 7 10:02:16 2013 +0200
Fix wrong space symbols (#8729)
The main part of the fix (unicodesymbols) is from Jürgen. This commit fixes
tree problems:
- \; etc. were also used in text mode, but are math only
- all of those glyphs need to be forced with utf8
- actually, \; etc. are not the correct macros, since the encoded spaces are
breakable, but the math spaces are all protected. The sapce symbols are
not
defined in the utf8 encodings.
diff --git a/lib/unicodesymbols b/lib/unicodesymbols
index 820209c..a0da34b 100644
--- a/lib/unicodesymbols
+++ b/lib/unicodesymbols
@@ -1598,18 +1598,18 @@
#
# general punctuation
#
-0x2000 "\\enskip" "" "" "\\enskip" "" # EN QUAD
-0x2001 "\\quad" "" "" "\\quad" "" # EM QUAD
-0x2002 "\\enskip" "" "" "\\enskip" "" # EN SPACE
-0x2003 "\\quad" "" "" "\\quad" "" # EM SPACE
-0x2004 "\\;" "" "notermination=both" "\\;" "" #
THREE-PER-EM SPACE
-0x2005 "\\:" "" "notermination=both" "\\:" "" #
FOUR-PER-EM SPACE
-0x2006 "\\," "" "notermination=both" "\\," "" #
SIX-PER-EM SPACE
-0x2007 "\\LyXFigureSpace" "\\newcommand*\\LyXFigureSpace{\\hphantom{0}}" ""
"\\LyXFigureSpace" "\\newcommand*\\LyXFigureSpace{\\hphantom{0}}" # FIGURE SPACE
-0x2008 "\\LyXPunctSpace" "\\newcommand*\\LyXPunctSpace{\\hphantom{,}}" ""
"\\LyXPunctSpace" "\\newcommand*\\LyXPunctSpace{\\hphantom{,}}" # PUNCTUATION
SPACE
-0x2009 "\\LyXThinSpace" "\\newcommand*\\LyXThinSpace{\\,\\hspace{0pt}}" ""
"\\LyXThinSpace" "\\newcommand*\\LyXThinSpace{\\,\\hspace{0pt}}" # THIN SPACE
-0x200a "\\LyXHairSpace" "\\newcommand*\\LyXHairSpace{\\hspace{1pt}}" ""
"\\LyXHairSpace" "\\newcommand*\\LyXHairSpace{\\hspace{1pt}}" # HAIR SPACE
-0x200b "\\LyXZeroWidthSpace" "\\newcommand*\\LyXZeroWidthSpace{\\hspace{0pt}}"
"" "\\LyXZeroWidthSpace" "\\newcommand*\\LyXZeroWidthSpace{\\hspace{0pt}}" #
ZERO WIDTH SPACE
+0x2000 "\\enskip" "" "force=utf8" "\\enskip" "" # EN QUAD
+0x2001 "\\quad" "" "force=utf8" "\\quad" "" # EM QUAD
+0x2002 "\\enskip" "" "force=utf8" "\\enskip" "" # EN SPACE
+0x2003 "\\quad" "" "force=utf8" "\\quad" "" # EM SPACE
+0x2004 "\\LyXThreePerEmSpace"
"\\newcommand*{\\LyXThreePerEmSpace}{\hskip0.3333em\relax}" "force=utf8"
"\\LyXThreePerEmSpace"
"\\newcommand*{\\LyXThreePerEmSpace}{\hskip0.3333em\relax}" # THREE-PER-EM SPACE
+0x2005 "\\LyXFourPerEmSpace"
"\\newcommand*{\\LyXFourPerEmSpace}{\hskip0.25em\relax}" "force=utf8"
"\\LyXFourPerEmSpace" "\\newcommand*{\\LyXFourPerEmSpace}{\hskip0.25em\relax}"
# FOUR-PER-EM SPACE
+0x2006 "\\LyXSixPerEmSpace"
"\\newcommand*{\\LyXSixPerEmSpace}{\hskip0.16667em\relax}" "force=utf8"
"\\LyXSixPerEmSpace" "\\newcommand*{\\LyXSixPerEmSpace}{\hskip0.16667em\relax}"
# SIX-PER-EM SPACE
+0x2007 "\\LyXFigureSpace" "\\newcommand*\\LyXFigureSpace{\\hphantom{0}}"
"force=utf8" "\\LyXFigureSpace" "\\newcommand*\\LyXFigureSpace{\\hphantom{0}}"
# FIGURE SPACE
+0x2008 "\\LyXPunctSpace" "\\newcommand*\\LyXPunctSpace{\\hphantom{,}}"
"force=utf8" "\\LyXPunctSpace" "\\newcommand*\\LyXPunctSpace{\\hphantom{,}}" #
PUNCTUATION SPACE
+0x2009 "\\LyXThinSpace" "\\newcommand*\\LyXThinSpace{\\,\\hspace{0pt}}"
"force=utf8" "\\LyXThinSpace" "\\newcommand*\\LyXThinSpace{\\,\\hspace{0pt}}" #
THIN SPACE
+0x200a "\\LyXHairSpace" "\\newcommand*\\LyXHairSpace{\\hspace{1pt}}"
"force=utf8" "\\LyXHairSpace" "\\newcommand*\\LyXHairSpace{\\hspace{1pt}}" #
HAIR SPACE
+0x200b "\\LyXZeroWidthSpace" "\\newcommand*\\LyXZeroWidthSpace{\\hspace{0pt}}"
"force=utf8" "\\LyXZeroWidthSpace"
"\\newcommand*\\LyXZeroWidthSpace{\\hspace{0pt}}" # ZERO WIDTH SPACE
0x200c "\\textcompwordmark" "" "" "" "" # ZERO WIDTH NON-JOINER
#0x200d "" "" "" "" "" # ZERO WIDTH JOINER
#0x200e "" "" "" "" "" # LEFT-TO-RIGHT MARK
diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp
index 03c9367..ba8e877 100644
--- a/src/insets/InsetSpace.cpp
+++ b/src/insets/InsetSpace.cpp
@@ -666,13 +666,17 @@ int InsetSpace::plaintext(odocstringstream & os,
os.put(0x2003);
return 2;
case InsetSpaceParams::THIN:
- os.put(0x2009);
+ os.put(0x202f);
return 1;
case InsetSpaceParams::MEDIUM:
+ os.put(0x200b); // ZERO WIDTH SPACE, makes the unbreakable
medium space breakable
os.put(0x2005);
+ os.put(0x200b); // ZERO WIDTH SPACE, makes the unbreakable
medium space breakable
return 1;
case InsetSpaceParams::THICK:
+ os.put(0x200b); // ZERO WIDTH SPACE, makes the unbreakable
thick space breakable
os.put(0x2004);
+ os.put(0x200b); // ZERO WIDTH SPACE, makes the unbreakable
thick space breakable
return 1;
case InsetSpaceParams::PROTECTED:
case InsetSpaceParams::CUSTOM_PROTECTED: