mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-28 14:04:19 -04:00
- Add text_gap
option to allow adjustment of vertical gap between
barcode and text - EMF/EPS/SVG/GUI: ignore BOLD_TEXT for EAN/UPC - DAFT: up max to 250 chars - EMF/EPS/SVG: fix addon bars placement/length when text hidden - Qt backend: use `QFontMetrics::horizontalAdvance()` rather than `boundingRect()` to calc text width (seems to be more accurate) - library: make printf/sprintf() format arg always literal string - output: fix errtxt nos clash; use array for `out_upcean_split_text()` text parts - raster/vector: smallify addon text printing logic - frontend: warn if output file and direct options both given; add TODO note about `CommandLineToArgvW()` loading shell32.dll - manual: put HRT options in own section
This commit is contained in:
parent
ab2abccdb6
commit
90293ebcda
167 changed files with 2706 additions and 1734 deletions
|
@ -1881,6 +1881,69 @@ the barcode in X-dimensions</string>
|
|||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="lblTextGap">
|
||||
<property name="toolTip">
|
||||
<string>Gap between barcode and text
|
||||
(ignored if disabled)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Text Gap:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>spnTextGap</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QDoubleSpinBox" name="spnTextGap">
|
||||
<property name="toolTip">
|
||||
<string>Gap between barcode and text
|
||||
(ignored if disabled)</string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> X</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="specialValueText">
|
||||
<string>Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QPushButton" name="btnClearTextGap">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>26</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set text gap to zero (default)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="lblScale">
|
||||
<property name="toolTip">
|
||||
<string>Image scale when output to file
|
||||
|
@ -1897,7 +1960,7 @@ the barcode in X-dimensions</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="8" column="1">
|
||||
<widget class="QDoubleSpinBox" name="spnScale">
|
||||
<property name="toolTip">
|
||||
<string>Image scale when output to file
|
||||
|
@ -1923,7 +1986,7 @@ the barcode in X-dimensions</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<item row="8" column="2">
|
||||
<widget class="QPushButton" name="btnScale">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
|
@ -1939,7 +2002,7 @@ the barcode in X-dimensions</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="lblSize">
|
||||
<property name="toolTip">
|
||||
<string>Image size (width x height) of barcode
|
||||
|
@ -1953,7 +2016,7 @@ at given dot density</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="5">
|
||||
<item row="9" column="1" colspan="5">
|
||||
<widget class="QLabel" name="lblSizeMsg">
|
||||
<property name="toolTip">
|
||||
<string>Image size (width x height) of barcode
|
||||
|
|
|
@ -316,6 +316,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags fl)
|
|||
btnClearDataSeg2->setIcon(clearIcon);
|
||||
btnClearDataSeg3->setIcon(clearIcon);
|
||||
btnClearComposite->setIcon(clearIcon);
|
||||
btnClearTextGap->setIcon(clearIcon);
|
||||
btnZap->setIcon(QIcon(QSL(":res/zap.svg")));
|
||||
|
||||
change_options();
|
||||
|
@ -329,6 +330,9 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags fl)
|
|||
connect(bwidth, SIGNAL(valueChanged( int )), SLOT(update_preview()));
|
||||
connect(btype, SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||
connect(cmbFontSetting, SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||
connect(spnTextGap, SIGNAL(valueChanged( double )), SLOT(text_gap_zero()));
|
||||
connect(spnTextGap, SIGNAL(valueChanged( double )), SLOT(update_preview()));
|
||||
connect(btnClearTextGap, SIGNAL(clicked( bool )), SLOT(clear_text_gap()));
|
||||
connect(txtData, SIGNAL(textChanged( const QString& )), SLOT(data_ui_set()));
|
||||
connect(txtData, SIGNAL(textChanged( const QString& )), SLOT(update_preview()));
|
||||
connect(txtDataSeg1, SIGNAL(textChanged( const QString& )), SLOT(data_ui_set()));
|
||||
|
@ -463,6 +467,7 @@ MainWindow::~MainWindow()
|
|||
settings.setValue(QSL("studio/appearance/scale"), spnScale->value());
|
||||
settings.setValue(QSL("studio/appearance/border_type"), btype->currentIndex());
|
||||
settings.setValue(QSL("studio/appearance/font_setting"), cmbFontSetting->currentIndex());
|
||||
settings.setValue(QSL("studio/appearance/text_gap"), spnTextGap->value());
|
||||
settings.setValue(QSL("studio/appearance/chk_hrt_show"), chkHRTShow->isChecked() ? 1 : 0);
|
||||
settings.setValue(QSL("studio/appearance/chk_cmyk"), chkCMYK->isChecked() ? 1 : 0);
|
||||
settings.setValue(QSL("studio/appearance/chk_quiet_zones"), chkQuietZones->isChecked() ? 1 : 0);
|
||||
|
@ -528,6 +533,7 @@ void MainWindow::load_settings(QSettings &settings)
|
|||
spnScale->setValue(settings.value(QSL("studio/appearance/scale"), 1.0).toFloat());
|
||||
btype->setCurrentIndex(settings.value(QSL("studio/appearance/border_type"), 0).toInt());
|
||||
cmbFontSetting->setCurrentIndex(settings.value(QSL("studio/appearance/font_setting"), 0).toInt());
|
||||
spnTextGap->setValue(settings.value(QSL("studio/appearance/text_gap"), 0.0).toFloat());
|
||||
chkHRTShow->setChecked(settings.value(QSL("studio/appearance/chk_hrt_show"), 1).toInt() ? true : false);
|
||||
chkCMYK->setChecked(settings.value(QSL("studio/appearance/chk_cmyk"), 0).toInt() ? true : false);
|
||||
chkQuietZones->setChecked(settings.value(QSL("studio/appearance/chk_quiet_zones"), 0).toInt() ? true : false);
|
||||
|
@ -1141,6 +1147,15 @@ void MainWindow::HRTShow_ui_set()
|
|||
bool enabled = chkHRTShow->isEnabled() && chkHRTShow->isChecked();
|
||||
lblFontSetting->setEnabled(enabled);
|
||||
cmbFontSetting->setEnabled(enabled);
|
||||
lblTextGap->setEnabled(enabled);
|
||||
spnTextGap->setEnabled(enabled);
|
||||
text_gap_ui_set();
|
||||
}
|
||||
|
||||
void MainWindow::text_gap_ui_set()
|
||||
{
|
||||
bool hrtEnabled = chkHRTShow->isEnabled() && chkHRTShow->isChecked();
|
||||
btnClearTextGap->setEnabled(hrtEnabled && spnTextGap->value() != 0.0);
|
||||
}
|
||||
|
||||
void MainWindow::dotty_ui_set()
|
||||
|
@ -1244,6 +1259,23 @@ void MainWindow::structapp_ui_set()
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::text_gap_zero()
|
||||
{
|
||||
// Make sure special text "Default" triggered as QDoubleSpinBox can return values almost but not quite zero
|
||||
double val = spnTextGap->value();
|
||||
if (val != 0.0 && val < 0.0001) {
|
||||
spnTextGap->setValue(0.0);
|
||||
}
|
||||
text_gap_ui_set();
|
||||
}
|
||||
|
||||
void MainWindow::clear_text_gap()
|
||||
{
|
||||
spnTextGap->setValue(0.0);
|
||||
spnTextGap->setFocus();
|
||||
update_preview();
|
||||
}
|
||||
|
||||
void MainWindow::on_encoded()
|
||||
{
|
||||
// Protect against encode in Sequence Export popup dialog
|
||||
|
@ -2130,9 +2162,10 @@ void MainWindow::change_options()
|
|||
file.close();
|
||||
load_sub_settings(settings, symbology);
|
||||
tabMain->insertTab(1, m_optionWidget, tr("UPC-&A"));
|
||||
combobox_item_enabled(cmbFontSetting, 1, false);
|
||||
if (cmbFontSetting->currentIndex() == 1) {
|
||||
cmbFontSetting->setCurrentIndex(0);
|
||||
combobox_item_enabled(cmbFontSetting, 1, false); // Disable bold options
|
||||
combobox_item_enabled(cmbFontSetting, 3, false);
|
||||
if (cmbFontSetting->currentIndex() == 1 || cmbFontSetting->currentIndex() == 3) {
|
||||
cmbFontSetting->setCurrentIndex(cmbFontSetting->currentIndex() - 1);
|
||||
}
|
||||
connect(get_widget(QSL("cmbUPCAAddonGap")), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||
connect(get_widget(QSL("spnUPCAGuardDescent")), SIGNAL(valueChanged( double )), SLOT(update_preview()));
|
||||
|
@ -2155,9 +2188,10 @@ void MainWindow::change_options()
|
|||
} else {
|
||||
tabMain->insertTab(1, m_optionWidget, tr("&EAN"));
|
||||
}
|
||||
combobox_item_enabled(cmbFontSetting, 1, false);
|
||||
if (cmbFontSetting->currentIndex() == 1) {
|
||||
cmbFontSetting->setCurrentIndex(0);
|
||||
combobox_item_enabled(cmbFontSetting, 1, false); // Disable bold options
|
||||
combobox_item_enabled(cmbFontSetting, 3, false);
|
||||
if (cmbFontSetting->currentIndex() == 1 || cmbFontSetting->currentIndex() == 3) {
|
||||
cmbFontSetting->setCurrentIndex(cmbFontSetting->currentIndex() - 1);
|
||||
}
|
||||
connect(get_widget(QSL("cmbUPCEANAddonGap")), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||
connect(get_widget(QSL("spnUPCEANGuardDescent")), SIGNAL(valueChanged( double )), SLOT(update_preview()));
|
||||
|
@ -3166,6 +3200,7 @@ void MainWindow::update_preview()
|
|||
m_bc.bc.setVWhitespace(spnVWhitespace->value());
|
||||
m_bc.bc.setQuietZones(chkQuietZones->isEnabled() && chkQuietZones->isChecked());
|
||||
m_bc.bc.setFontSetting(cmbFontSetting->currentIndex());
|
||||
m_bc.bc.setTextGap(spnTextGap->value());
|
||||
m_bc.bc.setRotateAngle(cmbRotate->currentIndex());
|
||||
m_bc.bc.setDotty(chkDotty->isEnabled() && chkDotty->isChecked());
|
||||
if (m_symbology == BARCODE_DOTCODE || (chkDotty->isEnabled() && chkDotty->isChecked())) {
|
||||
|
@ -3940,6 +3975,7 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology)
|
|||
settings.setValue(QSL("studio/bc/%1/appearance/border_type").arg(name), btype->currentIndex());
|
||||
if (chkHRTShow->isEnabled()) {
|
||||
settings.setValue(QSL("studio/bc/%1/appearance/font_setting").arg(name), cmbFontSetting->currentIndex());
|
||||
settings.setValue(QSL("studio/bc/%1/appearance/text_gap").arg(name), spnTextGap->value());
|
||||
settings.setValue(QSL("studio/bc/%1/appearance/chk_hrt_show").arg(name), chkHRTShow->isChecked() ? 1 : 0);
|
||||
}
|
||||
settings.setValue(QSL("studio/bc/%1/appearance/chk_cmyk").arg(name), chkCMYK->isChecked() ? 1 : 0);
|
||||
|
@ -4334,6 +4370,7 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology)
|
|||
if (chkHRTShow->isEnabled()) {
|
||||
cmbFontSetting->setCurrentIndex(settings.value(
|
||||
QSL("studio/bc/%1/appearance/font_setting").arg(name), 0).toInt());
|
||||
spnTextGap->setValue(settings.value(QSL("studio/bc/%1/appearance/text_gap").arg(name), 0.0).toFloat());
|
||||
chkHRTShow->setChecked(settings.value(
|
||||
QSL("studio/bc/%1/appearance/chk_hrt_show").arg(name), 1).toInt() ? true : false);
|
||||
}
|
||||
|
|
|
@ -69,9 +69,12 @@ public slots:
|
|||
void change_cmyk();
|
||||
void autoheight_ui_set();
|
||||
void HRTShow_ui_set();
|
||||
void text_gap_ui_set();
|
||||
void dotty_ui_set();
|
||||
void codeone_ui_set();
|
||||
void structapp_ui_set();
|
||||
void text_gap_zero();
|
||||
void clear_text_gap();
|
||||
void on_encoded();
|
||||
void on_errored();
|
||||
void on_dataChanged(const QString& text, bool escaped, int seg_no);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue