I have written a little application that draws text on in-memory images and writes them to files. The basic Delphi code looks similar to:
var
Canvas : tCanvas;
Text : WideString;
TextRect : tRect;
begin
Canvas := Bitmap.Canvas;
Canvas.Brush.Color := clBlack;
Canvas.Pen.Color := clBlack;
Canvas.Font.Name := 'Courier New';
Canvas.Font.Size := 11;
Canvas.Font.Color := clWhite;
TextRect := ...; // calculate text position
DrawTextW(Canvas.Handle, PWideChar(Text), Length(Text), TextRect, DT_NOCLIP or DT_NOPREFIX or DT_SINGLELINE or DT_CENTER or DT_VCENTER);
end;
Unfortunately the drawn text is different depending on the ClearType setting of the computer running the application. I would like to have a consistent output in my application regardless of the local ClearType setting (output is not displayed to screen directly anyway). Is there some Win32 API option to override the local ClearType settings?