mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 05:30:59 +02:00
gtk2: fix size for default font with changed attributes
git-svn-id: trunk@19968 -
This commit is contained in:
parent
d6ebb0255e
commit
32096568a9
@ -145,12 +145,6 @@ begin
|
|||||||
// size information, and later modify font size
|
// size information, and later modify font size
|
||||||
|
|
||||||
// using method 2
|
// using method 2
|
||||||
if (aSize=0) and (lfHeight=0) then
|
|
||||||
FullString:='10' // use some default: TODO: find out the default size of the widget
|
|
||||||
else if aSize>0 then
|
|
||||||
FullString:=IntToStr(aSize)
|
|
||||||
else
|
|
||||||
FullString:='';
|
|
||||||
|
|
||||||
if aFamily = 'default' then
|
if aFamily = 'default' then
|
||||||
begin
|
begin
|
||||||
@ -161,9 +155,23 @@ begin
|
|||||||
if PangoDesc = nil then
|
if PangoDesc = nil then
|
||||||
PangoDesc := pango_context_get_font_description(pango_layout_get_context(CurFont));
|
PangoDesc := pango_context_get_font_description(pango_layout_get_context(CurFont));
|
||||||
aFamily := StrPas(pango_font_description_get_family(PangoDesc));
|
aFamily := StrPas(pango_font_description_get_family(PangoDesc));
|
||||||
|
if (aSize = 0) then
|
||||||
|
begin
|
||||||
|
aSize := pango_font_description_get_size(PangoDesc);
|
||||||
|
if not pango_font_description_get_size_is_absolute(PangoDesc) then
|
||||||
|
aSize := aSize div PANGO_SCALE;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if (aSize = 0) and (lfHeight = 0) then
|
||||||
|
FullString := '10' // use some default: TODO: find out the default size of the widget
|
||||||
|
else
|
||||||
|
if aSize > 0 then
|
||||||
|
FullString := IntToStr(aSize)
|
||||||
|
else
|
||||||
|
FullString := '';
|
||||||
|
|
||||||
FullString := AFamily + ' ' + aStyle + ' ' + FullString;
|
FullString := AFamily + ' ' + aStyle + ' ' + FullString;
|
||||||
PangoDesc := pango_font_description_from_string(PChar(FullString));
|
PangoDesc := pango_font_description_from_string(PChar(FullString));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user