I use "LCLIntf.DrawText" for drawing text on the screen and "Canvas.TextWidth" to determine its width to increment a TRect for the next text output. But these functions cause some trouble with drawing (UTF-8-) text on Windows. In general it works okay but sometimes peculiar clipping or other pixel differences occur. Are the functions above the correct ones to draw and measure text?
After looking a bit at the code I saw that in the file "intfbasewinapi.inc" almost everywhere the Windows API function "GetTextExtentPoint" is used to determine text metrics. But https://msdn.microsoft.com/en-us/library/windows/desktop/dd144937%28v=vs.85%29.aspx says: "This function is provided only for compatibility with 16-bit versions of Windows. Applications should call the *GetTextExtentPoint32* <https://msdn.microsoft.com/en-us/library/windows/desktop/dd144938%28v=vs.85%29.aspx> function, which provides more accurate results." I think many of my problems come from using this deprecated API function. Are there any plans to change this?
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus