Debian Codegraph @

texmf-dist/doc/latex/typog/inverted-marks.mp

raw
1 %%
2 %% This is file `inverted-marks.mp',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% typog.dtx (with options: `invertedmarks')
8 %%
9 %% This is a generated file.
10 %%
11 %% Copyright (C) 2024, 2025 by Ch. L. Spiel
12 %%
13 %% This work may be distributed and/or modified under the conditions
14 %% of the LaTeX Project Public License, either version 1.3c of this
15 %% license or (at your option) any later version. The latest version
16 %% of this license is in
17 %% https://www.latex-project.org/lppl.txt
18 %% and version 1.3c or later is part of all distributions of LaTeX
19 %% version 2003/12/01 or later.
20 %%
21 %% This work has the LPPL maintenance status `maintained'.
22 %%
23 %% The Current Maintainer of this work is Ch. L. Spiel.
24 %%
25 %% This work consists of the files typog.dtx and typog.ins
26 %% and the derived files typog.sty, slant-angle.mp, invertedmarks.mp,
27 %% crooked-paragraphs.mp, smooth-parshapes.mp, title.mp,
28 %% typog-example.tex, typog-minimal-test.tex,
29 %% typog-without-microtype-test.tex
30 %% typog-grep.pl.in, typog-grep.pl,
31 %% typog-grep.pod, and teximan2latex.sed.
32 %%
33 %%
34 prologues := 3;
35 bboxmargin := 0;% Extremely important setting: otherwise all our bboxes are too loose!
36 linecap := butt;
37 truecorners := 1;
38
39 string roman_font;
40 roman_font := "pplr8r"; % URW Palladio L - Roman
41
42 font_scale := 5;
43
44 picture letter_a;
45 letter_a := thelabel("a" infont roman_font scaled font_scale, origin);
46 path bbox_a;
47 bbox_a := bbox letter_a;
48 ex_height := ypart (ulcorner bbox_a - llcorner bbox_a);
49 show ex_height;
50
51 picture letter_g;
52 letter_g := thelabel("g" infont roman_font scaled font_scale, origin);
53 path bbox_g;
54 bbox_g := bbox letter_g;
55 descender_height := ypart (ulcorner bbox_g - llcorner bbox_g) - ex_height;
56 show descender_height;
57
58 string inverted_exclamation_mark_char;
59 inverted_exclamation_mark_char := char(161);
60
61 string inverted_question_mark_char;
62 inverted_question_mark_char := char(191);
63
64 picture font_sample;
65 font_sample := thelabel(("g" & inverted_exclamation_mark_char & "jk" &
66 inverted_question_mark_char & "y " &
67 inverted_exclamation_mark_char & " E! " &
68 inverted_question_mark_char & " Q?")
69 infont roman_font scaled font_scale, origin);
70 path bbox_sample;
71 bbox_sample := bbox font_sample;
72
73 %% The locations of shifted_inverted_exclamation_mark and
74 %% shifted_inverted_question_mark are 100% pure fudge!
75 picture shifted_inverted_exclamation_mark;
76 shifted_inverted_exclamation_mark :=
77 thelabel(inverted_exclamation_mark_char infont roman_font scaled font_scale,
78 font_scale * (2.6, 1.333));
79
80 picture shifted_inverted_question_mark;
81 shifted_inverted_question_mark :=
82 thelabel(inverted_question_mark_char infont roman_font scaled font_scale,
83 font_scale * (20.6, 1.333));
84
85 beginfig(1);
86 draw font_sample;
87 draw shifted_inverted_exclamation_mark withcolor .8 white;
88 draw shifted_inverted_question_mark withcolor .8 white;
89
90 draw (xpart (llcorner bbox_sample), ypart (llcorner bbox_sample) + descender_height) --
91 (xpart (lrcorner bbox_sample), ypart (lrcorner bbox_sample) + descender_height)
92 withpen pencircle scaled .3333pt;
93 draw (llcorner bbox_sample) -- (lrcorner bbox_sample)
94 dashed evenly withpen pencircle scaled .25pt;
95 draw (xpart (llcorner bbox_sample), ypart (llcorner bbox_sample) + descender_height + ex_height) --
96 (xpart (lrcorner bbox_sample), ypart (lrcorner bbox_sample) + descender_height + ex_height)
97 dashed evenly withpen pencircle scaled .25pt;
98 endfig;
99 end