diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-22 22:14:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-22 22:14:39 +0000 |
commit | fc4466b32ed330a956ac603b00fd145524cff49a (patch) | |
tree | 2c50e2b8de13aa9233b2c76dffe201558f169e86 /Master/texmf-dist/tex/context/base/mkiv/blob-ini.mkiv | |
parent | 50e2368597d5f6fe2057195d0ae6a9f2044923e4 (diff) |
context (22apr16)
git-svn-id: svn://tug.org/texlive/trunk@40691 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/blob-ini.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/blob-ini.mkiv | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/blob-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/blob-ini.mkiv new file mode 100644 index 00000000000..64582c0db59 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkiv/blob-ini.mkiv @@ -0,0 +1,62 @@ +%D \module +%D [ file=blob-ini, +%D version=2010.04.06, +%D title=\CONTEXT\ \LUA\ Typesetting, +%D subtitle=Initialization, +%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}{ConTeXt Lua Typesetting / Initialization} + +%D This is a prelude to typesetting at the \LUA\ end. The code +%D is already quite old but will only get nice when we are further +%D down the road (close to version 1.00 of \LUATEX). Typesetting in +%D pure \LUA\ sometimes makes sense. + +\registerctxluafile{node-typ}{1.001} % experimental +\registerctxluafile{blob-ini}{1.001} + +%D For the moment here: + +\unprotect + +% this one takes simple (utf) strings + +\def\wdofstring#1{\dimexpr\clf_strwd{#1}\scaledpoint\relax} +\def\htofstring#1{\dimexpr\clf_strht{#1}\scaledpoint\relax} +\def\dpofstring#1{\dimexpr\clf_strdp{#1}\scaledpoint\relax} +\def\hdofstring#1{\dimexpr\clf_strhd{#1}\scaledpoint\relax} + +\def\widthofstring {\the\wdofstring} +\def\heightofstring {\the\htofstring} +\def\depthofstring {\the\dpofstring} +\def\heightanddepthofstring{\the\hdofstring} + +\let\htdpofstring \hdofstring + +\let\hd\htdp % if yes then move this + +% this one takes anything that can be typeset + +\unexpanded\def\setwidthof#1\to#2% + {\bgroup + \setbox\scratchbox\hbox{#1}% + \expanded{\egroup\def\noexpand#2{\the\wd\scratchbox}}} + +\protect \endinput + +% \starttext +% +% \startluacode +% local b = blobs.new() +% blobs.append(b,"Hello world.\n Here we are.\n\n And Again!") +% blobs.pack(b) +% blobs.write(b) +% \stopluacode +% +% \stoptext |