]> git.lyx.org Git - features.git/commitdiff
more work on spaces
authorGeorg Baum <georg.baum@post.rwth-aachen.de>
Mon, 17 Oct 2011 18:54:13 +0000 (18:54 +0000)
committerGeorg Baum <georg.baum@post.rwth-aachen.de>
Mon, 17 Oct 2011 18:54:13 +0000 (18:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39876 a592a061-630c-0410-9148-cb99ea01b6c8

lib/unicodesymbols
src/insets/InsetSpace.cpp

index ee23af21d8e141b7c8d96f876798d8be52ce7954..c1fae26bb2f19d11a8fc99a7c0922b2d974f8b9b 100644 (file)
 #
 # general punctuation
 #
-0x2010 "-"                        "" "" # HYPHEN # identic in LaTeX to FIGURE DASH
+0x2000 "\\enskip"                 "" "" "\\enskip" "" # EN QUAD
+0x2001 "\\quad"                   "" "" "\\quad" "" # EM QUAD
+0x2002 "\\enskip"                 "" "" "\\enskip" "" # EN SPACE
+0x2003 "\\quad"                   "" "" "\\quad" "" # EM SPACE
+0x2004 "\\;"                      "" "" "\\;" "" # THREE-PER-EM SPACE
+0x2005 "\\:"                      "" "" "\\:" "" # FOUR-PER-EM SPACE
+0x2006 "\\,"                      "" "" "\\," "" # SIX-PER-EM SPACE
+#0x2007 ""                         "" "" "" "" # FIGURE SPACE
+#0x2008 ""                         "" "" "" "" # PUNCTUATION SPACE
+0x2009 "\\,"                      "" "" "\\," "" # THIN SPACE
+#0x200a ""                         "" "" "" "" # HAIR SPACE
+#0x200b ""                         "" "" "" "" # ZERO WIDTH SPACE
+#0x200c ""                         "" "" "" "" # ZERO WIDTH NON-JOINER
+#0x200d ""                         "" "" "" "" # ZERO WIDTH JOINER
+#0x200e ""                         "" "" "" "" # LEFT-TO-RIGHT MARK
+#0x200f ""                         "" "" "" "" # RIGHT-TO-LEFT MARK
+0x2010 "-"                        "" "" "" "" # HYPHEN # identic in LaTeX to FIGURE DASH
+#0x2011 ""                         "" "" "" "" # NON-BREAKING HYPHEN
 0x2012 "-"                        "" "" # FIGURE DASH
 0x2013 "\\textendash"             "" "" # EN DASH
 0x2014 "\\textemdash"             "" "" # EM DASH
 0x205d "\\vdots"                  "" "" # TRICOLON # ≈ VERTICAL ELLIPSIS
 #0x205e ""                         "" "" "" "" # VERTICAL FOUR DOTS
 0x205f ""                         "" "" "\\:" "" # MEDIUM MATHEMATICAL SPACE
+#0x2060 ""                         "" "" "" "" # WORD JOINER
 0x2070 "\\textsuperscript{0}"     "" "" "{{}^0}" "" # SUPERSCRIPT ZERO
 0x2071 "\\textsuperscript{i}"     "" "" "{{}^i}" "" # SUPERSCRIPT LATIN SMALL LETTER I
 0x2074 "\\textsuperscript{4}"     "" "" "{{}^4}" "" # SUPERSCRIPT FOUR
index c516b137ee8cb0ab312631de53f326e74e5e7317..081b98c44cf35e3ce898b7930cc9cb1cc6264111 100644 (file)
@@ -646,9 +646,17 @@ int InsetSpace::plaintext(odocstream & os, OutputParams const &) const
        case InsetSpaceParams::DOWNBRACEFILL:
                os << "/-^-\\";
                return 5;
+       case InsetSpaceParams::VISIBLE:
+               os.put(0x2423);
+               return 1;
        case InsetSpaceParams::ENSKIP:
                os.put(0x2002);
                return 1;
+       case InsetSpaceParams::ENSPACE:
+               os.put(0x2060); // WORD JOINER, makes the breakable en space unbreakable
+               os.put(0x2002);
+               os.put(0x2060); // WORD JOINER, makes the breakable en space unbreakable
+               return 3;
        case InsetSpaceParams::QUAD:
                os.put(0x2003);
                return 1;
@@ -738,20 +746,27 @@ docstring InsetSpace::xhtml(XHTMLStream & xs, OutputParams const &) const
                output = " ";
                break;
        case InsetSpaceParams::ENSKIP:
-       case InsetSpaceParams::ENSPACE:
                output ="&ensp;";
                break;
+       case InsetSpaceParams::ENSPACE:
+               output ="&#x2060;&ensp;&#x2060;";
+               break;
        case InsetSpaceParams::QQUAD:
-               output ="&emsp;";
+               output ="&emsp;&emsp;";
+               break;
        case InsetSpaceParams::THICK:
+               output ="&#x2004;";
+               break;
        case InsetSpaceParams::QUAD:
                output ="&emsp;";
                break;
+       case InsetSpaceParams::MEDIUM:
+               output ="&#x2005;";
+               break;
        case InsetSpaceParams::THIN:
                output ="&thinsp;";
                break;
        case InsetSpaceParams::PROTECTED:
-       case InsetSpaceParams::MEDIUM:
        case InsetSpaceParams::NEGTHIN:
        case InsetSpaceParams::NEGMEDIUM:
        case InsetSpaceParams::NEGTHICK:
@@ -773,9 +788,13 @@ docstring InsetSpace::xhtml(XHTMLStream & xs, OutputParams const &) const
                // Can we do anything with those in HTML?
                break;
        case InsetSpaceParams::CUSTOM:
+               // FIXME XHTML
+               // Probably we could do some sort of blank span?
+               break;
        case InsetSpaceParams::CUSTOM_PROTECTED:
                // FIXME XHTML
                // Probably we could do some sort of blank span?
+               output ="&nbsp;";
                break;
        }
        // don't escape the entities!