diff --git a/components/tvplanit/source/vpcalendarpainter.pas b/components/tvplanit/source/vpcalendarpainter.pas index 5268258b8..317b9f12d 100644 --- a/components/tvplanit/source/vpcalendarpainter.pas +++ b/components/tvplanit/source/vpcalendarpainter.pas @@ -364,7 +364,11 @@ begin InitColors; SavePenBrush; InitPenBrush; - TVpCalendarOpener(FCalendar).calRebuildCalArray(RenderDate); + + with TVpCalendarOpener(FCalendar) do begin + Font.Height := GetRealFontHeight(Font); + calRebuildCalArray(RenderDate); + end; RenderCanvas.Lock; try diff --git a/components/tvplanit/source/vpcontactgridpainter.pas b/components/tvplanit/source/vpcontactgridpainter.pas index 16946f083..05a6fc0f5 100644 --- a/components/tvplanit/source/vpcontactgridpainter.pas +++ b/components/tvplanit/source/vpcontactgridpainter.pas @@ -1775,6 +1775,11 @@ begin SavePenBrush; InitPenBrush; + with FContactGrid do begin + ContactHeadAttributes.Font.Height := GetRealFontHeight(ContactHeadAttributes.Font); + Font.Height := GetRealFontHeight(Font); + end; + Rgn := CreateRectRgn(RenderIn.Left, RenderIn.Top, RenderIn.Right, RenderIn.Bottom); try SelectClipRgn(RenderCanvas.Handle, Rgn); diff --git a/components/tvplanit/source/vpdayview.pas b/components/tvplanit/source/vpdayview.pas index 6f8aa11b8..963a6b737 100644 --- a/components/tvplanit/source/vpdayview.pas +++ b/components/tvplanit/source/vpdayview.pas @@ -477,7 +477,8 @@ type implementation uses - SysUtils, Math, Forms, Dialogs, VpEvntEditDlg, VpDayViewPainter; + SysUtils, Math, Forms, Dialogs, + VpEvntEditDlg, VpDayViewPainter; (*****************************************************************************) { TVpTGInPlaceEdit } @@ -1342,6 +1343,7 @@ begin { font, the standard client font, and a sample character string. } SaveFont := Canvas.Font; Canvas.Font.Assign(FRowHeadAttr.FMinuteFont); + Canvas.Font.Height := GetRealFontHeight(Canvas.Font); Result := Canvas.TextHeight(RSTallShortChars); Canvas.Font.Assign(SaveFont); Temp := Canvas.TextHeight(RSTallShortChars); diff --git a/components/tvplanit/source/vpdayviewpainter.pas b/components/tvplanit/source/vpdayviewpainter.pas index fb21be66c..daa170423 100644 --- a/components/tvplanit/source/vpdayviewpainter.pas +++ b/components/tvplanit/source/vpdayviewpainter.pas @@ -1566,6 +1566,14 @@ begin try SelectClipRgn(RenderCanvas.Handle, Rgn); + with FDayView do begin + AllDayEventAttributes.Font.Height := GetRealFontHeight(AllDayEventAttributes.Font); + Font.Height := GetRealFontHeight(Font); + HeadAttributes.Font.Height := GetRealFontHeight(HeadAttributes.Font); + RowHeadAttributes.HourFont.Height := GetRealFontHeight(RowHeadAttributes.HourFont); + RowHeadAttributes.MinuteFont.Height := GetRealFontHeight(RowHeadAttributes.MinuteFont); + end; + { Calculate Row Header } RealRowHeight := TVpDayViewOpener(FDayView).dvCalcRowHeight(Scale, UseGran); RealColHeadHeight := TVpDayViewOpener(FDayView).dvCalcColHeadHeight(Scale); diff --git a/components/tvplanit/source/vpmisc.pas b/components/tvplanit/source/vpmisc.pas index 304cedd93..5ecbf8a58 100644 --- a/components/tvplanit/source/vpmisc.pas +++ b/components/tvplanit/source/vpmisc.pas @@ -118,6 +118,7 @@ function LineToStartTime(Line: Integer; Granularity: TVpGranularity): TDateTime; function GetLineDuration(Granularity: TVpGranularity): Double; function GetLabelWidth(ALabel: TLabel): Integer; +function GetRealFontHeight(AFont: TFont): Integer; function DecodeLineEndings(const AText: String): String; function EncodeLineEndings(const AText: String): String; @@ -562,6 +563,13 @@ begin canvas.Free; end; +function GetRealFontHeight(AFont: TFont): Integer; +begin + if AFont.Size = 0 then + Result := GetFontData(AFont.Handle).Height else + Result := AFont.Height; +end; + function SameDate(dt1, dt2: TDateTime): Boolean; begin Result := trunc(dt1) = trunc(dt2); diff --git a/components/tvplanit/source/vpmonthviewpainter.pas b/components/tvplanit/source/vpmonthviewpainter.pas index ee349167a..6c04fc613 100644 --- a/components/tvplanit/source/vpmonthviewpainter.pas +++ b/components/tvplanit/source/vpmonthviewpainter.pas @@ -818,6 +818,13 @@ begin SavePenBrush; InitPenBrush; + with FMonthView do begin + DayHeadAttributes.Font.Height := GetRealFontHeight(DayHeadAttributes.Font); + DayNumberFont.Height := GetRealFontHeight(DayNumberFont); + EventFont.Height := GetRealFontHeight(EventFont); + Font.Height := GetRealFontHeight(Font); + end; + Rgn := CreateRectRgn(RenderIn.Left, RenderIn.Top, RenderIn.Right, RenderIn.Bottom); try SelectClipRgn(RenderCanvas.Handle, Rgn); diff --git a/components/tvplanit/source/vptasklistpainter.pas b/components/tvplanit/source/vptasklistpainter.pas index a1155cb50..47c14aee3 100644 --- a/components/tvplanit/source/vptasklistpainter.pas +++ b/components/tvplanit/source/vptasklistpainter.pas @@ -514,6 +514,11 @@ begin SavePenBrush; InitPenBrush; + with FTaskList do begin + Font.Height := GetRealFontHeight(Font); + TaskHeadAttributes.Font.Height := GetRealFontHeight(TaskHeadAttributes.Font); + end; + Rgn := CreateRectRgn(RenderIn.Left, RenderIn.Top, RenderIn.Right, RenderIn.Bottom); try SelectClipRgn(RenderCanvas.Handle, Rgn); diff --git a/components/tvplanit/source/vpweekviewpainter.pas b/components/tvplanit/source/vpweekviewpainter.pas index 73ed9c212..9b001703e 100644 --- a/components/tvplanit/source/vpweekviewpainter.pas +++ b/components/tvplanit/source/vpweekviewpainter.pas @@ -630,6 +630,14 @@ begin SavePenBrush; InitPenBrush; + with FWeekView do begin + AllDayEventAttributes.Font.Height := GetRealFontHeight(AllDayEventAttributes.Font); + DayHeadAttributes.Font.Height := GetRealFontHeight(DayHeadAttributes.Font); + EventFont.Height := GetRealFontHeight(EventFont); + Font.Height := GetRealFontHeight(Font); + HeadAttributes.Font.Height := GetRealFontHeight(HeadAttributes.Font); + end; + Rgn := CreateRectRgn(RenderIn.Left, RenderIn.Top, RenderIn.Right, RenderIn.Bottom); try SelectClipRgn(RenderCanvas.Handle, Rgn);