summaryrefslogtreecommitdiff
path: root/systems/tex-extensions/clasen/hz/hz-glue.ch
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 /systems/tex-extensions/clasen/hz/hz-glue.ch
Initial commit
Diffstat (limited to 'systems/tex-extensions/clasen/hz/hz-glue.ch')
-rw-r--r--systems/tex-extensions/clasen/hz/hz-glue.ch26
1 files changed, 26 insertions, 0 deletions
diff --git a/systems/tex-extensions/clasen/hz/hz-glue.ch b/systems/tex-extensions/clasen/hz/hz-glue.ch
new file mode 100644
index 0000000000..e38a1f4572
--- /dev/null
+++ b/systems/tex-extensions/clasen/hz/hz-glue.ch
@@ -0,0 +1,26 @@
+@x
+@p function adjust_excess(p:pointer;r:real):scaled;
+@y
+@p function adjust_excess(p:pointer;r:glue_ratio):scaled;
+@z
+
+@x
+ d:=abs(v+char_width(f)(i)-r*w);
+@y
+ d:=abs(v+char_width(f)(i)-glue_mult(r,w));
+@z
+
+@x
+ dd:=abs(v+char_width(ff)(ii)-r*w);
+@y
+ dd:=abs(v+char_width(ff)(ii)-glue_mult(r,w));
+@z
+
+@x
+ x:=x-adjust_excess(link(q),(gw+x)/gw);
+@y
+ { |adjust_excess| tries to make up the excess~|x| by stretching the glyphs
+ by the factor |gw+x/gw| (represented as a |glue_ratio| value). }
+ x:=x-adjust_excess(link(q),glue_fix(gw,gw+x,gw));
+@z
+