bestlong 怕失憶論壇
標題:
FreeReport 打印錯誤, 漢字列會出現字重疊現象
[打印本頁]
作者:
bestlong
時間:
2010-10-29 14:46
標題:
FreeReport 打印錯誤, 漢字列會出現字重疊現象
參考來源
http://www.cnblogs.com/apple1/archive/2009/09/21/1570871.html
控件修改之: FreeReport 打印錯誤,漢字列會出現字重疊現象
主要是 fr_class.pas 裡面
SetTextCharacterExtra(Canvas.Handle, Round(CharacterSpacing * ScaleX)); //這個就是設置字符間隔,將導致漢字打印錯誤
這個 api 計算字符間距可能是以 ASCII 字符計算的,導致計算錯誤。
真正使用字符間距的地方是
if not Exporting then
ExtTextOut(Canvas.Handle, curx, cury, ETO_CLIPPED, @DR, PChar(str), Length(str), nil);//PInteger(GCP.lpDx)) //這裡決定字符間距
原先是 GCP.lpdx 這個值, 然後修改成 nil 就避免了設置間距,而使用系統默認值。
歡迎光臨 bestlong 怕失憶論壇 (http://www.bestlong.idv.tw/)
Powered by Discuz! X1.5