]> git.lyx.org Git - features.git/commitdiff
Fix wrong space symbols (#8729)
authorGeorg Baum <baum@lyx.org>
Sun, 7 Jul 2013 08:02:16 +0000 (10:02 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 13 Jul 2013 20:43:31 +0000 (22:43 +0200)
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.

lib/unicodesymbols
src/insets/InsetSpace.cpp

index 820209c8686cc788e13dd2a11ed7a552e3d500c2..a0da34b60e23b09ff45b03800fd751598e3c90a0 100644 (file)
 #
 # 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
index 03c9367b9acaaca31edd5bb066ec454d93d6b2fa..ba8e877462b99c36b0e2661dbd397ed1c5da43e5 100644 (file)
@@ -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: