diff --git a/uppsrc/RichEdit/FormatDlg.cpp b/uppsrc/RichEdit/FormatDlg.cpp index 8328b84ad..ea736ee70 100644 --- a/uppsrc/RichEdit/FormatDlg.cpp +++ b/uppsrc/RichEdit/FormatDlg.cpp @@ -297,9 +297,10 @@ ParaFormatting::ParaFormatting() tabs.ColumnWidths("103 89 78"); tabs.Appending().Removing().NoAskRemove(); tabs.WhenAcceptEdit = tabs.WhenArrayAction = THISBACK(SetMod); - linespacing.Add(0, "1.0"); - linespacing.Add(-1, "1.5"); - linespacing.Add(-2, "2.0"); + linespacing.Add(RichPara::LSP10, "1.0"); + linespacing.Add(RichPara::LSP115, "1.15"); + linespacing.Add(RichPara::LSP15, "1.5"); + linespacing.Add(RichPara::LSP20, "2.0"); bullet.Add(RichPara::BULLET_NONE, RichEditImg::NoneBullet()); bullet.Add(RichPara::BULLET_ROUND, RichEditImg::RoundBullet()); bullet.Add(RichPara::BULLET_ROUNDWHITE, RichEditImg::RoundWhiteBullet()); diff --git a/uppsrc/RichText/EncodeHTML.cpp b/uppsrc/RichText/EncodeHTML.cpp index eecc6be20..e6faddb38 100644 --- a/uppsrc/RichText/EncodeHTML.cpp +++ b/uppsrc/RichText/EncodeHTML.cpp @@ -94,7 +94,9 @@ String HtmlParaStyle(const RichPara::Format& f, Zoom z) if(!IsNull(f.paper)) style << HtmlStyleColor(f.paper, "background-color"); style << decode(f.linespacing, RichPara::LSP15, "line-height:150%", - RichPara::LSP20, "line-height:200%", ""); + RichPara::LSP20, "line-height:200%", + RichPara::LSP115, "line-height:115%", + ""); return style; } diff --git a/uppsrc/RichText/EncodeQtf.cpp b/uppsrc/RichText/EncodeQtf.cpp index 43848961b..fbd7ffbb3 100644 --- a/uppsrc/RichText/EncodeQtf.cpp +++ b/uppsrc/RichText/EncodeQtf.cpp @@ -111,6 +111,7 @@ void QTFEncodeParaFormat(String& qtf, const RichPara::Format& format, const Rich qtf << 'Q'; if(style.linespacing != format.linespacing) switch(format.linespacing) { + case RichPara::LSP115: qtf << "pw"; break; case RichPara::LSP15: qtf << "ph"; break; case RichPara::LSP20: qtf << "pd"; break; default: qtf << "po"; break; diff --git a/uppsrc/RichText/Para.h b/uppsrc/RichText/Para.h index 3679d5187..eb5832a1d 100644 --- a/uppsrc/RichText/Para.h +++ b/uppsrc/RichText/Para.h @@ -71,6 +71,7 @@ struct RichPara { LSP10 = 0, LSP15 = -1, LSP20 = -2, + LSP115 = -3, }; enum TabSpecial { diff --git a/uppsrc/RichText/ParaType.cpp b/uppsrc/RichText/ParaType.cpp index ba3c1dfc7..45db631fa 100644 --- a/uppsrc/RichText/ParaType.cpp +++ b/uppsrc/RichText/ParaType.cpp @@ -12,6 +12,10 @@ void RichPara::Smh(Lines& lines, HeightInfo *th, int cx) const if(h->descent > l.descent) l.descent = h->descent; if(h->external > l.external) l.external = h->external; } + if(format.linespacing == LSP115) { + l.ascent = 115 * l.ascent / 100; + l.descent = 115 * l.descent / 100; + } if(format.linespacing == LSP15) { l.ascent = (3 * l.ascent) >> 1; l.descent = (3 * l.descent) >> 1; diff --git a/uppsrc/RichText/ParseQtf.cpp b/uppsrc/RichText/ParseQtf.cpp index 0f125e9ec..866144131 100644 --- a/uppsrc/RichText/ParseQtf.cpp +++ b/uppsrc/RichText/ParseQtf.cpp @@ -778,6 +778,7 @@ void RichQtfParser::Parse(const char *qtf, int _accesskey) case 0: Error("Unexpected end of text"); case 'h': format.linespacing = RichPara::LSP15; break; case 'd': format.linespacing = RichPara::LSP20; break; + case 'w': format.linespacing = RichPara::LSP115; break; default: format.linespacing = RichPara::LSP10; } break; diff --git a/uppsrc/RichText/srcdoc.tpp/QTF_en-us.tpp b/uppsrc/RichText/srcdoc.tpp/QTF_en-us.tpp index 955009dbf..39f4ca945 100644 --- a/uppsrc/RichText/srcdoc.tpp/QTF_en-us.tpp +++ b/uppsrc/RichText/srcdoc.tpp/QTF_en-us.tpp @@ -324,7 +324,9 @@ optimization, [*@(128.0.255) %`-] is equivalent to [@(128.0.255) %][@(0.0.255) 0 ::^ [s0;%- [C@(128.0.255) i][/C@(0.0.255) number]] ::= [s0; Indent in dots.] ::^ [s0;%- [C@(128.0.255) pn]] -::= [s0; Line spacing 1.0.] +::= [s0; Line spacing 1.0 (default).] +::^ [s0;%- [C@(128.0.255) pw]] +::= [s0; Line spacing 1.15.] ::^ [s0;%- [C@(128.0.255) ph]] ::= [s0; Line spacing 1.5.] ::^ [s0;%- [C@(128.0.255) pd]]