bestlong 怕失憶論壇

 

 

搜索
bestlong 怕失憶論壇 論壇 Delphi FreeReport 報表元件 FreeReport 打印錯誤, 漢字列會出現字重疊現象 ...
查看: 2371|回復: 0
go

FreeReport 打印錯誤, 漢字列會出現字重疊現象 [複製鏈接]

Rank: 9Rank: 9Rank: 9

1#
發表於 2010-10-29 14:46 |只看該作者 |倒序瀏覽 |打印
參考來源 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 就避免了設置間距,而使用系統默認值。
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw
‹ 上一主題|下一主題

Archiver|怕失憶論壇

GMT+8, 2024-4-26 17:45 , Processed in 0.008285 second(s), 11 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.