View Issue Details

IDProjectCategoryView StatusLast Update
0009754LazarusLCLpublic2013-09-03 12:07
ReporterAnton Kavalenka Assigned ToPaul Ishenin  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindows 2003 
Product Version0.9.23 (SVN) 
Fixed in Version0.9.27 (SVN) 
Summary0009754: Custom created font after assignment to canvas.Font not properly selected.
DescriptionCustom created TFont with Handle assigned from outside (Font.Handle:=)
while assigned to Canvas lead to recreation of font resource and use of wrong font.


Steps To ReproducePaintBox1.Canvas.Font:=fOrtFont;
PaintBox1.Canvas.TextOut(100,200,'Why this is Non Rotated Text?');

SelectObject(PaintBox1.Canvas.Handle,fOrtFont.Handle);
PaintBox1.Canvas.TextOut(150,200,'Dity Hack to make Rotated Text');

See the attached project.
Additional InformationAnyway introducing the new member of TFont for X-Platform rotation

TFont=class()
property Rotation:integer read fRotation write SetRotation default 0;
end.

would not break Delphi compatibility but would bo a great work for Lazarus userr.
TagsNo tags attached.
Fixed in Revision20868
LazTarget1.4
WidgetsetWin32/Win64
Attached Files

Activities

2007-09-22 15:03

 

fpctest2.zip (3,717 bytes)

2007-09-22 15:13

 

fpctest2.png (9,643 bytes)   
fpctest2.png (9,643 bytes)   

Anton Kavalenka

2008-11-25 17:32

reporter   ~0023556

Wow!
I got X-platform rotated text also for GTK2,
but still have to select it with SelectObject()
TFont.Changing clears the [csFontFalid] canvas flag,
but newly assigned font still not selected.

Paul Ishenin

2009-07-16 03:22

manager   ~0029114

At moment TFont has Orientation property.
I also fixed orienatation lose while handle assigning.

Please test and close if ok.

Anton Kavalenka

2009-07-16 13:02

reporter   ~0029122

Thank you!
Works for Win32, GTK2.

removed several {$ifdef}'s

Issue History

Date Modified Username Field Change
2007-09-22 15:03 Anton Kavalenka New Issue
2007-09-22 15:03 Anton Kavalenka File Added: fpctest2.zip
2007-09-22 15:03 Anton Kavalenka Widgetset => Win32
2007-09-22 15:13 Anton Kavalenka File Added: fpctest2.png
2007-09-22 15:43 Vincent Snijders LazTarget => post 1.2
2007-09-22 15:43 Vincent Snijders Severity minor => feature
2007-09-22 15:43 Vincent Snijders Status new => acknowledged
2008-11-25 17:32 Anton Kavalenka Note Added: 0023556
2009-07-16 03:22 Paul Ishenin Fixed in Revision => 20868
2009-07-16 03:22 Paul Ishenin Status acknowledged => resolved
2009-07-16 03:22 Paul Ishenin Fixed in Version => 0.9.27 (SVN)
2009-07-16 03:22 Paul Ishenin Resolution open => fixed
2009-07-16 03:22 Paul Ishenin Assigned To => Paul Ishenin
2009-07-16 03:22 Paul Ishenin Note Added: 0029114
2009-07-16 13:02 Anton Kavalenka Status resolved => closed
2009-07-16 13:02 Anton Kavalenka Note Added: 0029122
2013-09-03 12:07 Martin Friebe LazTarget post 1.2 => 1.4