[QSL Labels] Switched to tFPDF. Added font selection
这个提交包含在:
		
							父节点
							
								
									1e37778480
								
							
						
					
					
						当前提交
						e384f9989d
					
				
					共有  33 个文件被更改,包括 3753 次插入 和 2 次删除
				
			
		|  | @ -1,7 +1,8 @@ | |||
| <?php  | ||||
| 
 | ||||
| use Cloudlog\Label\PDF_Label; | ||||
| use Cloudlog\Label\fpdf; | ||||
| use Cloudlog\Label\tfpdf; | ||||
| use Cloudlog\Label\font\unifont\ttfonts; | ||||
| 
 | ||||
| if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | ||||
| 
 | ||||
|  | @ -126,9 +127,19 @@ class Labels extends CI_Controller { | |||
| 			$this->session->set_flashdata('error', 'Something went wrong! The label could not be generated. Check label size and font size.');  | ||||
| 			redirect('labels'); | ||||
| 		} | ||||
| 		define('FPDF_FONTPATH', './src/Label/font/'); | ||||
| 
 | ||||
| 		$pdf->AddPage(); | ||||
| 
 | ||||
| 		if ($label->font == 'DejaVuSans') { | ||||
| 			$pdf->AddFont($label->font,'','DejaVuSansMono.ttf',true); | ||||
| 			$pdf->SetFont($label->font); | ||||
| 		} else { | ||||
| 			$pdf->AddFont($label->font); | ||||
| 			$pdf->SetFont($label->font); | ||||
| 		} | ||||
| 
 | ||||
| 
 | ||||
