summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-05-10 21:15:13 +0000
committerKarl Berry <karl@freefriends.org>2024-05-10 21:15:13 +0000
commitd6f9d4fa306a12d02ed079390ada9b5e4164b1c6 (patch)
tree04ae5add78553df29bddee161a714dd5ff8a21a2 /Master/texmf-dist/doc/luatex
parent4509574ed056cb5935f4a8c0c43d746ae1922161 (diff)
luamplib (10may24)
git-svn-id: svn://tug.org/texlive/trunk@71225 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/luatex')
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/NEWS21
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/luamplib.pdfbin175518 -> 184266 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex34
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/test-luamplib-plain.tex38
4 files changed, 86 insertions, 7 deletions
diff --git a/Master/texmf-dist/doc/luatex/luamplib/NEWS b/Master/texmf-dist/doc/luatex/luamplib/NEWS
index 87f52a00661..fdae6fc90cd 100644
--- a/Master/texmf-dist/doc/luatex/luamplib/NEWS
+++ b/Master/texmf-dist/doc/luatex/luamplib/NEWS
@@ -1,5 +1,26 @@
History of the luamplib package
+2024/05/10 2.30.0
+ * provide a new metapost operator 'mplibglyph', which returns a metapost
+ picture containing outline paths of a glyph in opentype, truetype or type1
+ fonts. When a type1 font is specified, metapost primitive 'glyph' will be
+ called. In the syntax as follows, subfont number is zero based.
+
+ mplibglyph 50 of \fontid\font % slot 50 of current font
+ mplibglyph 50 of "cmr10" % type1 font
+ mplibglyph "Q" of "TU/TeXGyrePagella(0)/m/n/10" % TeX fontname
+ mplibglyph "똠" of "NotoSansCJKkr-Regular.otf" % raw filename
+ mplibglyph "Q" of "Times.ttc(2)" % subfont number
+ mplibglyph "똠" of "SourceHanSansK-VF.otf[Regular]" % instance name
+
+ * provide a new metapost command 'mplibdrawglyph'. In contrast to metapost's
+ 'draw' command, this one fills paths of a picture according to the Nonzero
+ Winding Number Rule.
+
+ * in 'mplibgraphictext', option 'scale' is deprecated and now a synonym of
+ 'scaled'. In DVI mode, unicode-math package is needed for math formula
+ graphictext.
+
2024/05/01 2.29.0
* provide new TeX macros to reduce typing toil.
diff --git a/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf b/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
index a8cc10a03b3..b6f57158f7f 100644
--- a/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
+++ b/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex b/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
index 52af10d72bb..faa516f25fb 100644
--- a/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
+++ b/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
@@ -1,5 +1,9 @@
%\DocumentMetadata{ uncompress }
-\documentclass{article}
+\ifnum\outputmode > 0
+ \documentclass{article}
+\else
+ \documentclass[dvipdfmx]{article}
+\fi
\usepackage{fontspec}
\setmainfont{latin modern roman}
\usepackage{luamplib}
@@ -172,14 +176,15 @@ diameter:\Dia bp.%
\begin{mplibcode}
beginfig(1)
draw mplibgraphictext "\bfseries Funny"
- fakebold 2 scale 2 % fontspec options
- drawcolor "blue" fillcolor "red!50" % l3color expressions
- scaled 2 rotated 30 ;
+ fakebold 2 % fontspec option
+ drawcolor blue fillcolor "red!50" % l3color expression
+ scaled 3 rotated 30 ;
picture p;
p:=mplibgraphictext "\bfseries\itshape xyz";
draw p scaled 3 shifted (40,0);
endfig;
\end{mplibcode}%
+\par
\mplibsetformat{metafun}%
\begin{mplibcode}
beginfig(1)
@@ -198,7 +203,26 @@ fill unitsquare xyscaled (\mpdim\textwidth,1cm)
endfig;
\end{mplibcode}%
\leavevmode
-\everymplib[@mpfig]{ drawoptions(withcolor red); }%
+\mpfig
+picture Q, u, e;
+Q := mplibglyph "Q" of "texgyrepagella-bolditalic.otf" scaled .1;
+u := mplibglyph "u" of "texgyrepagella-bolditalic.otf" scaled .1 shifted lrcorner Q;
+e := mplibglyph "e" of "texgyrepagella-bolditalic.otf" scaled .1 shifted lrcorner u;
+i:=0;
+totallen := length Q + length u + length e;
+for pic=Q, u, e:
+ for item within pic:
+ i:=i+1;
+ fill pathpart item
+ if i < totallen: withpostscript "collect"; fi
+ endfor
+endfor
+ withshademethod "linear"
+ withshadedirection (0.5,2.5)
+ withshadecolors (.7red,.7yellow)
+ ;
+\endmpfig
+\everymplib[@mpfig]{ drawoptions(withcolor mplibrgbtexcolor "olive"); }%
\mpfig* input boxes \endmpfig
\mpfig circleit.a(btex\tracingcommands0 Box 1 etex); drawboxed(a); \endmpfig
\tracingcommands0
diff --git a/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-plain.tex b/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-plain.tex
index 84d7041a8d4..896c7f0a951 100644
--- a/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-plain.tex
+++ b/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-plain.tex
@@ -1,6 +1,7 @@
+\input luaotfload.sty
\input miniltx
\input color
-\definecolor{orange}{rgb}{1,0.5,0}
+\definecolor{orange}{cmyk}{0,.5,1,0}
\input luamplib.sty
\mpliblegacybehavior{true}%
\everymplib{ beginfig(0); }\everyendmplib{ endfig; }
@@ -164,6 +165,19 @@ diameter:\Dia bp.%
endfig;
\endmplibcode
\par
+\mplibcode
+beginfig(1) % in dvi mode, not work for type1 font
+draw mplibgraphictext "\bf Funny"
+ fakebold 2 % fontspec option
+ drawcolor blue fillcolor .5[red,white]
+ scaled 3 rotated 30 ;
+picture p;
+p:=mplibgraphictext "\it xyz"
+ fillcolor .7white;
+draw p scaled 3 shifted (40,0);
+endfig;
+\endmplibcode
+\par
\mplibsetformat{metafun}%
\mplibcode
beginfig(1)
@@ -181,7 +195,27 @@ fill unitsquare xyscaled (\mpdim\hsize, 1cm)
;
endfig;
\endmplibcode
-\everymplib[@mpfig]{ drawoptions(withcolor red); }%
+\leavevmode
+\mpfig
+picture Q, u, e;
+Q := mplibglyph "Q" of "texgyrepagella-bolditalic.otf" scaled .1;
+u := mplibglyph "u" of "texgyrepagella-bolditalic.otf" scaled .1 shifted lrcorner Q;
+e := mplibglyph "e" of "texgyrepagella-bolditalic.otf" scaled .1 shifted lrcorner u;
+i:=0;
+totallen := length Q + length u + length e;
+for pic=Q, u, e:
+ for item within pic:
+ i:=i+1;
+ fill pathpart item
+ if i < totallen: withpostscript "collect"; fi
+ endfor
+endfor
+ withshademethod "linear"
+ withshadedirection (0.5,2.5)
+ withshadecolors (.7red,.7yellow)
+ ;
+\endmpfig
+\everymplib[@mpfig]{ drawoptions(withcolor mplibrgbtexcolor"orange"); }%
\mpfig* input boxes \endmpfig
\mpfig circleit.a(btex\tracingcommands0 Box 1 etex); drawboxed(a); \endmpfig
\tracingcommands0