Skip to content

Commit

Permalink
HINT adding experimental files for LaTeX image inclusion
Browse files Browse the repository at this point in the history
git-svn-id: svn://tug.org/texlive/trunk/Build/source@67157 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
ruckertm committed May 19, 2023
1 parent 104e4e7 commit 6427e3a
Show file tree
Hide file tree
Showing 3 changed files with 197 additions and 0 deletions.
70 changes: 70 additions & 0 deletions texk/web2c/hitexdir/tex/color.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
% https://creativecommons.org/publicdomain/zero/1.0/

\ProvidesFile{color.cfg}%
[2023/04/17 v1.7 sample color configuration]

% Select an appropriate default driver
\begingroup
\chardef\x=0\relax
% check luatex
\ifx\luatexversion\@undefined
% check pdfTeX
\@ifundefined{pdfoutput}{}{%
\ifnum\pdfoutput<1 %
\else
\chardef\x=1\relax
\fi
}%
% check VTeX
\@ifundefined{OpMode}{}{%
\chardef\x=2\relax
}%
% check XeTeX
\@ifundefined{XeTeXversion}{}{%
\chardef\x=3\relax
}%
% check HiTeX
\@ifundefined{HINTversion}{}{%
\chardef\x=5\relax
}%
\else
\ifnum\luatexversion>85
\ifnum\outputmode>0
\chardef\x=4\relax
\fi
\else
\ifnum\pdfoutput>0
\chardef\x=1\relax
\fi
\fi
\fi
\expandafter\endgroup
\ifcase\x
% default case
\def\Gin@driver{dvips.def}%
\ExecuteOptions{dvips}%
\or
% pdfTeX is running in pdf mode
\def\Gin@driver{pdftex.def}%
\ExecuteOptions{pdftex}%
\or
% VTeX is running
\def\Gin@driver{vtex.def}%
\ExecuteOptions{vtex}%
\or
% XeTeX is running
\def\Gin@driver{xetex.def}%
\ExecuteOptions{xetex}%
\or
% luatex (> 0.85)
\def\Gin@driver{luatex.def}%
\ExecuteOptions{luatex}%
\or
% HiTeX is running
\def\Gin@driver{hitex.def}%
\DeclareOption{hitex}{\def\Gin@driver{hitex.def}}
\ExecuteOptions{hitex}%
\else
\PackageError{color}{Unexpected configuration}{}
\fi
\endinput
70 changes: 70 additions & 0 deletions texk/web2c/hitexdir/tex/graphics.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
% https://creativecommons.org/publicdomain/zero/1.0/

\ProvidesFile{graphics.cfg}%
[2023/04/17 v1.12 sample graphics configuration]%

% Select an appropriate default driver
\begingroup
\chardef\x=0\relax
% check luatex
\ifx\luatexversion\@undefined
% check pdfTeX
\@ifundefined{pdfoutput}{}{%
\ifnum\pdfoutput<1 %
\else
\chardef\x=1\relax
\fi
}%
% check VTeX
\@ifundefined{OpMode}{}{%
\chardef\x=2\relax
}%
% check XeTeX
\@ifundefined{XeTeXversion}{}{%
\chardef\x=3\relax
}%
% check HiTeX
\@ifundefined{HINTversion}{}{%
\chardef\x=5\relax
}%
\else
\ifnum\luatexversion>85
\ifnum\outputmode>0
\chardef\x=4\relax
\fi
\else
\ifnum\pdfoutput>0
\chardef\x=1\relax
\fi
\fi
\fi
\expandafter\endgroup
\ifcase\x
% default case
\def\Gin@driver{dvips.def}%
\ExecuteOptions{dvips}%
\or
% pdfTeX is running in pdf mode
\def\Gin@driver{pdftex.def}%
\ExecuteOptions{pdftex}%
\or
% VTeX is running
\def\Gin@driver{vtex.def}%
\ExecuteOptions{vtex}%
\or
% XeTeX is running
\def\Gin@driver{xetex.def}%
\ExecuteOptions{xetex}%
\or
% luatex (> 0.85)
\def\Gin@driver{luatex.def}%
\ExecuteOptions{luatex}%
\or
% HiTeX is running
\def\Gin@driver{hitex.def}%
\DeclareOption{hitex}{\def\Gin@driver{hitex.def}}
\ExecuteOptions{hitex}%
\else
\PackageError{graphics}{Unexpected configuration}{}
\fi
\endinput
57 changes: 57 additions & 0 deletions texk/web2c/hitexdir/tex/hitex.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is the LaTeX3 Project.
%%
%% https://github.com/latex3/graphics-def/issues
%%

% VERY MINIMAL hitex file for color/graphics
\ProvidesFile{hitex.def}
[2023/04/17 v0.1a Graphics/color driver for hitex]


\def\set@color{%
\special{}%
\hi@color@warn
\aftergroup\reset@color}
\def\reset@color{\special{}}%

\def\hi@color@warn{%
\PackageWarning{color}{color not supported\@gobble}%
\global\let\hi@color@warn\relax}


\def\color@rgb#1#2{\def#1{}}

\def\Gin@extensions{.png,.jpg}
\@namedef{Gin@rule@.png}#1{{png}{.png}{#1}}
\@namedef{Gin@rule@.jpg}#1{{jpg}{.jpg}{#1}}


\def\Gread@png#1{%
\setbox\@tempboxa\hbox{\HINTimage=#1\relax}%
\def\Gin@llx{0}\let\Gin@lly\Gin@llx
\Gin@defaultbp\Gin@urx{\wd\@tempboxa}% = 0...
\Gin@defaultbp\Gin@ury{\ht\@tempboxa}% = 0...
%\def\Gin@urx{72}\let\Gin@ury\Gin@urx
\Gin@nat@height\Gin@ury bp
\Gin@nat@width\Gin@urx bp
}

\def\Ginclude@png#1{%
\mbox{\HINTimage=#1 width \Gin@req@width height\Gin@req@height\relax}%
}

\let\Gread@jpg\Gread@png
\let\Ginclude@jpg\Ginclude@png

\endinput

0 comments on commit 6427e3a

Please sign in to comment.