summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ocr-latex/ocr.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/ocr-latex/ocr.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/ocr-latex/ocr.sty')
-rw-r--r--macros/latex/contrib/ocr-latex/ocr.sty42
1 files changed, 42 insertions, 0 deletions
diff --git a/macros/latex/contrib/ocr-latex/ocr.sty b/macros/latex/contrib/ocr-latex/ocr.sty
new file mode 100644
index 0000000000..02d125c315
--- /dev/null
+++ b/macros/latex/contrib/ocr-latex/ocr.sty
@@ -0,0 +1,42 @@
+\ProvidesPackage{ocr}[2006/09/18 LaTeX support for the various OCR
+fonts. Created by Palle Jorgensen, hamselv@pallej.dk]
+
+\RequirePackage{ifthen}
+
+\def\ocrdefault{ocrb}
+\DeclareOption{ocr-a}{\def\ocrdefault{ocra}}
+\DeclareOption{oca}{\def\ocrdefault{oca}%
+ \PackageWarning{ocr}{The OCA fonts are buggy. Use the 'ocr-a' option
+ to get proper OCR-A fonts.^^J}}
+\DeclareOption{ocr-b}{\def\ocrdefault{ocrb}}
+\DeclareOption{ocr-b-outline}{\def\ocrdefault{ocrbo}}
+\DeclareOption{ocr-b-negative}{\def\ocrdefault{ocrbn}}
+\DeclareOption{ocr-b-sharp}{\def\ocrdefault{ocrbs}%
+ \PackageWarning{ocr}{The sharp OCR-B fonts are buggy. Use with care.^^J}}
+\DeclareOption{ocr-b-sharp-negative}{\def\ocrdefault{ocrbns}%
+ \PackageWarning{ocr}{The sharp OCR-B fonts are buggy. Use with care.^^J}}
+\ProcessOptions*
+
+\def\ocrfamily{\fontencoding{OT1}\fontfamily{\ocrdefault}\selectfont}
+\DeclareTextFontCommand{\ocr}{\ocrfamily}
+
+\def\ocrnegfamily{%
+ \ifthenelse{\equal{\ocrdefault}{ocrb}}{}{%
+ \PackageWarning{ocr}{%
+ Using the 'negative OCR-B' fonts without using the\MessageBreak
+ OCR-B fonts may give a funny result.^^J}}
+ \fontencoding{OT1}\fontfamily{ocrbn}\selectfont}
+
+\def\ocrs@negfamily{%
+ \ifthenelse{\equal{\ocrdefault}{ocrbs}}{}{
+ \PackageWarning{ocr}{%
+ Using the 'negative OCR-B Sharp' fonts without using the\MessageBreak
+ OCR-B Sharp fonts may give a funny result.^^J}}
+ \fontencoding{OT1}\fontfamily{ocrbns}\selectfont}
+
+\ifthenelse{\equal{\ocrdefault}{ocrbs}}{%
+ \def\ocrnegfamily{\ocrs@negfamily}}{}
+
+\DeclareTextFontCommand{\ocrneg}{\ocrnegfamily}
+
+\endinput \ No newline at end of file