Project

General

Profile

Defect #6505 » chinese.rb_utf8.patch

Jun NAITOH, 2011-03-22 22:24

View differences:

vendor/plugins/rfpdf/lib/rfpdf/chinese.rb 2011-03-07 14:44:39.000000000 -0500 → vendor/plugins/rfpdf/lib/rfpdf/chinese.rb 2011-03-20 15:19:44.000000000 -0400
if(!ascii)
sep=i
ls=l
elsif(c==' ')
elsif(c.chr==' ')
sep=i
ls=l
end
l+=ascii ? (cw[c.chr] || 0) : 1100
l+=ascii ? (cw[c.chr] || 0) : 1000
if(l>wmax)
#Automatic line break
if(sep==-1 or i==j)
if(i==j)
i+=ascii ? 1 : 3
i+=ascii ? 1 : 2
end
Cell(w,h,s[j,i-j],b,2,align,fill)
else
Cell(w,h,s[j,sep-j],b,2,align,fill)
i=(s[sep]==' ') ? sep+1 : sep
i=(s[sep].chr==' ') ? sep+1 : sep
end
sep=-1
j=i
......
b=b2
end
else
i+=ascii ? 1 : 3
i+=ascii ? 1 : 2
end
end
#Last chunk
......
nl+=1
next
end
if(!ascii or c==' ')
if(!ascii or c.chr==' ')
sep=i
end
l+=ascii ? cw[c.chr] : 1100
l+=ascii ? cw[c.chr] : 1000
if(l>wmax)
#Automatic line break
if(sep==-1 or i==j)
......
next
end
if(i==j)
i+=ascii ? 1 : 3
i+=ascii ? 1 : 2
end
Cell(w,h,s[j,i-j],0,2,'',0,link)
else
Cell(w,h,s[j,sep-j],0,2,'',0,link)
i=(s[sep]==' ') ? sep+1 : sep
i=(s[sep].chr==' ') ? sep+1 : sep
end
sep=-1
j=i
......
end
nl+=1
else
i+=ascii ? 1 : 3
i+=ascii ? 1 : 2
end
end
#Last chunk
(9-9/9)