blob: 2c23f226eed4dab77d2e355bf857fee283e965c7 (
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
|
%D \module
%D [ file=font-glf,
%D version=2020.12.21,
%D title=\CONTEXT\ Font Macros,
%D subtitle=Glyph Scaling,
%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 Font Macros / Glyph Scaling}
\unprotect
%D Experiment:
\installcorenamespace{tweakedfont}
\installcommandhandler \??tweakedfont {tweakedfont} \??tweakedfont
\appendtoks
% we can optimize for zero and 1000 .. maybe also options?
\overloaded\frozen\protected\edefcsname\currenttweakedfont\endcsname
{\begincsname\tweakedfontparameter\c!style\endcsname
\glyphxscale \numexpr\numericscale\tweakedfontparameter\c!xscale*\glyphxscale/\plusthousand\relax
\glyphyscale \numexpr\numericscale\tweakedfontparameter\c!yscale*\glyphyscale/\plusthousand\relax
\glyphxoffset\dimexpr\glyphxoffset+\tweakedfontparameter\c!xoffset\relax
\glyphyoffset\dimexpr\glyphyoffset+\tweakedfontparameter\c!yoffset\relax}%
\to \everydefinetweakedfont
\setuptweakedfont
[\c!scale=\plusthousand,
\c!xscale=\tweakedfontparameter\c!scale,
\c!yscale=\tweakedfontparameter\c!scale,
\c!xoffset=\zeropoint,
\c!yoffset=\zeropoint]
\protect \endinput
|