diff --git a/uppsrc/RichText/ParaPaint.cpp b/uppsrc/RichText/ParaPaint.cpp index fb677d18d..08de54c15 100644 --- a/uppsrc/RichText/ParaPaint.cpp +++ b/uppsrc/RichText/ParaPaint.cpp @@ -50,6 +50,8 @@ void RichPara::Flush(Draw& draw, const PaintInfo& pi, wchar *text, draw.DrawRect(zx0, z * y, width, z * (y + linecy) - z * y, pi.coloroverride ? SColorPaper() : f.paper); Font fnt = f; + DDUMP(fnt.GetFaceName()); + DDUMP(fnt.GetCy()); int zht = z * tabs(f.GetHeight()); int ssa = 0; int ssd = 0; diff --git a/uppsrc/RichText/ParseQtf.cpp b/uppsrc/RichText/ParseQtf.cpp index f5b3c02a6..573258181 100644 --- a/uppsrc/RichText/ParseQtf.cpp +++ b/uppsrc/RichText/ParseQtf.cpp @@ -550,6 +550,22 @@ void RichQtfParser::Cat(int chr) extern bool s_nodeqtf[128]; +int GetRichTextScreenStdFontHeight() +{ + static int gh = 67; + ONCELOCK { + for(int i = 0; i < 1000; i++) { + int h = GetRichTextStdScreenZoom() * i; + LOG(i << ' ' << StdFont(h).GetCy()); + if(h > 0 && StdFont(h).GetCy() == StdFont().GetCy()) { + gh = i; + break; + } + } + } + return gh; +} + void RichQtfParser::Parse(const char *qtf, int _accesskey) { accesskey = _accesskey; @@ -661,6 +677,10 @@ void RichQtfParser::Parse(const char *qtf, int _accesskey) } break; } + case 'g': + format.Face(Font::STDFONT); + format.Height(GetRichTextScreenStdFontHeight()); + break; default: if(c >= '0' && c <= '9') { format.Height(QTFFontHeight[c - '0']); diff --git a/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp b/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp index 21a33c534..56dd47662 100644 --- a/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp +++ b/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp @@ -227,6 +227,8 @@ matching&] ::= [s0; Courier font.] ::^ [s0;%- [C@(128.0.255) G]] ::= [s0; Standard GUI font.] +::^ [s0;%- [C@(128.0.255) g]] +::= [s0; Standard GUI font with standard height.] ::^ [s0;%- [C@(128.0.255) S]] ::= [s0; Symbol font.] ::^ [s0;%- [C@(128.0.255) .][/C@(0.0.255) number]]