summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/meta-blb.mkiv
blob: 4a5381dfc43ad878275183a6b5cfd300f021b0c4 (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
%D \module
%D   [       file=meta-blb,
%D        version=2018.04.12,
%D          title=\METAPOST\ Graphics,
%D       subtitle=Blobs,
%D         author=Hans Hagen,
%D           date=\ currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{MetaPost Graphics / Blobs}

\registerctxluafile{meta-blb}{}

\unprotect

\unexpanded\def\MPLIBgetblobscaledcm#1#2#3#4#5#6#7#8#9%
  {\clf_mpgetblob\MPtextbox#1\relax
   \setbox\MPbox\hpack\bgroup
     \dotransformnextbox{#2}{#3}{#4}{#5}{#6}{#7}%
       \vpack to \zeropoint\bgroup
          \vss
          \hpack to \zeropoint \bgroup
           % \fastsxsy{#8}{#9}{\raise\dp\MPtextbox\box\MPtextbox}%
             \fastsxsy{#8}{#9}{\box\MPtextbox}%
             \hss
         \egroup
       \egroup
   \egroup
   \smashbox\MPbox
   \box\MPbox}

%D An example of usage:

\definefontfeature[followtext][liga=no]

\unexpanded\def\MPLIBfollowtext#1#2%
  {\begingroup
   \scratchcounter#1\relax
   \setbox\scratchbox\hbox{\addff{followtext}#2}%
   \clf_MPLIBconvertfollowtext\scratchcounter\scratchbox
   \endgroup}

% \def\reversedtext#1%
%   {\cldcontext{table.concat(table.reverse(utf.totable(\!!bs#1\!!es)))}}

%D New:

\newtoks\mpblobtext

\mpblobtext{\global\setbox\mptextbox\vbox{\clf_mpblobtext}}

\protect \endinput