procedure DrawParaMark(DrawItemNo: Integer; After: Boolean);
var BiDiMode: TRVBiDiMode;
Left, Top: Integer;
s: TRVRawByteString;
sz: TSize;
ditem: TRVDrawLineInfo;
ParaBreak: Boolean;
begin
if After then begin
if (DrawItemNo+1<DrawItems.Count) and
((DrawItems[DrawItemNo].ItemNo=DrawItems[DrawItemNo+1].ItemNo) or
not IsFromNewLineEx(DrawItems[DrawItemNo+1].ItemNo)) then
exit
end
else begin
if ((DrawItemNo>0) and (DrawItems[DrawItemNo].ItemNo=DrawItems[DrawItemNo-1].ItemNo)) or
not IsFromNewLineEx(DrawItems[DrawItemNo].ItemNo) then
exit;
end;
ditem := DrawItems[DrawItemNo];
if LastDrawnStyle<0 then
if GetItemStyle(DrawItems[DrawItemNo].ItemNo)>0 then
LastDrawnStyle := GetItemStyle(DrawItems[DrawItemNo].ItemNo)
else
LastDrawnStyle := 0;
BiDiMode := GetParaBiDiMode(GetItemParaEx(ditem.ItemNo));
RVStyle.ApplyStyle(Canvas, LastDrawnStyle, BiDiMode, True, nil, False,
False);
if RVStyle.TextBackgroundKind<>rvtbkSimple then begin
RVStyle.ApplyStyleTextColor(Canvas, LastDrawnStyle, [], False, rvcmColor);
Canvas.Brush.Style := bsClear;
end
else
RVStyle.ApplyStyleColor(Canvas, LastDrawnStyle, [], False, rvcmColor);
if FormatCanvas<>Canvas then
LastDrawnStyle := -1;
if RVStyle.SpecialCharactersColor<>clNone then
Canvas.Font.Color := RVStyle.SpecialCharactersColor;
if {$IFDEF RICHVIEWCBDEF3}(Canvas.Font.Charset=SYMBOL_CHARSET) or{$ENDIF}
(AnsiCompareText(Canvas.Font.Name, RVFONT_SYMBOL)=0) or
(AnsiCompareText(Canvas.Font.Name, RVFONT_WINGDINGS)=0) then begin
LastDrawnStyle := -1;
Canvas.Font.Name := 'Arial';
{$IFDEF RICHVIEWCBDEF3}
Canvas.Font.CHARSET := DEFAULT_CHARSET;
{$ENDIF}
end;
if After then
ParaBreak := (DrawItemNo+1=DrawItems.Count) or IsParaStartEx(DrawItems[DrawItemNo+1].ItemNo)
else
ParaBreak := IsParaStartEx(DrawItems[DrawItemNo].ItemNo);
if ParaBreak and (RVParagraphMarks=rvpmStandard) then
s := #$B6
else begin
{$IFDEF RICHVIEWCBDEF3}
Canvas.Font.Charset := SYMBOL_CHARSET;
{$ENDIF}
Canvas.Font.Name := RVFONT_SYMBOL;
if ParaBreak or (RVParagraphMarks=rvpmStandard) then
s := #$BF
else
s := #$AF;
{
Canvas.Font.Name := RVFONT_WINGDINGS;
s := #$C3;
}
LastDrawnStyle := -1;
end;
RVStyle.GraphicInterface.GetTextExtentPoint32_A(Canvas,
PRVAnsiChar(s), 1, sz);
if (After and (BiDiMode<>rvbdRightToLeft)) or
(not After and (BiDiMode=rvbdRightToLeft)) then
Left := ditem.Left+ditem.Width
else
Left := ditem.Left-sz.cx;
dec(Left, xshift);
Top := ditem.Top+ditem.Height-yshift-sz.cy;
RVStyle.GraphicInterface.TextOut_A(Canvas, Left, Top, PRVAnsiChar(s), Length(s));
if rvscParagraphAttrs in RVVisibleSpecialCharacters then
DrawParaAttrs(Left,Top, sz, RVStyle.ParaStyles[GetItemParaEx(ditem.ItemNo)],
ParaBreak, BiDiMode, After);
end;
DrawParaMark 段落标志 回车符号 分析
最新推荐文章于 2021-11-23 18:32:07 发布