PDF: transplant r393 (#61).
Added chinese simplified translation (Andy Wu) Fixed rfpdf chinese.rb git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5250 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
7deb78ca4e
commit
3eb1d6b169
|
@ -132,7 +132,7 @@ module PDF_Chinese
|
||||||
while(i<nb)
|
while(i<nb)
|
||||||
c=s[i]
|
c=s[i]
|
||||||
if(c<128)
|
if(c<128)
|
||||||
l+=cw[c.chr]
|
l+=cw[c.chr] if cw[c.chr]
|
||||||
i+=1
|
i+=1
|
||||||
else
|
else
|
||||||
l+=1000
|
l+=1000
|
||||||
|
@ -170,13 +170,13 @@ module PDF_Chinese
|
||||||
b2='LR'
|
b2='LR'
|
||||||
else
|
else
|
||||||
b2=''
|
b2=''
|
||||||
if(border.index('L').nil?)
|
if(border.to_s.index('L'))
|
||||||
b2+='L'
|
b2+='L'
|
||||||
end
|
end
|
||||||
if(border.index('R').nil?)
|
if(border.to_s.index('R'))
|
||||||
b2+='R'
|
b2+='R'
|
||||||
end
|
end
|
||||||
b=border.index('T').nil? ? b2+'T' : b2
|
b=border.to_s.index('T') ? b2+'T' : b2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
sep=-1
|
sep=-1
|
||||||
|
@ -209,7 +209,7 @@ module PDF_Chinese
|
||||||
sep=i
|
sep=i
|
||||||
ls=l
|
ls=l
|
||||||
end
|
end
|
||||||
l+=ascii ? cw[c.chr] : 1000
|
l+=ascii ? (cw[c.chr] || 0) : 1000
|
||||||
if(l>wmax)
|
if(l>wmax)
|
||||||
#Automatic line break
|
#Automatic line break
|
||||||
if(sep==-1 or i==j)
|
if(sep==-1 or i==j)
|
||||||
|
@ -233,7 +233,7 @@ module PDF_Chinese
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#Last chunk
|
#Last chunk
|
||||||
if(border and not border.index('B').nil?)
|
if(border and not border.to_s.index('B').nil?)
|
||||||
b+='B'
|
b+='B'
|
||||||
end
|
end
|
||||||
Cell(w,h,s[j,i-j],b,2,align,fill)
|
Cell(w,h,s[j,i-j],b,2,align,fill)
|
||||||
|
|
Loading…
Reference in New Issue