mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 10:59:27 +02:00
(Qt): implemented FontIsMonoSpace() and FontCanUTF8().
git-svn-id: trunk@12053 -
This commit is contained in:
parent
4ac6e38987
commit
0f4b37d257
@ -114,6 +114,46 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Function: FontCanUTF8
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
function TQtWidgetSet.FontCanUTF8(Font: HFont): Boolean;
|
||||||
|
begin
|
||||||
|
{$ifdef windows}
|
||||||
|
{$ifdef WindowsUnicodeSupport}
|
||||||
|
Result := True;
|
||||||
|
{$else}
|
||||||
|
Result := False;
|
||||||
|
{$endif}
|
||||||
|
{$else}
|
||||||
|
Result := IsValidGDIObject(Font);
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Function: FontIsMonoSpace
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
function TQtWidgetSet.FontIsMonoSpace(Font: HFont): Boolean;
|
||||||
|
var
|
||||||
|
QtFontInfo: QFontInfoH;
|
||||||
|
begin
|
||||||
|
Result := IsValidGDIObject(Font);
|
||||||
|
if Result then
|
||||||
|
begin
|
||||||
|
QtFontInfo := QFontInfo_create(TQtFont(Font).Widget);
|
||||||
|
try
|
||||||
|
Result := QFontInfo_fixedPitch(QtFontInfo);
|
||||||
|
finally
|
||||||
|
QFontInfo_destroy(QtFontInfo);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: IntfSendsUTF8KeyPress
|
Function: IntfSendsUTF8KeyPress
|
||||||
Params:
|
Params:
|
||||||
@ -122,7 +162,7 @@ end;
|
|||||||
|
|
||||||
function TQtWidgetSet.IntfSendsUTF8KeyPress: boolean;
|
function TQtWidgetSet.IntfSendsUTF8KeyPress: boolean;
|
||||||
begin
|
begin
|
||||||
Result:=true;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -33,6 +33,9 @@
|
|||||||
function CreateStandardCursor(ACursor: SmallInt): hCursor; override;
|
function CreateStandardCursor(ACursor: SmallInt): hCursor; override;
|
||||||
procedure DrawArrow(Arrow: TComponent; Canvas: TPersistent); override;
|
procedure DrawArrow(Arrow: TComponent; Canvas: TPersistent); override;
|
||||||
|
|
||||||
|
function FontCanUTF8(Font: HFont): boolean; override;
|
||||||
|
function FontIsMonoSpace(Font: HFont): boolean; override;
|
||||||
|
|
||||||
function IntfSendsUTF8KeyPress: boolean; override;
|
function IntfSendsUTF8KeyPress: boolean; override;
|
||||||
|
|
||||||
function PromptUser(const DialogCaption : string;
|
function PromptUser(const DialogCaption : string;
|
||||||
|
Loading…
Reference in New Issue
Block a user