summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pdfcprot/pdfcprot.sty
blob: 725a02b6df46673fa4cf4c3b4ce84984746d6d09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
%%
%% This is file `pdfcprot.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pdfcprot.dtx  (with options: `package')
%% 
%% Copyright (C) 2001 Carsten Schurig.
%% Copyright (C) 2004 Tobias Schlemmer.
%% Email: keinstein_junior@gmx.net
%% 
%% This program may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.2
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.2 or later is part of all distributions of LaTeX
%% version 1999/12/01 or later.
%% 
%% For a list of files constituting this program see README.txt. For
%% further copyright information see README.txt and LEGAL.txt.
%% 
%% ----------------------------------------------------
%% This file is part of the LaTeX2e pdfcprot bundle.
%% ----------------------------------------------------
%% Some parts of the code are based on code by the
%% authors of pdftex.
%% ----------------------------------------------------
%% 
%%  This system is distributed in the hope that it will be useful,
%%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%% 
%% 
%% IMPORTANT NOTICE:
%% 
%% For error reports in case of UNCHANGED versions see documentation.
%% 
%% Please do not request updates directly. Distribution is
%% done through Mail-Servers, Mailboxes and TeX organizations.
%% 
%% You are not allowed to change this file.
%% 
%% You are allowed to distribute this file under the condition that
%% it is distributed together with all files mentioned in README.txt.
%% See LEGAL.txt for further information.
%% 
%% If you receive only some of these files from someone, complain!
%% 
%% You are NOT ALLOWED to distribute this file alone.




