From 89b2c54c00e14144b39f88ffdf90e1f4b8473e53 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sun, 7 Jul 2013 10:02:16 +0200 Subject: [PATCH] Fix wrong space symbols (#8729) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 24 ++++++++++++------------ src/insets/InsetSpace.cpp | 6 +++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/unicodesymbols b/lib/unicodesymbols index 820209c868..a0da34b60e 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 03c9367b9a..ba8e877462 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: -- 2.39.2