Question

I draw text on a canvas and set the font by:

 Image3.Canvas.font.name := 'Arial Narrow';

Everything is right on my machine. But on another pc from my client the wrong font (bigger) is printed. So I installed all Arial Narrow fonts on the clients machine. But I still have the wrong font.

Edit: Font seems to be right, but not scale:

This is the problem Windows 7 has on its Control Panel, Appearance and Personalization, Display setting, an ability to Magnify the text and other items by 125% or 150%.

Any ideas how to get those settings?

Was it helpful?

Solution 2

Getting the DPI and adjusting the font size did it for me:

DC := GetDC(HWND_DESKTOP);
try
  DPI:=GetDeviceCaps(DC,LOGPIXELSY);
finally
  ReleaseDC(DC,HWND_DESKTOP);
end;
Image3.Canvas.font.size := round(myConstant*96/DPI);   

OTHER TIPS

At first you set the size of the image as bitmap,Because before using canvas, bitmap has to be created.

so that bitmap.canvas.font does have a default size,

so later it wont increase its size.So the original font will be produced.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top