Received: from webgate.proteosys.de (mail.proteosys-ag.com [62.225.9.49]) by lucy.proteosys (8.11.0/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id f13EJc713365 for ; Sat, 3 Feb 2001 15:19:38 +0100 Received: by webgate.proteosys.de (8.11.0/8.11.0) with ESMTP id f13EKN711584 . for ; Sat, 3 Feb 2001 15:20:30 +0100 Received: from mail.Uni-Mainz.DE (mailserver1.zdv.Uni-Mainz.DE [134.93.8.30]) by mailgate1.zdv.Uni-Mainz.DE (8.11.0/8.10.2) with ESMTP id f13EJOM22016 for ; Sat, 3 Feb 2001 15:19:24 +0100 (MET) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C08DEC.5721B900" Received: from mailgate2.zdv.Uni-Mainz.DE (mailgate2.zdv.Uni-Mainz.DE [134.93.8.57]) by mail.Uni-Mainz.DE (8.9.3/8.9.3) with ESMTP id PAA00289 for ; Sat, 3 Feb 2001 15:19:24 +0100 (MET) Received: from mail.listserv.gmd.de (mail.listserv.gmd.de [192.88.97.5]) by mailgate2.zdv.Uni-Mainz.DE (8.11.0/8.10.2) with ESMTP id f13EJO700110 for ; Sat, 3 Feb 2001 15:19:24 +0100 (MET) X-MimeOLE: Produced By Microsoft Exchange V6.5 Received: from mail.listserv.gmd.de (192.88.97.5) by mail.listserv.gmd.de (LSMTP for OpenVMS v1.1a) with SMTP id <8.22C197B6@mail.listserv.gmd.de>; Sat, 3 Feb 2001 15:19:16 +0100 Received: from RELAY.URZ.UNI-HEIDELBERG.DE by RELAY.URZ.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 1.8b) with spool id 486782 for LATEX-L@RELAY.URZ.UNI-HEIDELBERG.DE; Sat, 3 Feb 2001 15:19:17 +0100 Received: from ix.urz.uni-heidelberg.de (mail.urz.uni-heidelberg.de [129.206.119.234]) by relay.urz.uni-heidelberg.de (8.8.8/8.8.8) with ESMTP id PAA11087 for ; Sat, 3 Feb 2001 15:19:16 +0100 (MET) Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by ix.urz.uni-heidelberg.de (8.8.8/8.8.8) with ESMTP id PAA41284 for ; Sat, 3 Feb 2001 15:19:16 +0100 Received: from moutvdom00.kundenserver.de (moutvdom00.kundenserver.de [195.20.224.149]) by relay.uni-heidelberg.de (8.10.2+Sun/8.10.2) with ESMTP id f13EJGu08220 for ; Sat, 3 Feb 2001 15:19:16 +0100 (MET) Received: from [195.20.224.209] (helo=mrvdom02.schlund.de) by moutvdom00.kundenserver.de with esmtp (Exim 2.12 #2) id 14P3X2-0001NT-00 for LATEX-L@urz.uni-heidelberg.de; Sat, 3 Feb 2001 15:19:16 +0100 Received: from manz-3e36464b.pool.mediaways.net ([62.54.70.75] helo=istrati.zdv.uni-mainz.de) by mrvdom02.schlund.de with esmtp (Exim 2.12 #2) id 14P3XQ-0007uX-00 for LATEX-L@URZ.UNI-HEIDELBERG.DE; Sat, 3 Feb 2001 15:19:41 +0100 Received: (from latex3@localhost) by istrati.zdv.uni-mainz.de (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id PAA01253; Sat, 3 Feb 2001 15:15:04 +0100 In-Reply-To: <14971.8503.549122.613285@istrati.zdv.uni-mainz.de> References: <14968.34118.306909.315983@istrati.zdv.uni-mainz.de> <200101312200.XAA09346@bar.loria.fr> <14969.12533.759505.917813@istrati.zdv.uni-mainz.de> <14970.60068.179603.570418@fell.open.ac.uk> <14971.8503.549122.613285@istrati.zdv.uni-mainz.de> Return-Path: X-Mailer: VM 6.75 under Emacs 20.4.1 X-Authentication-Warning: istrati.zdv.uni-mainz.de: latex3 set sender to frank@mittelbach-online.de using -f Content-class: urn:content-classes:message Subject: glyph collections viz font encodings Date: Sat, 3 Feb 2001 15:15:03 +0100 Message-ID: <14972.4711.612679.929965@istrati.zdv.uni-mainz.de> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Frank Mittelbach" Sender: "Mailing list for the LaTeX3 project" To: "Multiple recipients of list LATEX-L" Reply-To: "Mailing list for the LaTeX3 project" Status: R X-Status: X-Keywords: X-UID: 3702 This is a multi-part message in MIME format. ------_=_NextPart_001_01C08DEC.5721B900 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable after having handwaved myself through the ideas of specifying glyph collections rather than font encodings, here is a "hand waving" sort of implementation of the idea. basically \fontencoding is changed to accept a comma list of encodings = and \selectfont is changed to try these encodings in order (keeping the = other font characteristics) until it finds a font or runs out of encodings. in the = latter case it trys to find a font by changing the characteristics to defaults. the latter process could and should be made smarter, eg given encodings T1,OT1 family xxx series yyy shape zzz it will try T1/xxx/yyy/zzz OT1/xxx/yyy/zzz T1/xxx/yyy/ T1/xxx// T1/// FAIL instead of T1/xxx/yyy/zzz OT1/xxx/yyy/zzz T1/xxx/yyy/ OT1/xxx/yyy/ T1/xxx// OT1/xxx// ... which might be a better approach. anyway, here it is and it seems to work more or less. what do you think? frank --------------------------- glyphcoll.tex \documentclass{article} \usepackage[T1,OT6,OT1]{fontenc} \makeatletter \DeclareRobustCommand\fontencoding[1]{\edef\glyph@collection{#1}} \DeclareRobustCommand\Xfontencoding[1]{% \expandafter\ifx\csname T@#1\endcsname\relax \@latex@error{Encoding scheme `#1' unknown}\@eha \else \edef\f@encoding{#1}% \ifx\cf@encoding\f@encoding \let\enc@update\relax \else \let\enc@update\@@enc@update \fi \fi } \DeclareRobustCommand\Xselectfont {% \ifx\f@linespread\baselinestretch \else \set@fontsize\baselinestretch\f@size\f@baselineskip \fi \expandafter\get@next@encoding\glyph@collection,\@nil \xdef\font@name{% \csname\curr@fontshape/\f@size\endcsname}% \Xpickup@font \font@name \size@update \enc@update } \def\get@next@encoding#1,#2\@nil{% \Xfontencoding{#1}% \def\sub@glyph@collection{#2}% } \def\Xpickup@font{% \@font@warning{Trying for \font@name ...}% \expandafter \ifx \font@name \relax \Xdefine@newfont \fi} \def\Xdefine@newfont{% \@font@warning{ ... undefined ... try to load it ...}% \begingroup \let\typeout\@font@info \escapechar\m@ne \expandafter\expandafter\expandafter \split@name\expandafter\string\font@name\@nil \try@load@fontshape % try always \expandafter\ifx \csname\curr@fontshape\endcsname \relax \@font@warning{ ... unloadable ... }% \Xwrong@fontshape\else \@font@warning{ ... loadable ... extract it}% \extract@font\fi \endgroup} \def\Xwrong@fontshape{% \expandafter\get@next@encoding\sub@glyph@collection,\@nil \ifx\f@encoding\@empty \expandafter\get@next@encoding\glyph@collection,\@nil \wrong@fontshape \else \xdef\font@name{% \csname\curr@fontshape/\f@size\endcsname}% \Xpickup@font \fi } \makeatother \begin{document} \fontfamily{cmr} \fontencoding{OT6,T1}\selectfont AA \fontfamily{ptm}\selectfont BB \fontseries{b}\selectfont CC \showoutput \stop ------_=_NextPart_001_01C08DEC.5721B900 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable glyph collections viz font encodings

after having handwaved myself through the ideas = of  specifying glyph
collections rather than font encodings, here is a = "hand waving" sort of
implementation of the idea.

basically \fontencoding is changed to accept a comma = list of encodings and
\selectfont is changed to try these encodings in = order (keeping the other font
characteristics) until it finds a font or runs out of = encodings. in the latter
case it trys to find a font by changing the = characteristics to defaults.

the latter process could and should be made smarter, = eg given

 encodings T1,OT1
 family    xxx
 series    yyy
 shape     zzz

it will try

 T1/xxx/yyy/zzz
OT1/xxx/yyy/zzz
 T1/xxx/yyy/<defaultshape>
 T1/xxx/<defaultseries>/<defaultshape>
 T1/<defaultfamily>/<defaultseries>/<default= shape>
 FAIL

instead of

 T1/xxx/yyy/zzz
OT1/xxx/yyy/zzz
 T1/xxx/yyy/<defaultshape>
OT1/xxx/yyy/<defaultshape>
 T1/xxx/<defaultseries>/<defaultshape>
OT1/xxx/<defaultseries>/<defaultshape>
 ...

which might be a better approach.

anyway, here it is and it seems to work more or less. = what do you think?

frank


--------------------------- glyphcoll.tex
\documentclass{article}

\usepackage[T1,OT6,OT1]{fontenc}


\makeatletter
\DeclareRobustCommand\fontencoding[1]{\edef\glyph@collection{#1}= }

\DeclareRobustCommand\Xfontencoding[1]{%
    \expandafter\ifx\csname = T@#1\endcsname\relax
      \@latex@error{Encoding = scheme `#1' unknown}\@eha
    \else
      = \edef\f@encoding{#1}%
      = \ifx\cf@encoding\f@encoding
        = \let\enc@update\relax
      \else
        = \let\enc@update\@@enc@update
      \fi
    \fi
}

\DeclareRobustCommand\Xselectfont
        {%
    \ifx\f@linespread\baselinestretch = \else
      = \set@fontsize\baselinestretch\f@size\f@baselineskip \fi
    = \expandafter\get@next@encoding\glyph@collection,\@nil
    \xdef\font@name{%
      = \csname\curr@fontshape/\f@size\endcsname}%
    \Xpickup@font
    \font@name
    \size@update
    \enc@update
    }



\def\get@next@encoding#1,#2\@nil{%
  \Xfontencoding{#1}%
  \def\sub@glyph@collection{#2}%
}

\def\Xpickup@font{%
\@font@warning{Trying for \font@name ...}%
    \expandafter \ifx \font@name = \relax
       = \Xdefine@newfont
    \fi}


\def\Xdefine@newfont{%
\@font@warning{  ... undefined ... try to load = it ...}%
  \begingroup
    \let\typeout\@font@info
    \escapechar\m@ne
    = \expandafter\expandafter\expandafter
       = \split@name\expandafter\string\font@name\@nil
      \try@load@fontshape % = try always
    \expandafter\ifx
       = \csname\curr@fontshape\endcsname \relax
\@font@warning{  ... unloadable ... }%
      = \Xwrong@fontshape\else
\@font@warning{  ... loadable ... extract = it}%
      = \extract@font\fi
  \endgroup}


\def\Xwrong@fontshape{%
  = \expandafter\get@next@encoding\sub@glyph@collection,\@nil
  \ifx\f@encoding\@empty
     = \expandafter\get@next@encoding\glyph@collection,\@nil
     \wrong@fontshape
  \else
    \xdef\font@name{%
      = \csname\curr@fontshape/\f@size\endcsname}%
    \Xpickup@font
  \fi
}

\makeatother



\begin{document}

\fontfamily{cmr}
\fontencoding{OT6,T1}\selectfont
AA

\fontfamily{ptm}\selectfont
BB

\fontseries{b}\selectfont
CC

\showoutput
\stop

------_=_NextPart_001_01C08DEC.5721B900--