Defect #6505 » chinese.rb_utf8.patch
| 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 | ||
|---|---|---|
| 205 | 205 |
if(!ascii) |
| 206 | 206 |
sep=i |
| 207 | 207 |
ls=l |
| 208 |
elsif(c==' ') |
|
| 208 |
elsif(c.chr==' ')
|
|
| 209 | 209 |
sep=i |
| 210 | 210 |
ls=l |
| 211 | 211 |
end |
| 212 |
l+=ascii ? (cw[c.chr] || 0) : 1100
|
|
| 212 |
l+=ascii ? (cw[c.chr] || 0) : 1000
|
|
| 213 | 213 |
if(l>wmax) |
| 214 | 214 |
#Automatic line break |
| 215 | 215 |
if(sep==-1 or i==j) |
| 216 | 216 |
if(i==j) |
| 217 |
i+=ascii ? 1 : 3
|
|
| 217 |
i+=ascii ? 1 : 2
|
|
| 218 | 218 |
end |
| 219 | 219 |
Cell(w,h,s[j,i-j],b,2,align,fill) |
| 220 | 220 |
else |
| 221 | 221 |
Cell(w,h,s[j,sep-j],b,2,align,fill) |
| 222 |
i=(s[sep]==' ') ? sep+1 : sep |
|
| 222 |
i=(s[sep].chr==' ') ? sep+1 : sep
|
|
| 223 | 223 |
end |
| 224 | 224 |
sep=-1 |
| 225 | 225 |
j=i |
| ... | ... | |
| 229 | 229 |
b=b2 |
| 230 | 230 |
end |
| 231 | 231 |
else |
| 232 |
i+=ascii ? 1 : 3
|
|
| 232 |
i+=ascii ? 1 : 2
|
|
| 233 | 233 |
end |
| 234 | 234 |
end |
| 235 | 235 |
#Last chunk |
| ... | ... | |
| 280 | 280 |
nl+=1 |
| 281 | 281 |
next |
| 282 | 282 |
end |
| 283 |
if(!ascii or c==' ') |
|
| 283 |
if(!ascii or c.chr==' ')
|
|
| 284 | 284 |
sep=i |
| 285 | 285 |
end |
| 286 |
l+=ascii ? cw[c.chr] : 1100
|
|
| 286 |
l+=ascii ? cw[c.chr] : 1000
|
|
| 287 | 287 |
if(l>wmax) |
| 288 | 288 |
#Automatic line break |
| 289 | 289 |
if(sep==-1 or i==j) |
| ... | ... | |
| 298 | 298 |
next |
| 299 | 299 |
end |
| 300 | 300 |
if(i==j) |
| 301 |
i+=ascii ? 1 : 3
|
|
| 301 |
i+=ascii ? 1 : 2
|
|
| 302 | 302 |
end |
| 303 | 303 |
Cell(w,h,s[j,i-j],0,2,'',0,link) |
| 304 | 304 |
else |
| 305 | 305 |
Cell(w,h,s[j,sep-j],0,2,'',0,link) |
| 306 |
i=(s[sep]==' ') ? sep+1 : sep |
|
| 306 |
i=(s[sep].chr==' ') ? sep+1 : sep
|
|
| 307 | 307 |
end |
| 308 | 308 |
sep=-1 |
| 309 | 309 |
j=i |
| ... | ... | |
| 315 | 315 |
end |
| 316 | 316 |
nl+=1 |
| 317 | 317 |
else |
| 318 |
i+=ascii ? 1 : 3
|
|
| 318 |
i+=ascii ? 1 : 2
|
|
| 319 | 319 |
end |
| 320 | 320 |
end |
| 321 | 321 |
#Last chunk |
- « Previous
- 1
- …
- 7
- 8
- 9
- Next »