Project

General

Profile

Defect #6505 » japanese.rb_utf8.patch

Jun NAITOH, 2011-03-22 22:24

View differences:

vendor/plugins/rfpdf/lib/rfpdf/japanese.rb 2011-03-07 14:44:39.000000000 -0500 → vendor/plugins/rfpdf/lib/rfpdf/japanese.rb 2011-03-20 15:17:35.000000000 -0400
103 103
  		o=s[i]
104 104
  		if(o<128)
105 105
  			#ASCII
106
  			l+=cw[o.chr]
106
  			l+=cw[o.chr] if cw[o.chr]
107 107
  			i+=1
108 108
  		elsif(o>=161 and o<=223)
109 109
  			#Half-width katakana
......
179 179
  		end
180 180
  		if(o<128)
181 181
  			#ASCII
182
  			l+=cw[c.chr]
182
  			l+=cw[c.chr] || 0
183 183
  			n=1
184 184
  			if(o==32)
185 185
  				sep=i
......
204 204
  				Cell(w,h,s[j,i-j],b,2,align,fill)
205 205
  			else
206 206
  				Cell(w,h,s[j,sep-j],b,2,align,fill)
207
  				i=(s[sep]==' ') ? sep+1 : sep
207
  				i=(s[sep].chr==' ') ? sep+1 : sep
208 208
  			end
209 209
  			sep=-1
210 210
  			j=i
......
270 270
  		end
271 271
  		if(o<128)
272 272
  			#ASCII
273
  			l+=cw[c.chr]
273
  			l+=cw[c.chr] || 0
274 274
  			n=1
275 275
  			if(o==32)
276 276
  				sep=i
......
305 305
  				Cell(w,h,s[j,i-j],0,2,'',0,link)
306 306
  			else
307 307
  				Cell(w,h,s[j,sep-j],0,2,'',0,link)
308
  				i=(s[sep]==' ') ? sep+1 : sep
308
  				i=(s[sep].chr==' ') ? sep+1 : sep
309 309
  			end
310 310
  			sep=-1
311 311
  			j=i
(8-8/9)