Removed font from settings. Fixt it to DejaVuSans
这个提交包含在:
父节点
71d861f8b7
当前提交
4bb448d369
共有 3 个文件被更改,包括 33 次插入 和 126 次删除
|
|
@ -8,7 +8,7 @@ use Cloudlog\Label\font\unifont\ttfonts;
|
|||
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Labels extends CI_Controller {
|
||||
/*
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Controller: Labels
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -16,7 +16,7 @@ class Labels extends CI_Controller {
|
|||
| This Controller handles all things Labels, creating, editing and printing
|
||||
|
|
||||
|
|
||||
*/
|
||||
*/
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
|
|
@ -35,7 +35,7 @@ class Labels extends CI_Controller {
|
|||
| Nothing fancy just shows the main display of how many labels are waiting
|
||||
| to be printed per station profile.
|
||||
|
|
||||
*/
|
||||
*/
|
||||
public function index() {
|
||||
$data['page_title'] = "QSL Card Labels";
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ class Labels extends CI_Controller {
|
|||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('labels/index');
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -63,9 +63,9 @@ class Labels extends CI_Controller {
|
|||
|
|
||||
| Shows the form used to create a label type.
|
||||
|
|
||||
*/
|
||||
*/
|
||||
public function create() {
|
||||
|
||||
|
||||
$data['page_title'] = "Create Label Type";
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
|
@ -82,10 +82,10 @@ class Labels extends CI_Controller {
|
|||
{
|
||||
$this->load->model('labels_model');
|
||||
$this->labels_model->addLabel();
|
||||
|
||||
|
||||
redirect('labels');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function printids() {
|
||||
|
|
@ -104,11 +104,13 @@ class Labels extends CI_Controller {
|
|||
|
||||
$this->prepareLabel($result);
|
||||
}
|
||||
|
||||
|
||||
function prepareLabel($qsos, $jscall = false) {
|
||||
$this->load->model('labels_model');
|
||||
$label = $this->labels_model->getDefaultLabel();
|
||||
|
||||
$label->font='DejaVuSans'; // Fix font to DejaVuSans
|
||||
|
||||
|
||||
try {
|
||||
if ($label) {
|
||||
$pdf = new PDF_Label(array(
|
||||
|
|
@ -145,20 +147,20 @@ class Labels extends CI_Controller {
|
|||
}
|
||||
}
|
||||
define('FPDF_FONTPATH', './src/Label/font/');
|
||||
|
||||
|
||||
$pdf->AddPage();
|
||||
|
||||
if ($label->font == 'DejaVuSans') {
|
||||
|
||||
if ($label->font == 'DejaVuSans') { // leave this here, for future Use
|
||||
$pdf->AddFont($label->font,'','DejaVuSansMono.ttf',true);
|
||||
$pdf->SetFont($label->font);
|
||||
} else {
|
||||
$pdf->AddFont($label->font);
|
||||
$pdf->SetFont($label->font);
|
||||
}
|
||||
|
||||
|
||||
if ($qsos->num_rows() > 0) {
|
||||
if ($label->qsos == 1) {
|
||||
$this->makeOneQsoLabel($qsos->result(), $pdf);
|
||||
$this->makeMultiQsoLabel($qsos->result(), $pdf,1);
|
||||
} else {
|
||||
$this->makeMultiQsoLabel($qsos->result(), $pdf, $label->qsos);
|
||||
}
|
||||
|
|
@ -169,20 +171,6 @@ class Labels extends CI_Controller {
|
|||
$pdf->Output();
|
||||
}
|
||||
|
||||
function makeOneQsoLabel($qsos, $pdf) {
|
||||
foreach($qsos as $qso) {
|
||||
$time = strtotime($qso->COL_TIME_ON);
|
||||
$myFormatForView = date("d/m/Y H:i", $time);
|
||||
if($qso->COL_SAT_NAME != "") {
|
||||
$text = sprintf("%s\n\n%s %s\n%s %s \n\n%s", 'To: '.$qso->COL_CALL, $myFormatForView, 'on '.$qso->COL_BAND.' 2x'.$qso->COL_MODE.' RST '.$qso->COL_RST_SENT.'', 'Satellite: '.$qso->COL_SAT_NAME.' Mode: '.strtoupper($qso->COL_SAT_MODE).' ', '', 'Thanks for QSO.');
|
||||
} else {
|
||||
$text = sprintf("%s\n\n%s %s\n%s %s \n\n%s", 'To: '.$qso->COL_CALL, $myFormatForView, 'on '.$qso->COL_BAND.' 2x'.$qso->COL_MODE.' RST '.$qso->COL_RST_SENT.'', '', '', 'Thanks for QSO.');
|
||||
}
|
||||
|
||||
$pdf->Add_Label($text);
|
||||
}
|
||||
}
|
||||
|
||||
function makeMultiQsoLabel($qsos, $pdf, $numberofqsos) {
|
||||
$text = '';
|
||||
$current_callsign = '';
|
||||
|
|
@ -210,7 +198,7 @@ class Labels extends CI_Controller {
|
|||
$this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos);
|
||||
}
|
||||
}
|
||||
// New begin
|
||||
// New begin
|
||||
|
||||
function finalizeData($pdf, $current_callsign, &$preliminaryData, $qso_per_label) {
|
||||
$tableData = [];
|
||||
|
|
@ -241,56 +229,22 @@ class Labels extends CI_Controller {
|
|||
}
|
||||
}
|
||||
|
||||
function generateLabel($pdf, $current_callsign, $tableData,$numofqsos,$qso){
|
||||
$builder = new \AsciiTable\Builder();
|
||||
$builder->addRows($tableData);
|
||||
$text = "Confirming QSO".($numofqsos>1 ? 's' : '')." with ";
|
||||
$text .= $current_callsign;
|
||||
$text .= "\n";
|
||||
$text .= $builder->renderTable();
|
||||
if($qso['sat'] != "") {
|
||||
$text .= "\n".'Satellite: '.$qso['sat'].' Mode: '.strtoupper($qso['sat_mode']);
|
||||
}
|
||||
$text .= "\nThanks for the QSO".($numofqsos>1 ? 's' : '');
|
||||
$pdf->Add_Label($text);
|
||||
}
|
||||
|
||||
// New End
|
||||
|
||||
function makeLabel($pdf, $current_callsign, $qso_data, $numberofqsos) {
|
||||
$text = 'To: ' . $current_callsign . "\n\n";
|
||||
$count = 0;
|
||||
$qsotext = '';
|
||||
foreach ($qso_data as $key => $qso) {
|
||||
$time = strtotime($qso['time']);
|
||||
$myFormatForView = date("d/m/Y H:i", $time);
|
||||
|
||||
if($qso['sat'] != "") {
|
||||
$qsotext .= sprintf("%s %s %s %s\n", $myFormatForView, 'on '.$qso['band'].' 2x'.$qso['mode'].' RST '.$qso['rst'].'', 'Satellite: '.$qso['sat'].' Mode: '.strtoupper($qso['sat_mode']).' ', '');
|
||||
} else {
|
||||
$qsotext .= sprintf("%s %s\n", $myFormatForView, 'on '.$qso['band'].' 2x'.$qso['mode'].' RST '.$qso['rst']);
|
||||
}
|
||||
$count++;
|
||||
|
||||
if ($count == $numberofqsos) {
|
||||
$text .= $qsotext;
|
||||
$text .= "\n" . 'Thanks for QSOs.';
|
||||
$pdf->Add_Label($text);
|
||||
$text = 'To: ' . $current_callsign . "\n\n";
|
||||
$count = 0;
|
||||
$qsotext = '';
|
||||
}
|
||||
unset($qso_data[$key]);
|
||||
function generateLabel($pdf, $current_callsign, $tableData,$numofqsos,$qso){
|
||||
$builder = new \AsciiTable\Builder();
|
||||
$builder->addRows($tableData);
|
||||
$text = "Confirming QSO".($numofqsos>1 ? 's' : '')." with ";
|
||||
$text .= $current_callsign;
|
||||
$text .= "\n";
|
||||
$text .= $builder->renderTable();
|
||||
if($qso['sat'] != "") {
|
||||
$text .= "\n".'Satellite: '.$qso['sat'].' Mode: '.strtoupper($qso['sat_mode']);
|
||||
}
|
||||
|
||||
if ($qsotext != '') {
|
||||
$text .= $qsotext;
|
||||
$text .= "\n" . 'Thanks for QSOs.';
|
||||
$pdf->Add_Label($text);
|
||||
}
|
||||
|
||||
$text .= "\nThanks for the QSO".($numofqsos>1 ? 's' : '');
|
||||
$pdf->Add_Label($text);
|
||||
}
|
||||
|
||||
// New End
|
||||
|
||||
public function edit($id) {
|
||||
$this->load->model('labels_model');
|
||||
|
||||
|
|
|
|||
|
|
@ -111,29 +111,6 @@
|
|||
</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>
|
||||
|
|
@ -141,4 +118,4 @@
|
|||
</form>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
|
|
|||
|
|
@ -110,30 +110,6 @@
|
|||
<input name="label_qsos" type="number" min="1" max="40" step="1" class="form-control" id="label_qsos" aria-describedby="font_sizeHelp" value="<?php if(isset($label->qsos)) { echo $label->qsos; } ?>">
|
||||
</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>
|
||||
|
|
@ -141,4 +117,4 @@
|
|||
</form>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
|
|
|||
正在加载…
在新工单中引用