diff options
author | Karl Berry <karl@freefriends.org> | 2009-08-28 17:52:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-08-28 17:52:47 +0000 |
commit | 9574391f1c92725d497fa2a84962aee68b5cbf25 (patch) | |
tree | 8c6a92468e9c6da565ed5da07c13c0c01187875f /Master/texmf-dist/tex/fontinst/base/fontinst.sty | |
parent | 227ebe2cb5e11abb7e12b88ba66adc7735fa9570 (diff) |
fontinst 1.933 (24aug09)
git-svn-id: svn://tug.org/texlive/trunk@14924 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/fontinst/base/fontinst.sty')
-rw-r--r-- | Master/texmf-dist/tex/fontinst/base/fontinst.sty | 230 |
1 files changed, 200 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/fontinst/base/fontinst.sty b/Master/texmf-dist/tex/fontinst/base/fontinst.sty index a15f50fb7c6..c19adcf8386 100644 --- a/Master/texmf-dist/tex/fontinst/base/fontinst.sty +++ b/Master/texmf-dist/tex/fontinst/base/fontinst.sty @@ -7,6 +7,7 @@ %% fibasics.dtx (with options: `pkg') %% ficommon.dtx (with options: `pkg') %% fimain.dtx (with options: `pkg') +%% fitrig.dtx (with options: `pkg') %% ficonv.dtx (with options: `pkg') %% filtfam.dtx (with options: `pkg,textcomp,debug') %% fimapgen.dtx (with options: `pkg') @@ -32,13 +33,13 @@ \catcode`\}=2 \catcode`\#=6 \catcode`\^=7 -\def\fontinstversion{1.929} +\def\fontinstversion{1.933} \ifx\ProvidesPackage\undefined \def\NeedsTeXFormat#1{} \def\ProvidesPackage#1[#2]{} \fi \ProvidesPackage{fontinst} -[2005/02/05 v\fontinstversion\space +[2007/01/23 v\fontinstversion\space fontinst installation package] \def\a_macro#1{\catcode\number`#1=\the\catcode`#1 } \edef\normalcc{% @@ -82,9 +83,6 @@ \mathchardef\max_mathchardef="7FFF \mathchardef\two_thousand=2000 \newdimen\half_point \half_point=0.5pt -\let\@tempdima\a_dimen -\let\@tempdimb\b_dimen -\input trig.sty \def\x_cs#1#2{\expandafter#1\csname#2\endcsname} \let\x_relax=\relax \def\g_let{\global\let} @@ -1190,12 +1188,17 @@ \moveup{#3} \glyph{\glyph_name_modifier{#1}}{\one_thousand} \pop + \else\ifisglyph{\glyph_name_modifier{#1}-not}\then + \fontinstwarning{\string\glyphpcc}{ + Base~glyph~`\glyph_name_modifier{#1}'~not~appended,\messagebreak + because~it~is~so~far~unencoded~in~the~glyph~base + } \else \fontinsterror{\string\glyphpcc}{ - Base~glyph~not~set.\messagebreak - This~could~be~a~sign~that~the~AFM~file~is~buggy + Base~glyph~not~set.\messagebreak + This~could~be~a~sign~that~the~AFM~file~is~buggy }\error_help_a - \fi + \fi\fi } \def\glyphbboxright{\max\glyph_width\glyph_maxhpos} \def\samesize#1{ @@ -1980,14 +1983,18 @@ \fi \fi } -\def\substitutesilent#1#2{ - \x_cs\def{sub-#2}{#1} - \x_cs\def{typ-#2}{ssub} -} -\def\substitutenoisy#1#2{ - \x_cs\def{sub-#2}{#1} - \x_cs\def{typ-#2}{sub} +\def\substitute_generic#1#2#3{ + \edef\a_macro{#2} + \edef\b_macro{#3} + \ifx \a_macro \b_macro + \x_cs\let{sub-#3}\undefined_command + \else + \x_cs\let{sub-#3}\a_macro + \x_cs\def{typ-#3}{#1} + \fi } +\def\substitutesilent{\substitute_generic{ssub}} +\def\substitutenoisy{\substitute_generic{sub}} \substitutesilent{bx}{b} \substitutesilent{b}{bx} \substitutesilent{b}{sb} @@ -2052,6 +2059,89 @@ \out_line{\percent_char~Created~whilst~debugging~fontinst.} \close_out{Test~file} } +%%% From file: fitrig.dtx +\chardef\nin@ty=90 +\chardef\@clxxx=180 +\chardef\@lxxi=71 +\mathchardef\@mmmmlxviii=4068 +\chardef\@coeffz=72 +\chardef\@coefb=42 +\mathchardef\@coefc=840 +\mathchardef\@coefd=5040 +\def\TG@rem@pt#1{\expandafter\lose_measure\the#1\space} +\def\TG@term#1{ + \dimen@\@tempb\dimen@ + \advance\dimen@ #1\p@ +} +\def\TG@series{ + \dimen@\@lxxi\dimen@ + \divide \dimen@ \@mmmmlxviii + \edef\@tempa{\TG@rem@pt\dimen@} + \dimen@\@tempa\dimen@ + \edef\@tempb{\TG@rem@pt\dimen@} + \divide\dimen@\@coeffz + \advance\dimen@\m@ne\p@ + \TG@term\@coefb + \TG@term{-\@coefc}% + \TG@term\@coefd + \dimen@\@tempa\dimen@ + \divide\dimen@ \@coefd +} +\def\CalculateSin#1{{% + \if_undefined{sin(\number#1)}\then + \dimen@=#1\p@ + \TG@@sin + \x_cs\xdef{sin(\number#1)}{\TG@rem@pt\dimen@} + \fi +}} +\def\CalculateCos#1{{% + \if_undefined{cos(\number#1)}\then + \dimen@=\nin@ty\p@ + \advance \dimen@ -#1\p@ + \TG@@sin + \x_cs\xdef{cos(\number#1)}{\TG@rem@pt\dimen@} + \fi +}} +\def\TG@@sin{% + \ifdim\TG@reduce>+% + \else\ifdim\TG@reduce<-% + \else\TG@series\fi\fi +} +\def\TG@reduce#1#2{ + \dimen@#1#2\nin@ty\p@ + \advance\dimen@#2-\@clxxx\p@ + \dimen@-\dimen@ + \TG@@sin +} +\def\UseSin#1{\csname sin(\number#1)\endcsname} +\def\UseCos#1{\csname cos(\number#1)\endcsname} +\chardef\z@num\z@ +\x_cs\let{sin(0)} \z@num +\x_cs\let{cos(0)} \@ne +\x_cs\let{sin(90)} \@ne +\x_cs\let{cos(90)} \z@num +\x_cs\let{sin(-90)}\m@ne +\x_cs\let{cos(-90)}\z@num +\x_cs\let{sin(180)}\z@num +\x_cs\let{cos(180)}\m@ne +\def\CalculateTan#1{{% + \if_undefined{tan(\number#1)}\then + \CalculateSin{#1}% + \CalculateCos{#1}% + \a_dimen\UseCos{#1}\p@ + \divide \a_dimen \@iv + \b_dimen\UseSin{#1}\p@ + \b_dimen\two@fourteen\b_dimen + \divide\b_dimen\a_dimen + \x_cs\xdef{tan(\number#1)}{\TG@rem@pt\b_dimen} + \fi +}} +\def\UseTan#1{\csname tan(\number#1)\endcsname} +\mathchardef\two@fourteen=16384 +\chardef\@iv=4 +\x_cs\def{tan(90)}{\errmessage{Infinite tan !}} +\expandafter\let + \csname tan(-90)\expandafter\endcsname \csname tan(90)\endcsname %%% From file: ficonv.dtx \def\afmtomtx#1#2{{ \let\setsomething_global=\x_relax @@ -2105,8 +2195,9 @@ \def\afm_command#1~{\csname~afm-#1\endcsname\gobble_one_line} \def\gobble_one_line#1\end_of_line{} \x_cs\def{afm-EndFontMetrics}#1\afm_line{\endinput} -\def\afm_def#1(#2)#3{\x_cs\def{afm-#1} - \gobble_one_line#2\end_of_line{#3}} +\def\afm_def#1(#2)#3{ + \x_cs\def{afm-#1}\gobble_one_line#2\end_of_line{#3} +} \def\afm_let#1#2{ \expandafter\let \csname afm-#1\expandafter\endcsname \csname afm-#2\endcsname @@ -2150,15 +2241,16 @@ \if\first_char#2=.\else \afm_length\a_count{#3} \ifnum \a_count>\minimum_kern - \out_line{\string\setkern{#1}{#2}{\the\a_count}} + \afm_write_setkern{#1}{#2}{\the\a_count} \else\ifnum \a_count<-\minimum_kern - \out_line{\string\setkern{#1}{#2}{\the\a_count}} + \afm_write_setkern{#1}{#2}{\the\a_count} \fi\fi \fi\fi } \afm_let{KPX}{KP} +\def\afm_write_setkern#1#2#3{\out_line{\string\setkern{#1}{#2}{#3}}} \afm_def{C}(#1~;#2){\init_afm{#1}\do_list[#2]\afm_char} -\afm_let{CH}{C} +\afm_def{CH}(<#1>~;#2){\uppercase{\init_afm{"#1}}\do_list[#2]\afm_char} \afm_def{CC}(#1~#2~;#3){\init_cc{#1}\do_list[#3]\cc_char} \newcount\char_slot \newcount\char_x_width @@ -2178,7 +2270,6 @@ \let\char_name=\empty_command } \def\afm_char{ - \a_count=-\bbox_lly \eval_expr{ \italcorr_expression\x_width\bbox_llx\bbox_urx\bbox_lly\bbox_ury } @@ -2194,7 +2285,7 @@ {\the\char_slot} {\the\x_width} {\the\bbox_ury} - {\the\a_count} + {\number -\bbox_lly} {\the\result} } } @@ -2245,6 +2336,76 @@ \afm_length\b_count{#3} \out_lline{\string\glyphpcc{#1}{\the\a_count}{\the\b_count}} } +\def\definealias#1#2#3{ + \expandafter\def \csname GN-#1 \expandafter\endcsname + \expandafter{ \csname g-#2 \expandafter\endcsname + \csname i-#3\endcsname} +} +\def\glyph_alias#1{ + \expandafter\expandafter \expandafter\glyph_alias_i + \csname GN-#1\endcsname +} +\def\glyph_alias_i#1#2{ + \expandafter\gobble_three \string#1 +} +\let\charnameprefix\empty +\def\charnamealias#1{ + \if_defined{GN-\charnameprefix#1}\then + \glyph_alias{\charnameprefix#1} + \else\if_defined{GN-#1}\then + \glyph_alias{#1} + \else + #1 + \fi\fi +} +\def\alias_incr#1{ + \expandafter\expandafter \expandafter\alias_incr_i + \csname GN-#1\endcsname +} +\def\alias_incr_i#1#2{ + \ifx#2\x_relax + \mathchardef#2=\@ne + \else + \a_count=#2 + \advance\a_count\@ne + \mathchardef#2=\a_count + \fi +} +\def\alias_char_name#1{ + \if_defined{GN-\charnameprefix#1}\then + \edef\char_name{ + \string\aliased{#1}{\glyph_alias{\charnameprefix#1}} + } + \alias_incr{\charnameprefix#1} + \else\if_defined{GN-#1}\then + \edef\char_name{ + \string\aliased{#1}{\glyph_alias{#1}} + } + \alias_incr{#1} + \else + \edef\char_name{#1} + \fi\fi +} +\def\autoaliasafm{ + \begingroup + \list_def{N}(##1){\alias_char_name{##1}} + \def\afm_write_setkern##1##2##3{ + \out_line{ + \string\setkern{\charnamealias{##1}}{\charnamealias{##2}}{##3} + } + } + \def\init_cc##1{% + \edef\char_name{\charnamealias{##1}} + \out_line{\string\setglyph{\char_name}} + } + \list_def{PCC}(##1~##2~##3){ + \afm_length\a_count{##2} + \afm_length\b_count{##3} + \out_lline{\string\glyphpcc + {\charnamealias{##1}}{\the\a_count}{\the\b_count}} + } +} +\def\endautoaliasafm{\endgroup} \def\generalpltomtx#1#2#3#4{{ \let\setsomething_global=\x_relax \let\setfontdimen=\pl_setfontdimen @@ -2633,14 +2794,7 @@ \resetstr{etx-name}{#1} } \def\mtxtomtx#1#2{{ - \ifisstr{etx-name}\then - \def\do_slot{\x_cs\edef{slots-\slot_name}{\the\slot_number}} - \directfalse - \inputetx{\str{etx-name}} - \edef\a_macro{\string\reencodefont{\str{etx-name}}} - \else - \let\a_macro=\empty_command - \fi + \let\a_macro=\empty_command \_a_true \ifnum \int{x-scale}=\int{y-scale} \ifnum \int{slant-scale}=\z@ @@ -2670,6 +2824,20 @@ \out_line{} \out_line{\string\needsfontinstversion{\fontinstversion}} \out_line{} + \ifisstr{etx-name}\then + \def\do_slot{\x_cs\edef{slots-\slot_name}{\the\slot_number}} + \def\declarepsencoding##1##2##3{ + \a_toks={{##1}{##2}{##3}} + \out_line{\string\providepsencoding\the\a_toks} + \ifnum \transform_record_file=\closed_stream \else + \pout_line\transform_record_file + {\string\providepsencoding\the\a_toks} + \fi + } + \directfalse + \inputetx{\str{etx-name}} + \edef\a_macro{\a_macro\string\reencodefont{\str{etx-name}}} + \fi \record_transform{#2}{\string\frommtx{#1}}{\a_macro}\iftrue \out_line{} \mtxtomtx_redefinitions @@ -3482,6 +3650,8 @@ \pout_line\transform_record_file{\string\makemapentry{#1}} \fi } +\let\declarepsencoding=\gobble_three +\let\providepsencoding=\gobble_three %%% From file: fibasics.dtx \def\needsfontinstversion#1{{ \a_dimen=#1pt |