Project

General

Profile

Patch #1170 » chinese.rb.patch

patch - Chaoqun Zou, 2008-05-04 18:08

View differences:

chinese.rb Locally Modified (Based On LOCAL)
189 189
  		c=s[i]
190 190
  		#Check if ASCII or MB
191 191
  		ascii=(c<128)
192
  		if(c=="\n")
192
  		if(c.chr=="\n")
193 193
  			#Explicit line break
194 194
  			Cell(w,h,s[j,i-j],b,2,align,fill)
195 195
  			i+=1
......
209 209
  			sep=i
210 210
  			ls=l
211 211
  		end
212
  		l+=ascii ? (cw[c.chr] || 0) : 1000
212
  		l+=ascii ? (cw[c.chr] || 0) : 1100
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 : 2
217
  					i+=ascii ? 1 : 3
218 218
					end
219 219
  				Cell(w,h,s[j,i-j],b,2,align,fill)
220 220
  			else
......
229 229
  				b=b2
230 230
  			end
231 231
  		else
232
  			i+=ascii ? 1 : 2
232
  			i+=ascii ? 1 : 3
233 233
  		end
234 234
  	end
235 235
  	#Last chunk
......
265 265
  		c=s[i]
266 266
  		#Check if ASCII or MB
267 267
  		ascii=(c<128)
268
  		if(c=="\n")
268
  		if(c.chr=="\n")
269 269
  			#Explicit line break
270 270
  			Cell(w,h,s[j,i-j],0,2,'',0,link)
271 271
  			i+=1
......
283 283
  		if(!ascii or c==' ')
284 284
  			sep=i
285 285
			end
286
  		l+=ascii ? cw[c.chr] : 1000
286
  		l+=ascii ? cw[c.chr] : 1100
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 : 2
301
  					i+=ascii ? 1 : 3
302 302
					end
303 303
  				Cell(w,h,s[j,i-j],0,2,'',0,link)
304 304
  			else
......
315 315
  			end
316 316
  			nl+=1
317 317
  		else
318
  			i+=ascii ? 1 : 2
318
  			i+=ascii ? 1 : 3
319 319
			end
320 320
  	end
321 321
  	#Last chunk
(2-2/3)