You've already forked lazarus-ccr
tvplanit: Fix text with font height 0 being too small in printout.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4898 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -364,7 +364,11 @@ begin
|
|||||||
InitColors;
|
InitColors;
|
||||||
SavePenBrush;
|
SavePenBrush;
|
||||||
InitPenBrush;
|
InitPenBrush;
|
||||||
TVpCalendarOpener(FCalendar).calRebuildCalArray(RenderDate);
|
|
||||||
|
with TVpCalendarOpener(FCalendar) do begin
|
||||||
|
Font.Height := GetRealFontHeight(Font);
|
||||||
|
calRebuildCalArray(RenderDate);
|
||||||
|
end;
|
||||||
|
|
||||||
RenderCanvas.Lock;
|
RenderCanvas.Lock;
|
||||||
try
|
try
|
||||||
|
@ -1775,6 +1775,11 @@ begin
|
|||||||
SavePenBrush;
|
SavePenBrush;
|
||||||
InitPenBrush;
|
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);
|
Rgn := CreateRectRgn(RenderIn.Left, RenderIn.Top, RenderIn.Right, RenderIn.Bottom);
|
||||||
try
|
try
|
||||||
SelectClipRgn(RenderCanvas.Handle, Rgn);
|
SelectClipRgn(RenderCanvas.Handle, Rgn);
|
||||||
|
@ -477,7 +477,8 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils, Math, Forms, Dialogs, VpEvntEditDlg, VpDayViewPainter;
|
SysUtils, Math, Forms, Dialogs,
|
||||||
|
VpEvntEditDlg, VpDayViewPainter;
|
||||||
|
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
{ TVpTGInPlaceEdit }
|
{ TVpTGInPlaceEdit }
|
||||||
@ -1342,6 +1343,7 @@ begin
|
|||||||
{ font, the standard client font, and a sample character string. }
|
{ font, the standard client font, and a sample character string. }
|
||||||
SaveFont := Canvas.Font;
|
SaveFont := Canvas.Font;
|
||||||
Canvas.Font.Assign(FRowHeadAttr.FMinuteFont);
|
Canvas.Font.Assign(FRowHeadAttr.FMinuteFont);
|
||||||
|
Canvas.Font.Height := GetRealFontHeight(Canvas.Font);
|
||||||
Result := Canvas.TextHeight(RSTallShortChars);
|
Result := Canvas.TextHeight(RSTallShortChars);
|
||||||
Canvas.Font.Assign(SaveFont);
|
Canvas.Font.Assign(SaveFont);
|
||||||
Temp := Canvas.TextHeight(RSTallShortChars);
|
Temp := Canvas.TextHeight(RSTallShortChars);
|
||||||
|
@ -1566,6 +1566,14 @@ begin
|
|||||||
try
|
try
|
||||||
SelectClipRgn(RenderCanvas.Handle, Rgn);
|
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 }
|
{ Calculate Row Header }
|
||||||
RealRowHeight := TVpDayViewOpener(FDayView).dvCalcRowHeight(Scale, UseGran);
|
RealRowHeight := TVpDayViewOpener(FDayView).dvCalcRowHeight(Scale, UseGran);
|
||||||
RealColHeadHeight := TVpDayViewOpener(FDayView).dvCalcColHeadHeight(Scale);
|
RealColHeadHeight := TVpDayViewOpener(FDayView).dvCalcColHeadHeight(Scale);
|
||||||
|
@ -118,6 +118,7 @@ function LineToStartTime(Line: Integer; Granularity: TVpGranularity): TDateTime;
|
|||||||
function GetLineDuration(Granularity: TVpGranularity): Double;
|
function GetLineDuration(Granularity: TVpGranularity): Double;
|
||||||
|
|
||||||
function GetLabelWidth(ALabel: TLabel): Integer;
|
function GetLabelWidth(ALabel: TLabel): Integer;
|
||||||
|
function GetRealFontHeight(AFont: TFont): Integer;
|
||||||
|
|
||||||
function DecodeLineEndings(const AText: String): String;
|
function DecodeLineEndings(const AText: String): String;
|
||||||
function EncodeLineEndings(const AText: String): String;
|
function EncodeLineEndings(const AText: String): String;
|
||||||
@ -562,6 +563,13 @@ begin
|
|||||||
canvas.Free;
|
canvas.Free;
|
||||||
end;
|
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;
|
function SameDate(dt1, dt2: TDateTime): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := trunc(dt1) = trunc(dt2);
|
Result := trunc(dt1) = trunc(dt2);
|
||||||
|
@ -818,6 +818,13 @@ begin
|
|||||||
SavePenBrush;
|
SavePenBrush;
|
||||||
InitPenBrush;
|
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);
|
Rgn := CreateRectRgn(RenderIn.Left, RenderIn.Top, RenderIn.Right, RenderIn.Bottom);
|
||||||
try
|
try
|
||||||
SelectClipRgn(RenderCanvas.Handle, Rgn);
|
SelectClipRgn(RenderCanvas.Handle, Rgn);
|
||||||
|
@ -514,6 +514,11 @@ begin
|
|||||||
SavePenBrush;
|
SavePenBrush;
|
||||||
InitPenBrush;
|
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);
|
Rgn := CreateRectRgn(RenderIn.Left, RenderIn.Top, RenderIn.Right, RenderIn.Bottom);
|
||||||
try
|
try
|
||||||
SelectClipRgn(RenderCanvas.Handle, Rgn);
|
SelectClipRgn(RenderCanvas.Handle, Rgn);
|
||||||
|
@ -630,6 +630,14 @@ begin
|
|||||||
SavePenBrush;
|
SavePenBrush;
|
||||||
InitPenBrush;
|
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);
|
Rgn := CreateRectRgn(RenderIn.Left, RenderIn.Top, RenderIn.Right, RenderIn.Bottom);
|
||||||
try
|
try
|
||||||
SelectClipRgn(RenderCanvas.Handle, Rgn);
|
SelectClipRgn(RenderCanvas.Handle, Rgn);
|
||||||
|
Reference in New Issue
Block a user