\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{pdfcprot}[2002/02/27 v1.5 character protruding using
pdflatex (cs)]
\RequirePackage{ifthen}
\RequirePackage{keyval}
\newcounter{CPROT@family}
\newcounter{CPROT@family@temp}
\newcounter{CPROT@series}
\newcounter{CPROT@series@temp}
\newcounter{CPROT@shape}
\newcounter{CPROT@shape@temp}
\newcounter{CPROT@size}
\newcounter{CPROT@size@temp}
\newboolean{CPROT@textcomp}
\newboolean{CPROT@quiet}
\setboolean{CPROT@quiet}{true}
\newcounter{CPROT@temp@chars}
\newcommand*{\CPROT@lowlevel@encoding}{}
\newcommand*{\CPROT@lowlevel@family}{}
\newcommand*{\CPROT@lowlevel@series}{}
\newcommand*{\CPROT@lowlevel@shape}{}
\newcommand*{\CPROT@resetall}{%
  \setcounter{CPROT@family}{0}%
  \setcounter{CPROT@series}{0}%
  \setcounter{CPROT@shape}{0}%
  \setcounter{CPROT@size}{0}%
  \setboolean{CPROT@textcomp}{false}%
  \edef\CPROT@lowlevel@encoding{}%
}
\newcommand*{\CPROT@setprotcodes@}{}
\newcommand*{\CPROT@setprotcodes@add}{%
  \setcounter{CPROT@family@temp}{\value{CPROT@family}}%
  \CPROT@aac@encoding%
}
\newcommand*{\CPROT@setprotcodes@temp}{}
\newcommand{\CPROT@packageinfo}[1]{%
  \PackageInfo{pdfcprot}{#1}%
  }
\newcommand{\CPROT@packagewarning}[1]{%
  \PackageWarning{pdfcprot}{#1}%
  }
\newcommand{\CPROT@packageerror}[1]{%
  \PackageError{pdfcprot}{#1}%
  }
\newcommand{\CPROT@packageinfo@or@warning}[1]{%
  \ifthenelse{\boolean{CPROT@quiet}}{%
    \CPROT@packageinfo{#1}%
    }{%
    \CPROT@packagewarning{#1}%
    }%
  }%
\define@key{CPROT}{encoding}{%
  \ifthenelse{\equal{#1}{encodingdefault}}{%
    \edef\CPROT@lowlevel@encoding{\encodingdefault}% \encodingdefault will be set.
  }{% I assume a low level encodingname is given
    \renewcommand*{\CPROT@lowlevel@encoding}{#1}%
  }%
}
\define@key{CPROT}{family}{%
  \ifthenelse{\equal{#1}{rmfamily}}{%
    \setcounter{CPROT@family}{2}% \rmfamily will be set
    }{%
    \ifthenelse{\equal{#1}{sffamily}}{%
      \setcounter{CPROT@family}{1}% \sffamily will be set
      }{% I assume a low level fontname is given
      \setcounter{CPROT@temp@chars}{0}%
      \expandafter\@tfor\expandafter\@tempb\expandafter:\expandafter=#1\do{%
        \stepcounter{CPROT@temp@chars}%
        }%
      \ifthenelse{\value{CPROT@temp@chars}>4}{%
        \CPROT@packageinfo@or@warning{None of the keywords 'all',\MessageBreak
          'rmfamily' or 'sffamily' was found. I assume you gave a\MessageBreak
          low level font name but it is at least unusual that a\MessageBreak
          TeX-fontname has more than 4 characters. I assume you know\MessageBreak
          what you're doing and continue, but the selection of the\MessageBreak
          font may fail!%
          }%
        \CPROT@packageinfo{It seem's as you want to use a low level\MessageBreak
          command for font selection. -- You're for yourself.%
          }%
        }{}%
      \setcounter{CPROT@family}{-1}%
      \renewcommand*{\CPROT@lowlevel@family}{#1}%
      }%
    }%
  }
\define@key{CPROT}{series}{%
  \ifthenelse{\equal{#1}{mdseries}}{% medium series
    \setcounter{CPROT@series}{2}%
    }{%
    \ifthenelse{\equal{#1}{bfseries}}{% bold series
      \setcounter{CPROT@series}{1}%
      }{% here the low level interface is suspected
      \setcounter{CPROT@temp@chars}{0}%
      \expandafter\@tfor\expandafter\@tempb\expandafter:\expandafter=#1\do{%
        \stepcounter{CPROT@temp@chars}%
        }%
      \ifthenelse{\value{CPROT@temp@chars}>4}{%
        \CPROT@packageinfo@or@warning{None of the keywords 'all',\MessageBreak
          'mdseries' or 'bfseries' was found. I assume you gave a\MessageBreak
          low level font name but a series identifier should consist\MessageBreak
          of 4 characters at maximum. I assume you know what you're\MessageBreak
          doing and continue, but the selection of the font will\MessageBreak
          very likely fail!%
          }%
        \CPROT@packageinfo{It seem's as you seem want to use a low level\MessageBreak
          command for font selection. -- You're for yourself.%
          }%
        }{}%
      \setcounter{CPROT@series}{-1}%
      \renewcommand*{\CPROT@lowlevel@series}{#1}%
      }%
    }%
  }%
\define@key{CPROT}{shape}{%
  \ifthenelse{\equal{#1}{upshape}}{%
    \setcounter{CPROT@shape}{8}%
    }{%
    \ifthenelse{\equal{#1}{itshape}}{%
      \setcounter{CPROT@shape}{4}%
      }{%
      \ifthenelse{\equal{#1}{slshape}}{%
        \setcounter{CPROT@shape}{2}%
        }{%
        \ifthenelse{\equal{#1}{scshape}}{%
          \setcounter{CPROT@shape}{1}%
          }{% low lewel format
          \setcounter{CPROT@temp@chars}{0}%
          \expandafter\@tfor\expandafter\@tempb\expandafter:\expandafter=#1\do{%
            \stepcounter{CPROT@temp@chars}%
            }%
          \ifthenelse{\value{CPROT@temp@chars}>2}{%
            \CPROT@packageinfo@or@warning{None of the keywords 'all',\MessageBreak
              'upshape', 'itshape', 'slshape' or 'scshape' was\MessageBreak
              found. I assume you gave a low level font name but it\MessageBreak
              is at least unusual that a shape identifier has more\MessageBreak
              than 2 characters. I assume you know what you're doing\MessageBreak
              and continue, but the selection of the font will very\MessageBreak
              likely fail!%
              }%
            \CPROT@packageinfo{It seem's as you seem want to use a low level\MessageBreak
              command for font selection. -- You're for yourself.%
              }%
            }{}%
          \setcounter{CPROT@shape}{-1}%
          \renewcommand{\CPROT@lowlevel@shape}{#1}%
          }%
        }%
      }%
    }%
  }
\define@key{CPROT}{size}{%
  \ifthenelse{\equal{#1}{Huge}}{%
    \setcounter{CPROT@size}{512}%
    }{%
    \ifthenelse{\equal{#1}{huge}}{%
      \setcounter{CPROT@size}{256}%
      }{%
      \ifthenelse{\equal{#1}{LARGE}}{%
        \setcounter{CPROT@size}{128}%
        }{%
        \ifthenelse{\equal{#1}{Large}}{%
          \setcounter{CPROT@size}{64}%
          }{%
          \ifthenelse{\equal{#1}{large}}{%
            \setcounter{CPROT@size}{32}%
            }{%
            \ifthenelse{\equal{#1}{normalsize}}{%
              \setcounter{CPROT@size}{16}%
              }{%
              \ifthenelse{\equal{#1}{small}}{%
                \setcounter{CPROT@size}{8}%
                }{%
                \ifthenelse{\equal{#1}{footnotesize}}{%
                  \setcounter{CPROT@size}{4}%
                  }{%
                  \ifthenelse{\equal{#1}{scriptsize}}{%
                    \setcounter{CPROT@size}{2}%
                    }{%
                    \ifthenelse{\equal{#1}{tiny}}{%
                      \setcounter{CPROT@size}{1}%
                      }{% low lewel format
                      \CPROT@packageerror{%
                        None of the keywords 'all', 'normal' or any LaTeX2e\MessageBreak
                        font name was found. \MessageBreak
                        \space For more information how to use\MessageBreak
                        \string\setupcharprotrudingnumeral see the
                        pdfcprot manual.%
                        }%
                      }{}%
                    }%
                  }%
                }%
              }%
            }%
          }%
        }%
      }%
    }%
  }
\define@key{CPROT}{textcomp}{%
  \ifthenelse{\equal{#1}{true}\or\equal{#1}{on}\or\equal{#1}{1}\or\equal{#1}{yes}}{%
    \setboolean{CPROT@textcomp}{true}%
    }{%
    \ifthenelse{\equal{#1}{false}\or\equal{#1}{off}\or\equal{#1}{0}\or\equal{#1}{no}}{%
      \setboolean{CPROT@textcomp}{false}%
      }{%
      \CPROT@packageerror{%
        ``#1'' is no setting for ``textcomp''. Use\MessageBreak
        one of 'true', 'on', 'yes', '1', or 'false', 'off', \MessageBreak
        'no', '0' instead.\MessageBreak
        }%
      }%
    }%
  }
\define@key{CPROTnum}{encoding}{%
  \ifthenelse{\equal{#1}{0}}{%
    \renewcommand*{\CPROT@lowlevel@encoding}{}% No encoding will be set.
  }{%
    \ifthenelse{\equal{#1}{1}}{%
      \edef\CPROT@lowlevel@encoding{\encodingdefault}% \encodingdefault will be set.
    }{%
      \ifthenelse{\equal{#1}{encodingdefault}}{%
        \edef\CPROT@lowlevel@encoding{\encodingdefault}% \encodingdefault will be set.
      }{% I assume a low level encodingname is given
        \renewcommand*{\CPROT@lowlevel@encoding}{#1}%
      }%
    }%
  }%
}
\define@key{CPROTnum}{family}{%
  \ifthenelse{#1>0 \and #1<4}{%
    \setcounter{CPROT@family}{#1}%
    }{%
    \ifthenelse{#1=0}{%
      \CPROT@packageinfo{%
        As you selected '0' (that means 'none') for\MessageBreak
        selection of the font family, no font will\MessageBreak
        be set up for char protruding.%
        }%
      }{%
      \CPROT@packageerror{%
        Your given value '#1' to family in \string\setupcharprotrudingnumeral\MessageBreak
        is not valid. Sensible values are between 1 and 3 (inclusive).\MessageBreak
        For further information see the pdfcprot manual.%
        }%
      }%
    }%
  }
\define@key{CPROTnum}{series}{%
  \ifthenelse{#1>0 \and #1<4}{%
    \setcounter{CPROT@series}{#1}%
    }{%
    \ifthenelse{#1=0}{%
      \CPROT@packageinfo{%
        As you selected '0' (that means 'none') for\MessageBreak
        selection of the font series, no font will\MessageBreak
        be set up for char protruding.%
        }%
      }{%
      \CPROT@packageerror{%
        Your given value '#1' to series in \string\setupcharprotrudingnumeral\MessageBreak
        is not valid. Sensible values are between 1 and 15 (inclusive).\MessageBreak
        For further information see the pdfcprot manual.%
        }%
      }%
    }%
  }
\define@key{CPROTnum}{shape}{%
  \ifthenelse{#1>0 \and #1<16}{%
    \setcounter{CPROT@shape}{#1}%
    }{%
    \ifthenelse{#1=0}{%
      \CPROT@packageinfo{%
        As you selected '0' (that means 'none') for\MessageBreak
        selection of the font shape, no font will\MessageBreak
        be set up for char protruding.%
        }%
      }{%
      \CPROT@packageerror{%
        Your given value '#1' to shape in \string\setupcharprotrudingnumeral\MessageBreak
        is not valid. Sensible values are between 1 and 15 (inclusive).\MessageBreak
        For further information see the pdfcprot manual.%
        }%
      }%
    }%
  }
\define@key{CPROTnum}{size}{%
  \ifthenelse{#1>0 \and #1<1024}{%
    \setcounter{CPROT@size}{#1}%
    }{%
    \ifthenelse{#1=0}{%
      \CPROT@packageinfo{%
        As you selected '0' (that means 'none') for\MessageBreak
        selection of the font size, no font will\MessageBreak
        be set up for char protruding.%
        }%
      }{%
      \CPROT@packageerror{%
        Your given value '#1' to size in \string\setupcharprotrudingnumeral\MessageBreak
        is not valid. Sensible values are between 1 and 1023 (inclusive).\MessageBreak
        For further information see the pdfcprot manual.%
        }%
      }%
    }%
  }
\define@key{CPROTnum}{textcomp}[true]{%
  \setkeys{CPROT}{textcomp=#1}%
}
\define@key{CPROTpackage}{activate}[normal]{%
  \ifthenelse{\equal{#1}{normal}}{%
    \CPROT@setupcharprotruding@normal%
    \ifthenelse{\equal{\CPROT@setprotcodes@}{}}{%
    }{% just activate char prot when something was set
      \activatecharprotruding[true]%
    }%
  }{%
    \ifthenelse{\equal{#1}{none}}{%
    }{%
      \CPROT@packageerror{%
        Value of activate can be 'normal' or 'none'.\MessageBreak%
        \space For more low level setup use \string\setupcharprotruding\MessageBreak%
        and see the manual%
        }%
      }%
    }%
  }%
\define@key{CPROTpackage}{quiet}[true]{%
  \ifthenelse{\equal{#1}{true}\or\equal{#1}{on}\or\equal{#1}{yes}\or\equal{#1}{1}}{%
    \setboolean{CPROT@quiet}{true}%
    }{%
    \ifthenelse{\equal{#1}{false}\or\equal{#1}{off}\or\equal{#1}{no}\or\equal{#1}{0}}{%
      \setboolean{CPROT@quiet}{false}%
      }{%
      \CPROT@packageerror{%
        Value of quiet should be 'true' ('on', 'yes, '1') or\MessageBreak%
        'false' ('off', 'no', '0'). You didn't seem to use any\MessageBreak%
        of them.%
        }%
      }%
    }%
  }%
\newcommand{\CPROT@aac@encoding}{%
  \ifthenelse{\equal{\CPROT@lowlevel@encoding}{}}{%
      \setcounter{CPROT@family@temp}{\value{CPROT@family}}%
      \CPROT@aac@family{}%
    }{%
      \@for \CPROT@aac@encoding@first:=\CPROT@lowlevel@encoding \do {%
        \setcounter{CPROT@family@temp}{\value{CPROT@family}}%
        \expandafter\ifx\csname T@\CPROT@aac@encoding@first\endcsname\relax%
          \ifthenelse{\boolean{CPROT@quiet}}{%
            \CPROT@packagewarning{Encoding \CPROT@aac@encoding@first not defined\MessageBreak
              (see log file for more information)}
          }{}%
          \CPROT@packageinfo@or@warning{%
            You've requested char protruding for \CPROT@aac@encoding@first encoding\MessageBreak
            but \CPROT@aac@encoding@first encoding doesn't seem to be loaded.\MessageBreak
            Maybe you forgot a '\string\usepackage[\CPROT@aac@encoding@first]{fontenc}'.%
          }%
        \else
          \CPROT@aac@family{\protect\fontencoding{\CPROT@aac@encoding@first}\selectfont}%
        \fi
      }%
    }%
  }
\newcommand{\CPROT@aac@family}[1]{%
  \ifthenelse{\value{CPROT@family@temp}>1}{%
    \protected@edef\CPROT@setprotcodes@temp{#1\protect\rmfamily}%
    \setcounter{CPROT@series@temp}{\value{CPROT@series}}%
    \CPROT@aac@series{\CPROT@setprotcodes@temp}%
    \addtocounter{CPROT@family@temp}{-2}%
    \CPROT@aac@family{#1}%
    }{%
    \ifthenelse{\value{CPROT@family@temp}>0}{%
      \protected@edef\CPROT@setprotcodes@temp{#1\protect\sffamily}%
      \setcounter{CPROT@series@temp}{\value{CPROT@series}}%
      \CPROT@aac@series{\CPROT@setprotcodes@temp}%
      \addtocounter{CPROT@family@temp}{-1}%
      \CPROT@aac@family{#1}%
    }{%
      \ifthenelse{\value{CPROT@family@temp}<0}{%
      \protected@edef\CPROT@setprotcodes@temp{#1\fontfamily{\CPROT@lowlevel@family}\selectfont}%
      \setcounter{CPROT@series@temp}{\value{CPROT@series}}%
      \CPROT@aac@series{\CPROT@setprotcodes@temp}%
    }{}%
      }%
    }%
  }
\newcommand{\CPROT@aac@series}[1]{%
  \ifthenelse{\value{CPROT@series@temp}>1}{%
    \protected@edef\CPROT@setprotcodes@temp{#1\protect\mdseries}%
    \setcounter{CPROT@shape@temp}{\value{CPROT@shape}}%
    \CPROT@aac@shape{\CPROT@setprotcodes@temp}%
    \addtocounter{CPROT@series@temp}{-2}%
    \CPROT@aac@series{#1}%
    }{%
    \ifthenelse{\value{CPROT@series@temp}>0}{%
      \protected@edef\CPROT@setprotcodes@temp{#1\protect\bfseries}%
      \setcounter{CPROT@shape@temp}{\value{CPROT@shape}}%
      \CPROT@aac@shape{\CPROT@setprotcodes@temp}%
      \addtocounter{CPROT@series@temp}{-1}%
      \CPROT@aac@series{#1}%
      }{%
      \ifthenelse{\value{CPROT@series@temp}<0}{%
        \protected@edef\CPROT@setprotcodes@temp{%
          #1\fontseries\expandafter{\CPROT@lowlevel@series}\selectfont}%
        \setcounter{CPROT@shape@temp}{\value{CPROT@shape}}%
        \CPROT@aac@shape{\CPROT@setprotcodes@temp}%
        }{}%
      }%
    }%
  }
\newcommand{\CPROT@aac@shape}[1]{%
  \ifthenelse{\value{CPROT@shape@temp}>7}{%
    \protected@edef\CPROT@setprotcodes@temp{#1\protect\upshape}%
    \setcounter{CPROT@size@temp}{\value{CPROT@size}}%
    \CPROT@aac@size{\CPROT@setprotcodes@temp}%
    \addtocounter{CPROT@shape@temp}{-8}%
    \CPROT@aac@shape{#1}%
    }{%
    \ifthenelse{\value{CPROT@shape@temp}>3}{%
      \protected@edef\CPROT@setprotcodes@temp{#1\protect\itshape}%
      \setcounter{CPROT@size@temp}{\value{CPROT@size}}%
      \CPROT@aac@size{\CPROT@setprotcodes@temp}%
      \addtocounter{CPROT@shape@temp}{-4}%
      \CPROT@aac@shape{#1}%
      }{%
      \ifthenelse{\value{CPROT@shape@temp}>1}{%
        \protected@edef\CPROT@setprotcodes@temp{#1\protect\slshape}%
        \setcounter{CPROT@size@temp}{\value{CPROT@size}}%
        \CPROT@aac@size{\CPROT@setprotcodes@temp}%
        \addtocounter{CPROT@shape@temp}{-2}%
        \CPROT@aac@shape{#1}%
        }{%
        \ifthenelse{\value{CPROT@shape@temp}>0}{%
          \protected@edef\CPROT@setprotcodes@temp{#1\protect\scshape}%
          \setcounter{CPROT@size@temp}{\value{CPROT@size}}%
          \CPROT@aac@size{\CPROT@setprotcodes@temp}%
          \addtocounter{CPROT@shape@temp}{-1}%
          \CPROT@aac@shape{#1}%
          }{%
          \ifthenelse{\value{CPROT@shape@temp}<0}{%
            \protected@edef\CPROT@setprotcodes@temp{%
              #1\fontshape\expandafter{\CPROT@lowlevel@shape}\selectfont}%
            \setcounter{CPROT@size@temp}{\value{CPROT@size}}%
            \CPROT@aac@size{\CPROT@setprotcodes@temp}%
            }{}%
          }%
        }%
      }%
    }%
  }
\newcommand{\CPROT@aac@size}[1]{%
  \ifthenelse{\value{CPROT@size@temp}>511}{%
    \protected@edef\CPROT@setprotcodes@temp{#1\protect\Huge}%
    \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
    \addtocounter{CPROT@size@temp}{-512}%
    \CPROT@aac@size{#1}%
    }{%
    \ifthenelse{\value{CPROT@size@temp}>255}{%
      \protected@edef\CPROT@setprotcodes@temp{#1\protect\huge}%
      \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
      \addtocounter{CPROT@size@temp}{-256}%
      \CPROT@aac@size{#1}%
      }{%
      \ifthenelse{\value{CPROT@size@temp}>127}{%
        \protected@edef\CPROT@setprotcodes@temp{#1\protect\LARGE}%
        \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
        \addtocounter{CPROT@size@temp}{-128}%
        \CPROT@aac@size{#1}%
        }{%
        \ifthenelse{\value{CPROT@size@temp}>63}{%
          \protected@edef\CPROT@setprotcodes@temp{#1\protect\Large}%
          \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
          \addtocounter{CPROT@size@temp}{-64}%
          \CPROT@aac@size{#1}%
          }{%
          \ifthenelse{\value{CPROT@size@temp}>31}{%
            \protected@edef\CPROT@setprotcodes@temp{#1\protect\large}%
            \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
            \addtocounter{CPROT@size@temp}{-32}%
            \CPROT@aac@size{#1}%
            }{%
            \ifthenelse{\value{CPROT@size@temp}>15}{%
              \protected@edef\CPROT@setprotcodes@temp{#1\protect\normalsize}%
              \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
              \addtocounter{CPROT@size@temp}{-16}%
              \CPROT@aac@size{#1}%
              }{%
              \ifthenelse{\value{CPROT@size@temp}>7}{%
                \protected@edef\CPROT@setprotcodes@temp{#1\protect\small}%
                \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
                \addtocounter{CPROT@size@temp}{-8}%
                \CPROT@aac@size{#1}%
                }{%
                \ifthenelse{\value{CPROT@size@temp}>3}{%
                  \protected@edef\CPROT@setprotcodes@temp{#1\protect\footnotesize}%
                  \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
                  \addtocounter{CPROT@size@temp}{-4}%
                  \CPROT@aac@size{#1}%
                  }{%
                  \ifthenelse{\value{CPROT@size@temp}>1}{%
                    \protected@edef\CPROT@setprotcodes@temp{#1\protect\scriptsize}%
                    \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
                    \addtocounter{CPROT@size@temp}{-2}%
                    \CPROT@aac@size{#1}%
                    }{%
                    \ifthenelse{\value{CPROT@size@temp}>0}{%
                      \protected@edef\CPROT@setprotcodes@temp{#1\protect\protect\tiny}%
                      \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
                      }{}%
                    }%
                  }%
                }%
              }%
            }%
          }%
        }%
      }%
    }%
  }
\newcommand{\CPROT@aac@textcomp}[1]{%
  \ifthenelse{\boolean{CPROT@textcomp}}{%
    \@ifundefined{T@TS1}{%
      \CPROT@packageinfo@or@warning{%
        You've requested char protruding for TS1 encoding\MessageBreak
        but TS1 encoding doesn't seem to be loaded.\MessageBreak
        Maybe you forgot a '\string\usepackage{textcomp}'.%
        }%
      \setboolean{CPROT@textcomp}{false}%
      }{}%
    }{}%
  \ifthenelse{\boolean{CPROT@textcomp}}{%
    \protected@xdef\CPROT@setprotcodes@{%
      \CPROT@setprotcodes@{%
        #1\protect\CPROT@setprotcodes@font{%
          \fontencoding{TS1}\selectfont\protect\CPROT@setprotcodes@font%
          }%
        }%
      }%
    }{%
    \protected@xdef\CPROT@setprotcodes@{%
      \CPROT@setprotcodes@{%
        #1\protect\CPROT@setprotcodes@font%
        }%
      }%
    }%
  }
\newcommand*{\activatecharprotruding}[1][true]{%
  \ifpdftex{%
    \ifthenelse{\equal{#1}{true}\or\equal{#1}{on}\or\equal{#1}{1}\or\equal{#1}{yes}}{%
      \CPROT@good@pdftex@version{%
        \global\pdfprotrudechars=2%
       }
      }{%
      \ifthenelse{\equal{#1}{compatibility}\or\equal{#1}{compatible}}{%
        \CPROT@good@pdftex@version{%
          \global\pdfprotrudechars=1%
          }%
        }{%
        \ifthenelse{\equal{#1}{false}\or\equal{#1}{off}\or\equal{#1}{0}\or\equal{#1}{no}}{%
          \global\pdfprotrudechars=0%
          }{%
          \CPROT@packageerror{%
            ``#1'' is no setting for \activatecharprotruding. Use\MessageBreak
            one of 'true', 'on', 'yes', '1', or 'false', 'off', \MessageBreak
            'no', '0', or 'compatible', 'compatibility' instead.%
            }%
          }{%
          \CPROT@packageinfo@or@warning{%
            You want to activate char protruding, but it does\MessageBreak
            look as your are NOT using pdftex. So I can't\MessageBreak
            activate it, as ``pdfcprot.sty'' only supports\MessageBreak
            pdftex.}%
          }%
        }%
      }%
    }{}%
  }
\newcommand*{\setupcharprotruding}[1]{%
  \ifpdftex{%
    \CPROT@resetall{}%
    \@ifundefined{CPROT@save@KV@errx}{%
      \let\CPROT@save@KV@errx=\KV@errx%
      \renewcommand*{\KV@errx}[1]{%
        \CPROT@packageerror{option ##1 for \string\setupcharprotruding}{%
          You've tried to use the option ##1 with \string\setupcharprotruding.\MessageBreak
          But there is no option with that name.\MessageBreak
          See the manual of ``pdfcprot.sty'' for information
          about the usage of \string\setupcharprotruding.%
          }%
        }%
      \setkeys{CPROT}{#1}%
      \let\KV@errx=\CPROT@save@KV@errx%
      \let\CPROT@save@KV@errx=\relax%
      }{%
      \setkeys{CPROT}{#1}%
      }%
    \CPROT@setprotcodes@add{}%
    }{%
    \CPROT@packageinfo@or@warning{%
      You want to setup char protruding, but it does\MessageBreak
      look as if you're NOT using pdftex. So I can't\MessageBreak
      setup it, as ``pdfcprot.sty'' only supports\MessageBreak
      pdftex.}%
    }%
  }
\@onlypreamble\setupcharprotruding%
\newcommand*{\setupcharprotrudingnumeral}[1]{%
  \ifpdftex{%
    \CPROT@resetall{}%
    \@ifundefined{CPROT@save@KV@errx}{%
      \let\CPROT@save@KV@errx=\KV@errx%
      \renewcommand*{\KV@errx}[1]{%
        \CPROT@packageerror{option ##1 for \string\setupcharprotrudingnumeral}{%
          You've tried to use the option ##1 with \string\setupcharprotrudingnumeral.\MessageBreak
          But there is no option with that name.\MessageBreak
          See the manual of ``pdfcprot.sty'' for information
          about the usage of \string\setupcharprotrudingnumeral.%
          }%
        }%
      \setkeys{CPROTnum}{#1}%
      \let\KV@errx=\CPROT@save@KV@errx%
      \let\CPROT@save@KV@errx=\relax%
      }{%
      \setkeys{CPROTnum}{#1}%
      }%
    \CPROT@setprotcodes@add{}%
    }{%
    \CPROT@packageinfo@or@warning{%
      You want to setup char protruding, but it does\MessageBreak
      look as if you're NOT using pdftex. So I can't\MessageBreak
      setup it, as ``pdfcprot.sty'' only supports\MessageBreak
      pdftex.}%
    }%
  }
\@onlypreamble\setupcharprotrudingnumeral
\newcommand{\ifpdftex}{%
  \ifx\pdftexversion\@undefined
    \expandafter\@secondoftwo
  \else
    \ifx\pdftexversion\relax
      \expandafter\expandafter\expandafter\@secondoftwo
    \else
      \expandafter\expandafter\expandafter\@firstoftwo
    \fi
  \fi
}
\newcommand{\CPROT@packageerror@bad@pdftex}{%
  \CPROT@packageerror{You used a pdftex version older than 0.14f.\MessageBreak
    pdfcprot does not support such old versions of pdftex. \MessageBreak
    Please install a new version of pdftex.}%
}
\newcommand{\CPROT@good@pdftex@version}[1]{%
  \ifnum\pdftexversion < 14
    \CPROT@packageerror@bad@pdftex %
  \else
    \ifnum\pdftexversion = 14
      \ifnum \expandafter`\pdftexrevision < `f
        \CPROT@packageerror@bad@pdftex %
      \else
        #1
      \fi
    \else
      #1
    \fi
  \fi
}
\newcommand*{\CPROT@ifpdfoutput}{%
  \ifcase 0%
          \ifx\pdfoutput\@undefined 1%
          \else
            \ifx\pdfoutput\relax    1%
            \else
              \ifcase\pdfoutput     1%
              \fi
            \fi
          \fi
          \space
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
\@ifundefined{ifpdfoutput}{\let\ifpdfoutput\CPROT@ifpdfoutput}{%
  \CPROT@packageinfo{%
    \string\ifpdfoutput\space already defined.\MessageBreak
    That may happen when using KOMA-Script together\MessageBreak
    with ``pdfcprot.sty''. I have changed the definition\MessageBreak
    from Markus' KOMA-Script, so if you experience errors\MessageBreak
    try \string\let\string\ifpdfoutput\string\relax\space before loading ``pdfcprot.sty''.}%
  }
\newcommand*{\CPROT@packageoptions}[1]{%
  \@ifundefined{CPROT@save@KV@errx}{%
    \let\CPROT@save@KV@errx=\KV@errx%
    \renewcommand*{\KV@errx}[1]{%
      \PackageError{pdfcprot}{unknown option ``#1''}{%
        You've tried to use the option ``#1''.\MessageBreak
        But there is no option with that name.\MessageBreak
        See the manual of ``pdfcprot.sty'' for information
        about known options.%
        }%
      }%
    \setkeys{CPROTpackage}{#1}%
    \let\KV@errx=\CPROT@save@KV@errx%
    \let\CPROT@save@KV@errx=\relax%
    }{%
    \setkeys{CPROTpackage}{#1}%
    }%
  }
\DeclareOption{DVIoutput}{%
  \CPROT@packagewarning{%
    It is not a good idea to use the DVIoutput package
    option.\MessageBreak
    Use it only if you experience some using other
    packages.\MessageBreak
    And don't forget to file a bug report against these
    packages.\MessageBreak
    The best is to add just \string\pdfoutput=0\space at the beginning\MessageBreak
    of your preamble or even before \string\documentclass.
  }
  \ifpdftex{%
    \pdfoutput=0%
    \let\pdfoutput\undefined
    }{}%
  }
\DeclareOption*{%
  \ifpdftex{%
    \expandafter\CPROT@packageoptions\expandafter{\CurrentOption}%
    }{}%
  }%
\newcommand*{\CPROT@fallbackfont}{pplmn}
\newcommand*{\setfallbackfont}[1]{\renewcommand*{\CPROT@fallbackfont}{#1}}
\newcommand*{\CPROT@setupcharprotruding@normal}{%
  \setupcharprotrudingnumeral{family=3,series=1,shape=8,size=60,textcomp=1}%
  \setupcharprotrudingnumeral{family=2,series=2,shape=12,size=60,textcomp=1}%
  \setupcharprotrudingnumeral{family=1,series=2,shape=14,size=60,textcomp=1}%
  }
\newcommand*{\setupcharprotrudingforencoding}[1]{%
  \setupcharprotrudingnumeral{encoding={#1},family=3,series=1,shape=8,size=60,textcomp=1}%
  \setupcharprotrudingnumeral{encoding={#1},family=2,series=2,shape=12,size=60,textcomp=1}%
  \setupcharprotrudingnumeral{encoding={#1},family=1,series=2,shape=14,size=60,textcomp=1}%
  }
\@onlypreamble\setupcharprotrudingforencoding
\InputIfFileExists{pdfcprot.cfg}
           {\typeout{***************************************^^J%
                     * Local config file pdfcrpot.cfg used *^^J%
                     ***************************************}}
           {}
\ProcessOptions\relax
\newcommand*{\CPROT@actualfont}{%
  \f@family%
  \f@series%
  \f@shape%
  \f@encoding%
  }
\@onlypreamble\setfallbackfont%
\newcommand*{\CPROT@cpa@toload}{}
\newcommand*{\CPROT@setprotcodes@font}{%
  \renewcommand*{\CPROT@cpa@toload}{\CPROT@actualfont.cpa}%
  \IfFileExists{\CPROT@cpa@toload}{%
    \expandafter\@ifundefined\expandafter{\CPROT@actualfont}{%
      \input{\CPROT@cpa@toload}
      }{}
    \csname\CPROT@actualfont\endcsname%
    \CPROT@adjustprotcodes{\font}%
    \CPROT@packageinfo{%
      File \CPROT@cpa@toload{} for the adjustment of\MessageBreak
      the char protruding used. It seems to be _fit_\MessageBreak
      to the font you requested.%
      }%
    }{%
    \CPROT@packageinfo@or@warning{%
      I didn't find \CPROT@cpa@toload.\MessageBreak%
      \space As a fallback I will try \CPROT@fallbackfont\f@encoding.cpa.%
      }%
    \renewcommand*{\CPROT@cpa@toload}{\CPROT@fallbackfont\f@encoding.cpa}%
    \IfFileExists{\CPROT@cpa@toload}{%
      \expandafter\@ifundefined\expandafter{\CPROT@fallbackfont\f@encoding}{%
        \input{\CPROT@cpa@toload}%
        }{}%
      \csname\CPROT@fallbackfont\f@encoding\endcsname%
      \CPROT@adjustprotcodes{\font}%
      \CPROT@packageinfo{%
        File \CPROT@cpa@toload{} used for the adjustment\MessageBreak
        of the char protruding. It seems that it isn't the one\MessageBreak
        you intended to use.%
        }%
      }{%
      \CPROT@packageinfo@or@warning{%
        Even the fallback font was not found. Maybe it's\MessageBreak
        not the right font encoding. Currently ``pdfcprot''\MessageBreak
        bundles only with cpa's for T1, OT1 and TS1 encoding.%
        }%
      }%
    }%
  }
\newif\ifCPROT@adjustprotcodes@
\newcommand*{\CPROT@adjustprotcodes}[1]{%
  \CPROT@adjustprotcodes@false
  \ifnum\pdftexversion > 14
    \CPROT@adjustprotcodes@true
  \else
    \ifnum\pdftexversion = 14
      \ifnum \expandafter`\pdftexrevision > `g
        \CPROT@adjustprotcodes@true
      \fi
    \fi
  \fi
  \ifCPROT@adjustprotcodes@
    \@tempcnta=0
    \loop
      \ifcase\lpcode#1\@tempcnta\else
        \CPROT@adjustprotcodes@@\lpcode{#1}\@tempcnta
      \fi
      \ifcase\rpcode#1\@tempcnta\else
        \CPROT@adjustprotcodes@@\rpcode{#1}\@tempcnta
      \fi
      \advance\@tempcnta 1
    \ifnum\@tempcnta < 256 \repeat
   \fi
  }
\def\CPROT@adjustprotcodes@@#1#2#3{%
  \setbox0=\hbox{\the#2\char#3}%
  \@tempcntb=\wd0%
  \multiply\@tempcntb #1#2#3%
  \divide\@tempcntb \fontdimen6 #2%
  #1#2#3=\@tempcntb%
  }

\newcommand*{\CPROT@setprotcodes}{%
  \ifpdftex{%
    \ifthenelse{\equal{\CPROT@setprotcodes@}{}}{%
      }{%
      \CPROT@setprotcodes@%
      }%
    }{}%
  }

\AtBeginDocument{%
  \CPROT@setprotcodes\relax%
  }
\endinput
%%
%% End of file `pdfcprot.sty'.