Project

General

Profile

Defect #6505 » korean.rb_utf8.patch

Jun NAITOH, 2011-03-22 22:24

View differences:

vendor/plugins/rfpdf/lib/rfpdf/korean.rb 2011-03-07 14:44:39.000000000 -0500 → vendor/plugins/rfpdf/lib/rfpdf/korean.rb 2011-03-20 15:18:50.000000000 -0400
while(i<nb)
c=s[i]
if(c<128)
l+=cw[c.chr]
l+=cw[c.chr] if cw[c.chr]
i+=1
else
l+=1000
......
b2='LR'
else
b2=''
if(border.to_s.index('L').nil?)
if(border.to_s.index('L'))
b2+='L'
end
if(border.to_s.index('R').nil?)
if(border.to_s.index('R'))
b2+='R'
end
b=border.to_s.index('T').nil? ? b2+'T' : b2
b=border.to_s.index('T') ? b2+'T' : b2
end
end
sep=-1
......
c=s[i]
#Check if ASCII or MB
ascii=(c<128)
if(c=="\n")
if(c.chr=="\n")
#Explicit line break
Cell(w,h,s[j,i-j],b,2,align,fill)
i+=1
......
if(!ascii)
sep=i
ls=l
elsif(c==' ')
elsif(c.chr==' ')
sep=i
ls=l
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
......
c=s[i]
#Check if ASCII or MB
ascii=(c<128)
if(c=="\n")
if(c.chr=="\n")
#Explicit line break
Cell(w,h,s[j,i-j],0,2,'',0,link)
i+=1
......
nl+=1
next
end
if(!ascii or c==' ')
if(!ascii or c.chr==' ')
sep=i
end
l+=ascii ? cw[c.chr] : 1000
......
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
(7-7/9)