diff options
author | Karl Berry <karl@freefriends.org> | 2012-08-27 22:12:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-08-27 22:12:41 +0000 |
commit | bb64113f0c117e1f3236a66b9f963b9bca4955e0 (patch) | |
tree | db5f9841c4aabf9cfb2e1c2984e292032ceb6ec0 /Master/texmf-dist/tex/latex/GS1 | |
parent | a65852350dd289d0de23e9b5019613e89de47a4e (diff) |
GS1 (27aug12)
git-svn-id: svn://tug.org/texlive/trunk@27540 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/GS1')
-rw-r--r-- | Master/texmf-dist/tex/latex/GS1/GS1.sty | 43 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/GS1/rule-D.sty | 4 |
2 files changed, 40 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/GS1/GS1.sty b/Master/texmf-dist/tex/latex/GS1/GS1.sty index e7cfb071b29..7c97bf56eee 100644 --- a/Master/texmf-dist/tex/latex/GS1/GS1.sty +++ b/Master/texmf-dist/tex/latex/GS1/GS1.sty @@ -31,8 +31,8 @@ %% The released version of this bundle is available from CTAN. %% %% ------------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: GS1.dtx 9 2012-08-01 09:31:32Z mjk $ +\RequirePackage{expl3} +\GetIdInfo$Id: GS1.dtx 15 2012-08-27 10:25:03Z mjk $ {GS1 code handler and barcode generator} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -119,6 +119,14 @@ nor~a~EAN-13~with~or~without~control~digit.\\\\ The~GS1~module~currently~only~supports~EAN-8~and~EAN~13. } + +\msg_new:nnn { GS1 } { module/minwidth } + { + Resulting~module~width~is~less~than~allowed~minimum~\msg_line_context:.\\\\ + GS1~specification~declares~a~minimum~module~width~of~#2.\\ + Currently~the~module~with~would~be~#1.\\ + To~avoid~problems,~I'll~increase~module~width~to~#2. + } \cs_new_nopar:Npn \GS_set_code_digit_seq:Nn #1#2 { \seq_set_eq:NN #1 \c_empty_seq @@ -220,8 +228,6 @@ { \seq_set_eq:NN \l__GS_code_seq #1 - \leavevmode - \int_compare:nNnTF { \l_GS_code_size_int } { = } { 8 } { \hbox_to_wd:nn { \l_GS_module_wd_dim * 7 } { } @@ -313,7 +319,34 @@ \seq_put_left:Nn \l__GS_code_seq { 0 } } - \GS_use_as_EAN_barcode:N \l__GS_code_seq + \bool_if:NT \l_GS_scale_to_font_bool { + \hbox_set:Nn \l_tmpa_box { 0 } + \dim_set:Nn \l_GS_module_wd_dim { \box_wd:N \l_tmpa_box / 7 } + } + + \dim_set:Nn \l_tmpa_dim + { \fp_to_decimal:N \l_GS_scale_fp \l_GS_module_wd_dim } + + \dim_compare:nNnT + { \l_tmpa_dim } + { < } + { \c__GS_module_min_width_dim } + { + \msg_warning:nnxx { GS1 } { module/minwidth } + { \dim_use:N \l_GS_module_wd_dim } + { \dim_use:N \c__GS_module_min_width_dim } + \dim_set:Nn \l_GS_module_wd_dim + { + \c__GS_module_min_width_dim * + 100 / \fp_to_int:n { 100 * \l_GS_scale_fp } + } + } + + \hbox_set:Nn \l_tmpa_box { \GS_use_as_EAN_barcode:N \l__GS_code_seq } + \box_scale:Nnn \l_tmpa_box + { \fp_to_int:n { 100 * \l_GS_scale_fp } / 100 } + { \fp_to_int:n { 100 * \l_GS_scale_fp } / 100 } + \box_use:N \l_tmpa_box \group_end: } \NewDocumentCommand \GSSetup diff --git a/Master/texmf-dist/tex/latex/GS1/rule-D.sty b/Master/texmf-dist/tex/latex/GS1/rule-D.sty index 73bc9c902a1..ff5e3f8a5fc 100644 --- a/Master/texmf-dist/tex/latex/GS1/rule-D.sty +++ b/Master/texmf-dist/tex/latex/GS1/rule-D.sty @@ -31,8 +31,8 @@ %% The released version of this bundle is available from CTAN. %% %% ------------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: rule-D.dtx 3 2012-07-27 10:33:18Z mjk $ +\RequirePackage{expl3} +\GetIdInfo$Id: rule-D.dtx 15 2012-08-27 10:25:03Z mjk $ {rule functions for LaTeX3} \ProvidesExplPackage {rule-D} {\ExplFileDate} {\ExplFileVersion} |