Font Background Color in Linux does not work lazarus / 39-Graphics ---------------------------------------------------------------------- Martin V · 2010-06-12 03:34 Hello, if I want to write "hello" in black color with yellow background, I write: Code: [Select]Canvas.Brush.Color := clYellow; Canvas.Font.Color := clBlack; Canvas.TextOut (100, 100, 'hello'); This code works in Win32, but not with Linux. Linux does not change the background color. Is there a setting to get the same behaviour in Linux, or do I need to write the background by myself via Canvas.Fillrect ? In this case, it would be useful to modify LCL Textout. Martin ---------------------------------------------------------------------- Martin V · 2010-06-12 16:25 in addition to the last message: In Linux, the area of the text output is not filled with a color, so several outputs to the same locations let the area overprint. In Lazarus Win32, the text output area is filled with the Brush.Color before writing. In Delphi, you can change this behaviour by setting the property Brush.Mode (bmOpaque or bmTransparent). Brush.Mode does not seem to exist in Lazarus. We could add the Brush.Mode property. Because I'm not complete satisfied with the Win32 output, we could define these properties: - bmOpaque           manual fillrect in Linux, Win32 fill in Win32 - bmOpaqueManual   manual fillrect in all OS - bmTransparent Martin ---------------------------------------------------------------------- Zoran · 2010-06-12 22:59 I think that it should be controlled with Canvas.Brush.Style property, which can be set to bsSolid or bsClear (and some other, less useful, constants). http://lazarus- ccr.sourceforge.net/docs/fcl/fpcanvas/tfpbrushstyle.html I think that it should not behave differently in Windows and Linux. If it does, you should report it on bug tracker. ---------------------------------------------------------------------- Martin V · 2010-06-13 14:57 I've made some additional tests. First, Brush.Mode is not Delphi, it is WDSibyl (sorry, handling three similar IDEs sometimes confuses me). I tested original Delphi and it seems that old Delphi 6 is buggy (sorry, I do not have a newer one). Brush.Style = bsSolid and bsClear makes no difference, but grid background like bsHorizontal has the effect bsClear should have (painting no background = overprinting). In Lazarus Win32, behaviour seems to be correct: Brush.Style = bsSolid draws a background with Brush.Color and Brush.Style = bsClear let you overprint text. The default setting is bsSolid. In Linux, a Canvas.Fillrect is missing before Canvas.Textout if Brush.Style bsSolid is chosen. In MacosX, the behaviour is again different. I will continue my tests and then post the results in the bugtracker. Martin