@@ -210,11 +210,7 module Redmine | |||||
210 |
|
210 | |||
211 | # Returns a PDF string of a list of issues |
|
211 | # Returns a PDF string of a list of issues | |
212 | def issues_to_pdf(issues, project, query) |
|
212 | def issues_to_pdf(issues, project, query) | |
213 | if l(:general_pdf_encoding).upcase != 'UTF-8' |
|
213 | pdf = ITCPDF.new(current_language) | |
214 | pdf = IFPDF.new(current_language) |
|
|||
215 | else |
|
|||
216 | pdf = ITCPDF.new(current_language) |
|
|||
217 | end |
|
|||
218 | title = query.new_record? ? l(:label_issue_plural) : query.name |
|
214 | title = query.new_record? ? l(:label_issue_plural) : query.name | |
219 | title = "#{project} - #{title}" if project |
|
215 | title = "#{project} - #{title}" if project | |
220 | pdf.SetTitle(title) |
|
216 | pdf.SetTitle(title) | |
@@ -358,11 +354,7 module Redmine | |||||
358 |
|
354 | |||
359 | # Returns a PDF string of a single issue |
|
355 | # Returns a PDF string of a single issue | |
360 | def issue_to_pdf(issue) |
|
356 | def issue_to_pdf(issue) | |
361 | if l(:general_pdf_encoding).upcase != 'UTF-8' |
|
357 | pdf = ITCPDF.new(current_language) | |
362 | pdf = IFPDF.new(current_language) |
|
|||
363 | else |
|
|||
364 | pdf = ITCPDF.new(current_language) |
|
|||
365 | end |
|
|||
366 | pdf.SetTitle("#{issue.project} - ##{issue.tracker} #{issue.id}") |
|
358 | pdf.SetTitle("#{issue.project} - ##{issue.tracker} #{issue.id}") | |
367 | pdf.alias_nb_pages |
|
359 | pdf.alias_nb_pages | |
368 | pdf.footer_date = format_date(Date.today) |
|
360 | pdf.footer_date = format_date(Date.today) |
@@ -507,11 +507,7 module Redmine | |||||
507 | end if Object.const_defined?(:Magick) |
|
507 | end if Object.const_defined?(:Magick) | |
508 |
|
508 | |||
509 | def to_pdf |
|
509 | def to_pdf | |
510 | if l(:general_pdf_encoding).upcase != 'UTF-8' |
|
510 | pdf = ::Redmine::Export::PDF::ITCPDF.new(current_language) | |
511 | pdf = ::Redmine::Export::PDF::IFPDF.new(current_language) |
|
|||
512 | else |
|
|||
513 | pdf = ::Redmine::Export::PDF::ITCPDF.new(current_language) |
|
|||
514 | end |
|
|||
515 | pdf.SetTitle("#{l(:label_gantt)} #{project}") |
|
511 | pdf.SetTitle("#{l(:label_gantt)} #{project}") | |
516 | pdf.alias_nb_pages |
|
512 | pdf.alias_nb_pages | |
517 | pdf.footer_date = format_date(Date.today) |
|
513 | pdf.footer_date = format_date(Date.today) |
@@ -116,7 +116,7 module PDF_Chinese | |||||
116 | end |
|
116 | end | |
117 |
|
117 | |||
118 | def GetStringWidth(s) |
|
118 | def GetStringWidth(s) | |
119 |
if(@ |
|
119 | if(@current_font['type']=='Type0') | |
120 | return GetMBStringWidth(s) |
|
120 | return GetMBStringWidth(s) | |
121 | else |
|
121 | else | |
122 | return super(s) |
|
122 | return super(s) | |
@@ -126,7 +126,7 module PDF_Chinese | |||||
126 | def GetMBStringWidth(s) |
|
126 | def GetMBStringWidth(s) | |
127 | #Multi-byte version of GetStringWidth() |
|
127 | #Multi-byte version of GetStringWidth() | |
128 | l=0 |
|
128 | l=0 | |
129 |
cw=@ |
|
129 | cw=@current_font['cw'] | |
130 | nb=s.length |
|
130 | nb=s.length | |
131 | i=0 |
|
131 | i=0 | |
132 | while(i<nb) |
|
132 | while(i<nb) | |
@@ -139,11 +139,11 module PDF_Chinese | |||||
139 | i+=2 |
|
139 | i+=2 | |
140 | end |
|
140 | end | |
141 | end |
|
141 | end | |
142 |
return l*@ |
|
142 | return l*@font_size/1000 | |
143 | end |
|
143 | end | |
144 |
|
144 | |||
145 | def MultiCell(w,h,txt,border=0,align='L',fill=0) |
|
145 | def MultiCell(w,h,txt,border=0,align='L',fill=0) | |
146 |
if(@ |
|
146 | if(@current_font['type']=='Type0') | |
147 | MBMultiCell(w,h,txt,border,align,fill) |
|
147 | MBMultiCell(w,h,txt,border,align,fill) | |
148 | else |
|
148 | else | |
149 | super(w,h,txt,border,align,fill) |
|
149 | super(w,h,txt,border,align,fill) | |
@@ -152,11 +152,11 module PDF_Chinese | |||||
152 |
|
152 | |||
153 | def MBMultiCell(w,h,txt,border=0,align='L',fill=0) |
|
153 | def MBMultiCell(w,h,txt,border=0,align='L',fill=0) | |
154 | #Multi-byte version of MultiCell() |
|
154 | #Multi-byte version of MultiCell() | |
155 |
cw=@ |
|
155 | cw=@current_font['cw'] | |
156 | if(w==0) |
|
156 | if(w==0) | |
157 |
w=@w-@r |
|
157 | w=@w-@r_margin-@x | |
158 | end |
|
158 | end | |
159 |
wmax=(w-2*@c |
|
159 | wmax=(w-2*@c_margin)*1000/@font_size | |
160 | s=txt.gsub("\r",'') |
|
160 | s=txt.gsub("\r",'') | |
161 | nb=s.length |
|
161 | nb=s.length | |
162 | if(nb>0 and s[nb-1]=="\n") |
|
162 | if(nb>0 and s[nb-1]=="\n") | |
@@ -233,11 +233,11 module PDF_Chinese | |||||
233 | b+='B' |
|
233 | b+='B' | |
234 | end |
|
234 | end | |
235 | Cell(w,h,s[j,i-j],b,2,align,fill) |
|
235 | Cell(w,h,s[j,i-j],b,2,align,fill) | |
236 |
@x=@l |
|
236 | @x=@l_margin | |
237 | end |
|
237 | end | |
238 |
|
238 | |||
239 | def Write(h,txt,link='') |
|
239 | def Write(h,txt,link='') | |
240 |
if(@ |
|
240 | if(@current_font['type']=='Type0') | |
241 | MBWrite(h,txt,link) |
|
241 | MBWrite(h,txt,link) | |
242 | else |
|
242 | else | |
243 | super(h,txt,link) |
|
243 | super(h,txt,link) | |
@@ -246,9 +246,9 module PDF_Chinese | |||||
246 |
|
246 | |||
247 | def MBWrite(h,txt,link) |
|
247 | def MBWrite(h,txt,link) | |
248 | #Multi-byte version of Write() |
|
248 | #Multi-byte version of Write() | |
249 |
cw=@ |
|
249 | cw=@current_font['cw'] | |
250 |
w=@w-@r |
|
250 | w=@w-@r_margin-@x | |
251 |
wmax=(w-2*@c |
|
251 | wmax=(w-2*@c_margin)*1000/@font_size | |
252 | s=txt.gsub("\r",'') |
|
252 | s=txt.gsub("\r",'') | |
253 | nb=s.length |
|
253 | nb=s.length | |
254 | sep=-1 |
|
254 | sep=-1 | |
@@ -269,9 +269,9 module PDF_Chinese | |||||
269 | j=i |
|
269 | j=i | |
270 | l=0 |
|
270 | l=0 | |
271 | if(nl==1) |
|
271 | if(nl==1) | |
272 |
@x=@l |
|
272 | @x=@l_margin | |
273 |
w=@w-@r |
|
273 | w=@w-@r_margin-@x | |
274 |
wmax=(w-2*@c |
|
274 | wmax=(w-2*@c_margin)*1000/@font_size | |
275 | end |
|
275 | end | |
276 | nl+=1 |
|
276 | nl+=1 | |
277 | next |
|
277 | next | |
@@ -283,12 +283,12 module PDF_Chinese | |||||
283 | if(l>wmax) |
|
283 | if(l>wmax) | |
284 | #Automatic line break |
|
284 | #Automatic line break | |
285 | if(sep==-1 or i==j) |
|
285 | if(sep==-1 or i==j) | |
286 |
if(@x>@l |
|
286 | if(@x>@l_margin) | |
287 | #Move to next line |
|
287 | #Move to next line | |
288 |
@x=@l |
|
288 | @x=@l_margin | |
289 | @y+=h |
|
289 | @y+=h | |
290 |
w=@w-@r |
|
290 | w=@w-@r_margin-@x | |
291 |
wmax=(w-2*@c |
|
291 | wmax=(w-2*@c_margin)*1000/@font_size | |
292 | i+=1 |
|
292 | i+=1 | |
293 | nl+=1 |
|
293 | nl+=1 | |
294 | next |
|
294 | next | |
@@ -305,9 +305,9 module PDF_Chinese | |||||
305 | j=i |
|
305 | j=i | |
306 | l=0 |
|
306 | l=0 | |
307 | if(nl==1) |
|
307 | if(nl==1) | |
308 |
@x=@l |
|
308 | @x=@l_margin | |
309 |
w=@w-@r |
|
309 | w=@w-@r_margin-@x | |
310 |
wmax=(w-2*@c |
|
310 | wmax=(w-2*@c_margin)*1000/@font_size | |
311 | end |
|
311 | end | |
312 | nl+=1 |
|
312 | nl+=1 | |
313 | else |
|
313 | else | |
@@ -316,7 +316,7 module PDF_Chinese | |||||
316 | end |
|
316 | end | |
317 | #Last chunk |
|
317 | #Last chunk | |
318 | if(i!=j) |
|
318 | if(i!=j) | |
319 |
Cell(l/1000*@ |
|
319 | Cell(l/1000*@font_size,h,s[j,i-j],0,0,'',0,link) | |
320 | end |
|
320 | end | |
321 | end |
|
321 | end | |
322 |
|
322 | |||
@@ -332,10 +332,10 private | |||||
332 | end |
|
332 | end | |
333 | # mqr=get_magic_quotes_runtime() |
|
333 | # mqr=get_magic_quotes_runtime() | |
334 | # set_magic_quotes_runtime(0) |
|
334 | # set_magic_quotes_runtime(0) | |
335 |
@ |
|
335 | @font_files.each_pair do |file, info| | |
336 | #Font file embedding |
|
336 | #Font file embedding | |
337 | newobj() |
|
337 | newobj() | |
338 |
@ |
|
338 | @font_files[file]['n']=@n | |
339 | if(defined('FPDF_FONTPATH')) |
|
339 | if(defined('FPDF_FONTPATH')) | |
340 | file=FPDF_FONTPATH+file |
|
340 | file=FPDF_FONTPATH+file | |
341 | end |
|
341 | end | |
@@ -411,7 +411,7 private | |||||
411 | end |
|
411 | end | |
412 | file=font['file'] |
|
412 | file=font['file'] | |
413 | if(file) |
|
413 | if(file) | |
414 |
s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@ |
|
414 | s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@font_files[file]['n']+' 0 R' | |
415 | end |
|
415 | end | |
416 | out(s+'>>') |
|
416 | out(s+'>>') | |
417 | out('endobj') |
|
417 | out('endobj') |
@@ -86,7 +86,7 module PDF_Japanese | |||||
86 | end |
|
86 | end | |
87 |
|
87 | |||
88 | def GetStringWidth(s) |
|
88 | def GetStringWidth(s) | |
89 |
if(@ |
|
89 | if(@current_font['type']=='Type0') | |
90 | return GetSJISStringWidth(s) |
|
90 | return GetSJISStringWidth(s) | |
91 | else |
|
91 | else | |
92 | return super(s) |
|
92 | return super(s) | |
@@ -96,7 +96,7 module PDF_Japanese | |||||
96 | def GetSJISStringWidth(s) |
|
96 | def GetSJISStringWidth(s) | |
97 | #SJIS version of GetStringWidth() |
|
97 | #SJIS version of GetStringWidth() | |
98 | l=0 |
|
98 | l=0 | |
99 |
cw=@ |
|
99 | cw=@current_font['cw'] | |
100 | nb=s.length |
|
100 | nb=s.length | |
101 | i=0 |
|
101 | i=0 | |
102 | while(i<nb) |
|
102 | while(i<nb) | |
@@ -115,11 +115,11 module PDF_Japanese | |||||
115 | i+=2 |
|
115 | i+=2 | |
116 | end |
|
116 | end | |
117 | end |
|
117 | end | |
118 |
return l*@ |
|
118 | return l*@font_size/1000 | |
119 | end |
|
119 | end | |
120 |
|
120 | |||
121 | def MultiCell(w,h,txt,border=0,align='L',fill=0) |
|
121 | def MultiCell(w,h,txt,border=0,align='L',fill=0) | |
122 |
if(@ |
|
122 | if(@current_font['type']=='Type0') | |
123 | SJISMultiCell(w,h,txt,border,align,fill) |
|
123 | SJISMultiCell(w,h,txt,border,align,fill) | |
124 | else |
|
124 | else | |
125 | super(w,h,txt,border,align,fill) |
|
125 | super(w,h,txt,border,align,fill) | |
@@ -128,11 +128,11 module PDF_Japanese | |||||
128 |
|
128 | |||
129 | def SJISMultiCell(w,h,txt,border=0,align='L',fill=0) |
|
129 | def SJISMultiCell(w,h,txt,border=0,align='L',fill=0) | |
130 | #Output text with automatic or explicit line breaks |
|
130 | #Output text with automatic or explicit line breaks | |
131 |
cw=@ |
|
131 | cw=@current_font['cw'] | |
132 | if(w==0) |
|
132 | if(w==0) | |
133 |
w=@w-@r |
|
133 | w=@w-@r_margin-@x | |
134 | end |
|
134 | end | |
135 |
wmax=(w-2*@c |
|
135 | wmax=(w-2*@c_margin)*1000/@font_size | |
136 | s=txt.gsub("\r",'') |
|
136 | s=txt.gsub("\r",'') | |
137 | nb=s.length |
|
137 | nb=s.length | |
138 | if(nb>0 and s[nb-1]=="\n") |
|
138 | if(nb>0 and s[nb-1]=="\n") | |
@@ -221,11 +221,11 module PDF_Japanese | |||||
221 | b+='B' |
|
221 | b+='B' | |
222 | end |
|
222 | end | |
223 | Cell(w,h,s[j,i-j],b,2,align,fill) |
|
223 | Cell(w,h,s[j,i-j],b,2,align,fill) | |
224 |
@x=@l |
|
224 | @x=@l_margin | |
225 | end |
|
225 | end | |
226 |
|
226 | |||
227 | def Write(h,txt,link='') |
|
227 | def Write(h,txt,link='') | |
228 |
if(@ |
|
228 | if(@current_font['type']=='Type0') | |
229 | SJISWrite(h,txt,link) |
|
229 | SJISWrite(h,txt,link) | |
230 | else |
|
230 | else | |
231 | super(h,txt,link) |
|
231 | super(h,txt,link) | |
@@ -234,9 +234,9 module PDF_Japanese | |||||
234 |
|
234 | |||
235 | def SJISWrite(h,txt,link) |
|
235 | def SJISWrite(h,txt,link) | |
236 | #SJIS version of Write() |
|
236 | #SJIS version of Write() | |
237 |
cw=@ |
|
237 | cw=@current_font['cw'] | |
238 |
w=@w-@r |
|
238 | w=@w-@r_margin-@x | |
239 |
wmax=(w-2*@c |
|
239 | wmax=(w-2*@c_margin)*1000/@font_size | |
240 | s=txt.gsub("\r",'') |
|
240 | s=txt.gsub("\r",'') | |
241 | nb=s.length |
|
241 | nb=s.length | |
242 | sep=-1 |
|
242 | sep=-1 | |
@@ -257,9 +257,9 module PDF_Japanese | |||||
257 | l=0 |
|
257 | l=0 | |
258 | if(nl==1) |
|
258 | if(nl==1) | |
259 | #Go to left margin |
|
259 | #Go to left margin | |
260 |
@x=@l |
|
260 | @x=@l_margin | |
261 |
w=@w-@r |
|
261 | w=@w-@r_margin-@x | |
262 |
wmax=(w-2*@c |
|
262 | wmax=(w-2*@c_margin)*1000/@font_size | |
263 | end |
|
263 | end | |
264 | nl+=1 |
|
264 | nl+=1 | |
265 | next |
|
265 | next | |
@@ -285,12 +285,12 module PDF_Japanese | |||||
285 | if(l>wmax) |
|
285 | if(l>wmax) | |
286 | #Automatic line break |
|
286 | #Automatic line break | |
287 | if(sep==-1 or i==j) |
|
287 | if(sep==-1 or i==j) | |
288 |
if(@x>@l |
|
288 | if(@x>@l_margin) | |
289 | #Move to next line |
|
289 | #Move to next line | |
290 |
@x=@l |
|
290 | @x=@l_margin | |
291 | @y+=h |
|
291 | @y+=h | |
292 |
w=@w-@r |
|
292 | w=@w-@r_margin-@x | |
293 |
wmax=(w-2*@c |
|
293 | wmax=(w-2*@c_margin)*1000/@font_size | |
294 | i+=n |
|
294 | i+=n | |
295 | nl+=1 |
|
295 | nl+=1 | |
296 | next |
|
296 | next | |
@@ -307,9 +307,9 module PDF_Japanese | |||||
307 | j=i |
|
307 | j=i | |
308 | l=0 |
|
308 | l=0 | |
309 | if(nl==1) |
|
309 | if(nl==1) | |
310 |
@x=@l |
|
310 | @x=@l_margin | |
311 |
w=@w-@r |
|
311 | w=@w-@r_margin-@x | |
312 |
wmax=(w-2*@c |
|
312 | wmax=(w-2*@c_margin)*1000/@font_size | |
313 | end |
|
313 | end | |
314 | nl+=1 |
|
314 | nl+=1 | |
315 | else |
|
315 | else | |
@@ -321,7 +321,7 module PDF_Japanese | |||||
321 | end |
|
321 | end | |
322 | #Last chunk |
|
322 | #Last chunk | |
323 | if(i!=j) |
|
323 | if(i!=j) | |
324 |
Cell(l/1000*@ |
|
324 | Cell(l/1000*@font_size,h,s[j,i-j],0,0,'',0,link) | |
325 | end |
|
325 | end | |
326 | end |
|
326 | end | |
327 |
|
327 | |||
@@ -337,10 +337,10 private | |||||
337 | end |
|
337 | end | |
338 | # mqr=get_magic_quotes_runtime() |
|
338 | # mqr=get_magic_quotes_runtime() | |
339 | # set_magic_quotes_runtime(0) |
|
339 | # set_magic_quotes_runtime(0) | |
340 |
@ |
|
340 | @font_files.each_pair do |file, info| | |
341 | #Font file embedding |
|
341 | #Font file embedding | |
342 | newobj() |
|
342 | newobj() | |
343 |
@ |
|
343 | @font_files[file]['n']=@n | |
344 | if(defined('FPDF_FONTPATH')) |
|
344 | if(defined('FPDF_FONTPATH')) | |
345 | file=FPDF_FONTPATH+file |
|
345 | file=FPDF_FONTPATH+file | |
346 | end |
|
346 | end | |
@@ -414,7 +414,7 private | |||||
414 | end |
|
414 | end | |
415 | file=font['file'] |
|
415 | file=font['file'] | |
416 | if(file) |
|
416 | if(file) | |
417 |
s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@ |
|
417 | s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@font_files[file]['n']+' 0 R' | |
418 | end |
|
418 | end | |
419 | out(s+'>>') |
|
419 | out(s+'>>') | |
420 | out('endobj') |
|
420 | out('endobj') |
@@ -85,7 +85,7 UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9 | |||||
85 | end |
|
85 | end | |
86 |
|
86 | |||
87 | def GetStringWidth(s) |
|
87 | def GetStringWidth(s) | |
88 |
if(@ |
|
88 | if(@current_font['type']=='Type0') | |
89 | return GetMBStringWidth(s) |
|
89 | return GetMBStringWidth(s) | |
90 | else |
|
90 | else | |
91 | return super(s) |
|
91 | return super(s) | |
@@ -95,7 +95,7 UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9 | |||||
95 | def GetMBStringWidth(s) |
|
95 | def GetMBStringWidth(s) | |
96 | #Multi-byte version of GetStringWidth() |
|
96 | #Multi-byte version of GetStringWidth() | |
97 | l=0 |
|
97 | l=0 | |
98 |
cw=@ |
|
98 | cw=@current_font['cw'] | |
99 | nb=s.length |
|
99 | nb=s.length | |
100 | i=0 |
|
100 | i=0 | |
101 | while(i<nb) |
|
101 | while(i<nb) | |
@@ -108,11 +108,11 UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9 | |||||
108 | i+=2 |
|
108 | i+=2 | |
109 | end |
|
109 | end | |
110 | end |
|
110 | end | |
111 |
return l*@ |
|
111 | return l*@font_size/1000 | |
112 | end |
|
112 | end | |
113 |
|
113 | |||
114 | def MultiCell(w,h,txt,border=0,align='L',fill=0) |
|
114 | def MultiCell(w,h,txt,border=0,align='L',fill=0) | |
115 |
if(@ |
|
115 | if(@current_font['type']=='Type0') | |
116 | MBMultiCell(w,h,txt,border,align,fill) |
|
116 | MBMultiCell(w,h,txt,border,align,fill) | |
117 | else |
|
117 | else | |
118 | super(w,h,txt,border,align,fill) |
|
118 | super(w,h,txt,border,align,fill) | |
@@ -121,11 +121,11 UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9 | |||||
121 |
|
121 | |||
122 | def MBMultiCell(w,h,txt,border=0,align='L',fill=0) |
|
122 | def MBMultiCell(w,h,txt,border=0,align='L',fill=0) | |
123 | #Multi-byte version of MultiCell() |
|
123 | #Multi-byte version of MultiCell() | |
124 |
cw=@ |
|
124 | cw=@current_font['cw'] | |
125 | if(w==0) |
|
125 | if(w==0) | |
126 |
w=@w-@r |
|
126 | w=@w-@r_margin-@x | |
127 | end |
|
127 | end | |
128 |
wmax=(w-2*@c |
|
128 | wmax=(w-2*@c_margin)*1000/@font_size | |
129 | s=txt.gsub("\r",'') |
|
129 | s=txt.gsub("\r",'') | |
130 | nb=s.length |
|
130 | nb=s.length | |
131 | if(nb>0 and s[nb-1]=="\n") |
|
131 | if(nb>0 and s[nb-1]=="\n") | |
@@ -202,11 +202,11 UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9 | |||||
202 | b+='B' |
|
202 | b+='B' | |
203 | end |
|
203 | end | |
204 | Cell(w,h,s[j,i-j],b,2,align,fill) |
|
204 | Cell(w,h,s[j,i-j],b,2,align,fill) | |
205 |
@x=@l |
|
205 | @x=@l_margin | |
206 | end |
|
206 | end | |
207 |
|
207 | |||
208 | def Write(h,txt,link='') |
|
208 | def Write(h,txt,link='') | |
209 |
if(@ |
|
209 | if(@current_font['type']=='Type0') | |
210 | MBWrite(h,txt,link) |
|
210 | MBWrite(h,txt,link) | |
211 | else |
|
211 | else | |
212 | super(h,txt,link) |
|
212 | super(h,txt,link) | |
@@ -215,9 +215,9 UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9 | |||||
215 |
|
215 | |||
216 | def MBWrite(h,txt,link) |
|
216 | def MBWrite(h,txt,link) | |
217 | #Multi-byte version of Write() |
|
217 | #Multi-byte version of Write() | |
218 |
cw=@ |
|
218 | cw=@current_font['cw'] | |
219 |
w=@w-@r |
|
219 | w=@w-@r_margin-@x | |
220 |
wmax=(w-2*@c |
|
220 | wmax=(w-2*@c_margin)*1000/@font_size | |
221 | s=txt.gsub("\r",'') |
|
221 | s=txt.gsub("\r",'') | |
222 | nb=s.length |
|
222 | nb=s.length | |
223 | sep=-1 |
|
223 | sep=-1 | |
@@ -238,9 +238,9 UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9 | |||||
238 | j=i |
|
238 | j=i | |
239 | l=0 |
|
239 | l=0 | |
240 | if(nl==1) |
|
240 | if(nl==1) | |
241 |
@x=@l |
|
241 | @x=@l_margin | |
242 |
w=@w-@r |
|
242 | w=@w-@r_margin-@x | |
243 |
wmax=(w-2*@c |
|
243 | wmax=(w-2*@c_margin)*1000/@font_size | |
244 | end |
|
244 | end | |
245 | nl+=1 |
|
245 | nl+=1 | |
246 | next |
|
246 | next | |
@@ -252,12 +252,12 UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9 | |||||
252 | if(l>wmax) |
|
252 | if(l>wmax) | |
253 | #Automatic line break |
|
253 | #Automatic line break | |
254 | if(sep==-1 or i==j) |
|
254 | if(sep==-1 or i==j) | |
255 |
if(@x>@l |
|
255 | if(@x>@l_margin) | |
256 | #Move to next line |
|
256 | #Move to next line | |
257 |
@x=@l |
|
257 | @x=@l_margin | |
258 | @y+=h |
|
258 | @y+=h | |
259 |
w=@w-@r |
|
259 | w=@w-@r_margin-@x | |
260 |
wmax=(w-2*@c |
|
260 | wmax=(w-2*@c_margin)*1000/@font_size | |
261 | i+=1 |
|
261 | i+=1 | |
262 | nl+=1 |
|
262 | nl+=1 | |
263 | next |
|
263 | next | |
@@ -274,9 +274,9 UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9 | |||||
274 | j=i |
|
274 | j=i | |
275 | l=0 |
|
275 | l=0 | |
276 | if(nl==1) |
|
276 | if(nl==1) | |
277 |
@x=@l |
|
277 | @x=@l_margin | |
278 |
w=@w-@r |
|
278 | w=@w-@r_margin-@x | |
279 |
wmax=(w-2*@c |
|
279 | wmax=(w-2*@c_margin)*1000/@font_size | |
280 | end |
|
280 | end | |
281 | nl+=1 |
|
281 | nl+=1 | |
282 | else |
|
282 | else | |
@@ -285,7 +285,7 UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9 | |||||
285 | end |
|
285 | end | |
286 | #Last chunk |
|
286 | #Last chunk | |
287 | if(i!=j) |
|
287 | if(i!=j) | |
288 |
Cell(l/1000*@ |
|
288 | Cell(l/1000*@font_size,h,s[j,i-j],0,0,'',0,link) | |
289 | end |
|
289 | end | |
290 | end |
|
290 | end | |
291 |
|
291 | |||
@@ -301,10 +301,10 private | |||||
301 | end |
|
301 | end | |
302 | # mqr=get_magic_quotes_runtime() |
|
302 | # mqr=get_magic_quotes_runtime() | |
303 | # set_magic_quotes_runtime(0) |
|
303 | # set_magic_quotes_runtime(0) | |
304 |
@ |
|
304 | @font_files.each_pair do |file, info| | |
305 | #Font file embedding |
|
305 | #Font file embedding | |
306 | newobj() |
|
306 | newobj() | |
307 |
@ |
|
307 | @font_files[file]['n']=@n | |
308 | if(defined('FPDF_FONTPATH')) |
|
308 | if(defined('FPDF_FONTPATH')) | |
309 | file=FPDF_FONTPATH+file |
|
309 | file=FPDF_FONTPATH+file | |
310 | end |
|
310 | end | |
@@ -378,7 +378,7 private | |||||
378 | end |
|
378 | end | |
379 | file=font['file'] |
|
379 | file=font['file'] | |
380 | if(file) |
|
380 | if(file) | |
381 |
s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@ |
|
381 | s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@font_files[file]['n']+' 0 R' | |
382 | end |
|
382 | end | |
383 | out(s+'>>') |
|
383 | out(s+'>>') | |
384 | out('endobj') |
|
384 | out('endobj') |
General Comments 0
You need to be logged in to leave comments.
Login now