| 		if ($result->num_rows() > 0) { | ||||
| 			if ($label->qsos == 1) { | ||||
| 				$this->makeOneQsoLabel($result->result(), $pdf); | ||||
|  |  | |||
|  | @ -88,6 +88,12 @@ class Migration_create_label_types_table extends CI_Migration { | |||
|                     'null' => TRUE, | ||||
|                 ), | ||||
| 
 | ||||
|                 'font' => array( | ||||
|                     'type' => 'VARCHAR', | ||||
|                     'constraint' => '250', | ||||
|                     'null' => TRUE, | ||||
|                 ), | ||||
| 
 | ||||
|                 'qsos' => array( | ||||
|                     'type' => 'INT', | ||||
|                     'constraint' => '5', | ||||
|  |  | |||
|  | @ -17,6 +17,7 @@ class Labels_model extends CI_Model { | |||
|             'height' 		=> xss_clean($this->input->post('height', true)), | ||||
|             'font_size' 	=> xss_clean($this->input->post('font_size', true)), | ||||
|             'qsos' 		    => xss_clean($this->input->post('label_qsos', true)), | ||||
|             'font' 		    => xss_clean($this->input->post('font', true)), | ||||
|             'last_modified' => date('Y-m-d H:i:s'), | ||||
| 		); | ||||
| 
 | ||||
|  | @ -48,6 +49,7 @@ class Labels_model extends CI_Model { | |||
|             'height' 		=> xss_clean($this->input->post('height', true)), | ||||
|             'font_size' 	=> xss_clean($this->input->post('font_size', true)), | ||||
|             'qsos' 		    => xss_clean($this->input->post('label_qsos', true)), | ||||
|             'font' 		    => xss_clean($this->input->post('font', true)), | ||||
|             'last_modified' => date('Y-m-d H:i:s'), | ||||
| 		); | ||||
| 
 | ||||
|  |  | |||
|  | @ -111,6 +111,29 @@ | |||
| 			    </div> | ||||
|   			</div> | ||||
| 
 | ||||
| 			  <div class="form-group row"> | ||||
|     			<label class="col-sm-2 col-form-label" for="font">Font</label> | ||||
| 			    <div class="col-sm-4"> | ||||
| 				    <select name="font" class="form-control" id="font"> | ||||
| 						<option value="courier">Courier</option> | ||||
| 						<option value="courierb">Courierb</option> | ||||
| 						<option value="courierbi">Courierbi</option> | ||||
| 						<option value="courieri">Courieri</option> | ||||
| 						<option value="DejaVuSans">DejaVuSans</option> | ||||
| 						<option value="helvetica">Helvetica</option> | ||||
| 						<option value="helveticab">Helveticab</option> | ||||
| 						<option value="helveticabi">Helveticabi</option> | ||||
| 						<option value="helveticai">Helveticai</option> | ||||
| 						<option value="symbol">Symbol</option> | ||||
| 						<option value="times">Times</option> | ||||
| 						<option value="timesb">Timesb</option> | ||||
| 						<option value="timesb">Timesb</option> | ||||
| 						<option value="timesbi">Timesbi</option> | ||||
| 						<option value="zapfdingbats">Zapfdingbats</option> | ||||
| 					</select> | ||||
| 			    </div> | ||||
|   			</div> | ||||
| 
 | ||||
|   			<button type="submit" class="btn btn-primary"><i class="fas fa-plus-square"></i> Save Label Type</button> | ||||
| 		</div> | ||||
| 	</div> | ||||
|  |  | |||
|  | @ -111,6 +111,29 @@ | |||
| 			    </div> | ||||
|   			</div> | ||||
| 
 | ||||
| 			<div class="form-group row"> | ||||
|     			<label class="col-sm-2 col-form-label" for="font">Font</label> | ||||
| 			    <div class="col-sm-4"> | ||||
| 				    <select name="font" class="form-control" id="font"> | ||||
| 						<option value="courier" <?php if($label->font == "courier") { echo "selected=\"selected\""; } ?>>Courier</option>
 | ||||
| 						<option value="courierb" <?php if($label->font == "courierb") { echo "selected=\"selected\""; } ?>>Courierb</option>
 | ||||
| 						<option value="courierbi" <?php if($label->font == "courierbi") { echo "selected=\"selected\""; } ?>>Courierbi</option>
 | ||||
| 						<option value="courieri" <?php if($label->font == "courieri") { echo "selected=\"selected\""; } ?>>Courieri</option>
 | ||||
| 						<option value="DejaVuSans" <?php if($label->font == "DejaVuSans") { echo "selected=\"selected\""; } ?>>DejaVuSans</option>
 | ||||
| 						<option value="helvetica" <?php if($label->font == "helvetica") { echo "selected=\"selected\""; } ?>>Helvetica</option>
 | ||||
| 						<option value="helveticab" <?php if($label->font == "helveticab") { echo "selected=\"selected\""; } ?>>Helveticab</option>
 | ||||
| 						<option value="helveticabi" <?php if($label->font == "helveticabi") { echo "selected=\"selected\""; } ?>>Helveticabi</option>
 | ||||
| 						<option value="helveticai" <?php if($label->font == "helveticai") { echo "selected=\"selected\""; } ?>>Helveticai</option>
 | ||||
| 						<option value="symbol" <?php if($label->font == "symbol") { echo "selected=\"selected\""; } ?>>Symbol</option>
 | ||||
| 						<option value="times" <?php if($label->font == "times") { echo "selected=\"selected\""; } ?>>Times</option>
 | ||||
| 						<option value="timesb" <?php if($label->font == "timesb") { echo "selected=\"selected\""; } ?>>Timesb</option>
 | ||||
| 						<option value="timesb" <?php if($label->font == "timesb") { echo "selected=\"selected\""; } ?>>Timesb</option>
 | ||||
| 						<option value="timesbi" <?php if($label->font == "timesbi") { echo "selected=\"selected\""; } ?>>Timesbi</option>
 | ||||
| 						<option value="zapfdingbats" <?php if($label->font == "zapfdingbats") { echo "selected=\"selected\""; } ?>>Zapfdingbats</option>
 | ||||
| 					</select> | ||||
| 			    </div> | ||||
|   			</div> | ||||
| 
 | ||||
|   			<button type="submit" class="btn btn-primary"><i class="fas fa-plus-square"></i> Save Label Type</button> | ||||
| 		</div> | ||||
| 	</div> | ||||
|  |  | |||
|  | @ -39,7 +39,7 @@ | |||
| **/ | ||||
| namespace Cloudlog\Label; | ||||
| 
 | ||||
| class PDF_Label extends fpdf { | ||||
| class PDF_Label extends tfpdf { | ||||
| 
 | ||||
|     // Private properties
 | ||||
|     protected $_Margin_Left;        // Left margin of labels
 | ||||
|  |  | |||
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							
										
											二进制文件未显示。
										
									
								
							|  | @ -0,0 +1,99 @@ | |||
| Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. | ||||
| Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) | ||||
| 
 | ||||
| Bitstream Vera Fonts Copyright | ||||
| ------------------------------ | ||||
| 
 | ||||
| Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is | ||||
| a trademark of Bitstream, Inc. | ||||
| 
 | ||||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
| of the fonts accompanying this license ("Fonts") and associated | ||||
| documentation files (the "Font Software"), to reproduce and distribute the | ||||
| Font Software, including without limitation the rights to use, copy, merge, | ||||
| publish, distribute, and/or sell copies of the Font Software, and to permit | ||||
| persons to whom the Font Software is furnished to do so, subject to the | ||||
| following conditions: | ||||
| 
 | ||||
| The above copyright and trademark notices and this permission notice shall | ||||
| be included in all copies of one or more of the Font Software typefaces. | ||||
| 
 | ||||
| The Font Software may be modified, altered, or added to, and in particular | ||||
| the designs of glyphs or characters in the Fonts may be modified and | ||||
| additional glyphs or characters may be added to the Fonts, only if the fonts | ||||
| are renamed to names not containing either the words "Bitstream" or the word | ||||
| "Vera". | ||||
| 
 | ||||
| This License becomes null and void to the extent applicable to Fonts or Font | ||||
| Software that has been modified and is distributed under the "Bitstream | ||||
| Vera" names. | ||||
| 
 | ||||
| The Font Software may be sold as part of a larger software package but no | ||||
| copy of one or more of the Font Software typefaces may be sold by itself. | ||||
| 
 | ||||
| THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
| OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, | ||||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, | ||||
| TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME | ||||
| FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING | ||||
| ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, | ||||
| WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF | ||||
| THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE | ||||
| FONT SOFTWARE. | ||||
| 
 | ||||
| Except as contained in this notice, the names of Gnome, the Gnome | ||||
| Foundation, and Bitstream Inc., shall not be used in advertising or | ||||
| otherwise to promote the sale, use or other dealings in this Font Software | ||||
| without prior written authorization from the Gnome Foundation or Bitstream | ||||
| Inc., respectively. For further information, contact: fonts at gnome dot | ||||
| org.  | ||||
| 
 | ||||
| Arev Fonts Copyright | ||||
| ------------------------------ | ||||
| 
 | ||||
| Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. | ||||
| 
 | ||||
| Permission is hereby granted, free of charge, to any person obtaining | ||||
| a copy of the fonts accompanying this license ("Fonts") and | ||||
| associated documentation files (the "Font Software"), to reproduce | ||||
| and distribute the modifications to the Bitstream Vera Font Software, | ||||
| including without limitation the rights to use, copy, merge, publish, | ||||
| distribute, and/or sell copies of the Font Software, and to permit | ||||
| persons to whom the Font Software is furnished to do so, subject to | ||||
| the following conditions: | ||||
| 
 | ||||
| The above copyright and trademark notices and this permission notice | ||||
| shall be included in all copies of one or more of the Font Software | ||||
| typefaces. | ||||
| 
 | ||||
| The Font Software may be modified, altered, or added to, and in | ||||
| particular the designs of glyphs or characters in the Fonts may be | ||||
| modified and additional glyphs or characters may be added to the | ||||
| Fonts, only if the fonts are renamed to names not containing either | ||||
| the words "Tavmjong Bah" or the word "Arev". | ||||
| 
 | ||||
| This License becomes null and void to the extent applicable to Fonts | ||||
| or Font Software that has been modified and is distributed under the  | ||||
| "Tavmjong Bah Arev" names. | ||||
| 
 | ||||
| The Font Software may be sold as part of a larger software package but | ||||
| no copy of one or more of the Font Software typefaces may be sold by | ||||
| itself. | ||||
| 
 | ||||
| THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF | ||||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT | ||||
| OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL | ||||
| TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||||
| INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL | ||||
| DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||||
| FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM | ||||
| OTHER DEALINGS IN THE FONT SOFTWARE. | ||||
| 
 | ||||
| Except as contained in this notice, the name of Tavmjong Bah shall not | ||||
| be used in advertising or otherwise to promote the sale, use or other | ||||
| dealings in this Font Software without prior written authorization | ||||
| from Tavmjong Bah. For further information, contact: tavmjong @ free | ||||
| . fr. | ||||
| 
 | ||||
| $Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $ | ||||
										
											二进制文件未显示。
										
									
								
							|  | @ -0,0 +1,107 @@ | |||
| <?php | ||||
| $rangeid=32; | ||||
| $prevcid=126; | ||||
| $prevwidth=602; | ||||
| $interval=true; | ||||
| $range=array ( | ||||
|   32 =>  | ||||
|   array ( | ||||
|     0 => 602, | ||||
|     1 => 602, | ||||
|     'interval' => true, | ||||
|     2 => 602, | ||||
|     3 => 602, | ||||
|     4 => 602, | ||||
|     5 => 602, | ||||
|     6 => 602, | ||||
|     7 => 602, | ||||
|     8 => 602, | ||||
|     9 => 602, | ||||
|     10 => 602, | ||||
|     11 => 602, | ||||
|     12 => 602, | ||||
|     13 => 602, | ||||
|     14 => 602, | ||||
|     15 => 602, | ||||
|     16 => 602, | ||||
|     17 => 602, | ||||
|     18 => 602, | ||||
|     19 => 602, | ||||
|     20 => 602, | ||||
|     21 => 602, | ||||
|     22 => 602, | ||||
|     23 => 602, | ||||
|     24 => 602, | ||||
|     25 => 602, | ||||
|     26 => 602, | ||||
|     27 => 602, | ||||
|     28 => 602, | ||||
|     29 => 602, | ||||
|     30 => 602, | ||||
|     31 => 602, | ||||
|     32 => 602, | ||||
|     33 => 602, | ||||
|     34 => 602, | ||||
|     35 => 602, | ||||
|     36 => 602, | ||||
|     37 => 602, | ||||
|     38 => 602, | ||||
|     39 => 602, | ||||
|     40 => 602, | ||||
|     41 => 602, | ||||
|     42 => 602, | ||||
|     43 => 602, | ||||
|     44 => 602, | ||||
|     45 => 602, | ||||
|     46 => 602, | ||||
|     47 => 602, | ||||
|     48 => 602, | ||||
|     49 => 602, | ||||
|     50 => 602, | ||||
|     51 => 602, | ||||
|     52 => 602, | ||||
|     53 => 602, | ||||
|     54 => 602, | ||||
|     55 => 602, | ||||
|     56 => 602, | ||||
|     57 => 602, | ||||
|     58 => 602, | ||||
|     59 => 602, | ||||
|     60 => 602, | ||||
|     61 => 602, | ||||
|     62 => 602, | ||||
|     63 => 602, | ||||
|     64 => 602, | ||||
|     65 => 602, | ||||
|     66 => 602, | ||||
|     67 => 602, | ||||
|     68 => 602, | ||||
|     69 => 602, | ||||
|     70 => 602, | ||||
|     71 => 602, | ||||
|     72 => 602, | ||||
|     73 => 602, | ||||
|     74 => 602, | ||||
|     75 => 602, | ||||
|     76 => 602, | ||||
|     77 => 602, | ||||
|     78 => 602, | ||||
|     79 => 602, | ||||
|     80 => 602, | ||||
|     81 => 602, | ||||
|     82 => 602, | ||||
|     83 => 602, | ||||
|     84 => 602, | ||||
|     85 => 602, | ||||
|     86 => 602, | ||||
|     87 => 602, | ||||
|     88 => 602, | ||||
|     89 => 602, | ||||
|     90 => 602, | ||||
|     91 => 602, | ||||
|     92 => 602, | ||||
|     93 => 602, | ||||
|     94 => 602, | ||||
|   ), | ||||
| ); | ||||
| ?>
 | ||||
|  | @ -0,0 +1,19 @@ | |||
| <?php | ||||
| $name='DejaVuSansMono'; | ||||
| $type='TTF'; | ||||
| $desc=array ( | ||||
|   'Ascent' => 928.0, | ||||
|   'Descent' => -236.0, | ||||
|   'CapHeight' => 928.0, | ||||
|   'Flags' => 5, | ||||
|   'FontBBox' => '[-558 -375 718 1028]', | ||||
|   'ItalicAngle' => 0.0, | ||||
|   'StemV' => 87.0, | ||||
|   'MissingWidth' => 602.0, | ||||
| ); | ||||
| $up=-63; | ||||
| $ut=44; | ||||
| $ttffile='./src/Label/font/unifont/DejaVuSansMono.ttf'; | ||||
| $originalsize=340712; | ||||
| $fontkey='dejavusans'; | ||||
| ?>
 | ||||
							
								
								
									
										1090
									
								
								src/Label/font/unifont/ttfonts.php
									
									
									
									
									
										普通文件
									
								
							
							
						
						
									
										1090
									
								
								src/Label/font/unifont/ttfonts.php
									
									
									
									
									
										普通文件
									
								
							
										
											
												文件差异内容过多而无法显示
												加载差异
											
										
									
								
							
							
								
								
									
										2371
									
								
								src/Label/tfpdf.php
									
									
									
									
									
										普通文件
									
								
							
							
						
						
									
										2371
									
								
								src/Label/tfpdf.php
									
									
									
									
									
										普通文件
									
								
							
										
											
												文件差异内容过多而无法显示
												加载差异
											
										
									
								
							
		正在加载…
	
		在新工单中引用