You've already forked lazarus-ccr
richmemo: added wsgetfontparams to handle missing informations
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4010 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -293,11 +293,16 @@ end;
|
||||
function GetFontParams(AFont: TFont): TFontParams; overload;
|
||||
var
|
||||
data : TFontData;
|
||||
wstest : Boolean;
|
||||
begin
|
||||
InitFontParams(Result);
|
||||
if not Assigned(AFont) then Exit;
|
||||
|
||||
if AFont.Reference.Handle <> 0 then begin
|
||||
// WSGetFontParams is introduced, because default Gtk widgetset returns
|
||||
// only FontName from the handle.
|
||||
wstest:= Assigned(WSGetFontParams) and WSGetFontParams(AFont.Reference.Handle, Result);
|
||||
if not wstest then begin
|
||||
data:=GetFontData(AFont.Reference.Handle);
|
||||
if data.Height<0
|
||||
then Result.Size:=round(abs(data.Height)/ScreenInfo.PixelsPerInchY*72)
|
||||
@@ -305,6 +310,7 @@ begin
|
||||
Result.Name:=data.Name;
|
||||
Result.Color:=AFont.Color;
|
||||
Result.Style:=data.Style;
|
||||
end;
|
||||
end else begin
|
||||
Result.Name := AFont.Name;
|
||||
Result.Color := AFont.Color;
|
||||
|
@@ -25,6 +25,7 @@ interface
|
||||
|
||||
uses
|
||||
Types, Classes, SysUtils,
|
||||
LCLType,
|
||||
Graphics, Controls, StdCtrls,
|
||||
WSStdCtrls, RichMemo;
|
||||
|
||||
@@ -103,6 +104,10 @@ type
|
||||
|
||||
function WSRegisterCustomRichMemo: Boolean; external name 'WSRegisterCustomRichMemo';
|
||||
|
||||
var
|
||||
//note: this internal function might go away eventually!
|
||||
WSGetFontParams: function (wsfontref: HFONT; var params: TFontParams): Boolean = nil;
|
||||
|
||||
implementation
|
||||
|
||||
{ TWSCustomRichMemo }
|
||||
|
Reference in New Issue
Block a user