bestlong 怕失憶論壇's Archiver

bestlong 發表於 2010-10-29 14:46

FreeReport 打印錯誤, 漢字列會出現字重疊現象

參考來源 [url]http://www.cnblogs.com/apple1/archive/2009/09/21/1570871.html[/url]

控件修改之: 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 就避免了設置間距,而使用系統默認值。
頁: [1]

Powered by Discuz! X1.5 Archiver   © 2001-2010 Comsenz Inc.