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
101 101
  	while(i<nb)
102 102
  		c=s[i]
103 103
  		if(c<128)
104
  			l+=cw[c.chr]
104
  			l+=cw[c.chr] if cw[c.chr]
105 105
  			i+=1
106 106
  		else
107 107
  			l+=1000
......
139 139
  			b2='LR'
140 140
  		else
141 141
  			b2=''
142
  			if(border.to_s.index('L').nil?)
142
  			if(border.to_s.index('L'))
143 143
  				b2+='L'
144 144
        end
145
  			if(border.to_s.index('R').nil?)
145
  			if(border.to_s.index('R'))
146 146
  				b2+='R'
147 147
        end
148
  			b=border.to_s.index('T').nil? ? b2+'T' : b2
148
  			b=border.to_s.index('T') ? b2+'T' : b2
149 149
  		end
150 150
  	end
151 151
  	sep=-1
......
158 158
  		c=s[i]
159 159
  		#Check if ASCII or MB
160 160
  		ascii=(c<128)
161
  		if(c=="\n")
161
  		if(c.chr=="\n")
162 162
  			#Explicit line break
163 163
  			Cell(w,h,s[j,i-j],b,2,align,fill)
164 164
  			i+=1
......
174 174
  		if(!ascii)
175 175
  			sep=i
176 176
  			ls=l
177
  		elsif(c==' ')
177
  		elsif(c.chr==' ')
178 178
  			sep=i
179 179
  			ls=l
180 180
  		end
......
188 188
  				Cell(w,h,s[j,i-j],b,2,align,fill)
189 189
  			else
190 190
  				Cell(w,h,s[j,sep-j],b,2,align,fill)
191
  				i=(s[sep]==' ') ? sep+1 : sep
191
  				i=(s[sep].chr==' ') ? sep+1 : sep
192 192
  			end
193 193
  			sep=-1
194 194
  			j=i
......
234 234
  		c=s[i]
235 235
  		#Check if ASCII or MB
236 236
  		ascii=(c<128)
237
  		if(c=="\n")
237
  		if(c.chr=="\n")
238 238
  			#Explicit line break
239 239
  			Cell(w,h,s[j,i-j],0,2,'',0,link)
240 240
  			i+=1
......
249 249
  			nl+=1
250 250
  			next
251 251
  		end
252
  		if(!ascii or c==' ')
252
  		if(!ascii or c.chr==' ')
253 253
  			sep=i
254 254
      end
255 255
  		l+=ascii ? cw[c.chr] : 1000
......
272 272
  				Cell(w,h,s[j,i-j],0,2,'',0,link)
273 273
  			else
274 274
  				Cell(w,h,s[j,sep-j],0,2,'',0,link)
275
  				i=(s[sep]==' ') ? sep+1 : sep
275
  				i=(s[sep].chr==' ') ? sep+1 : sep
276 276
  			end
277 277
  			sep=-1
278 278
  			j=i
(7-7/9)