%D \module
%D   [       file=type-cbg,
%D        version=2004.08.23,
%D          title=\CONTEXT\ Typescript Macros,
%D       subtitle=CB Greek,
%D         author={Giuseppe Bilotta, Hans Hagen},
%D           date=\currentdate,
%D      copyright=PRAGMA-ADE]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

% legend:
%
% g=greek
% r=regular s=sansserif t=typewriter
% m=medium x=boldextended t=monospaced
% n=normal o=oblique i=italic u=uprightitalic c=smallcaps

% ruby script to make small zip file:
%
% zipfile = 'cbsmall.zip'
%
% fontfiles = Array.new
%
% fontfiles.push(Dir.glob("fonts/{tfm,vf,afm,type1}/public/cb/{gr,gs,gt}{m,s,t}{n,o,i,u,c}{0800,1000,1200}.{tfm,afm,pfb}"))
% fontfiles.push(Dir.glob("fonts/{map,enc,lig}/{dvips,pdftex,dvipdfm,dvipdfmx}/cb/{cbgreek,cbsmall}.{map,enc,lig}"))
%
% File.delete(zipfile) if FileTest.file?(zipfile)
% system("zip -r -9 cbsmall #{fontfiles.join(' ')}")

\starttypescriptcollection[cbgreek]

\starttypescript [serif] [cbgreek] [name]
    \definefontsynonym [CBGreek-Regular-Medium-Normal]              [grmn1000]
    \definefontsynonym [CBGreek-Regular-Medium-Oblique]             [grmo1000]
    \definefontsynonym [CBGreek-Regular-Medium-Italic]              [grmi1000]
    \definefontsynonym [CBGreek-Regular-Medium-UprightItalic]       [grmu1000]
    \definefontsynonym [CBGreek-Regular-Medium-Caps]                [grmc1000]
    \definefontsynonym [CBGreek-Regular-Medium-Leipzig]             [grml1000]
    \definefontsynonym [CBGreek-Regular-Medium-Roman]               [grmr1000]
    \definefontsynonym [CBGreek-Regular-BoldExtended-Normal]        [grxn1000]
    \definefontsynonym [CBGreek-Regular-BoldExtended-Oblique]       [grxo1000]
    \definefontsynonym [CBGreek-Regular-BoldExtended-Italic]        [grxi1000]
    \definefontsynonym [CBGreek-Regular-BoldExtended-UprightItalic] [grxu1000]
    \definefontsynonym [CBGreek-Regular-BoldExtended-Caps]          [grxc1000]
    \definefontsynonym [CBGreek-Regular-BoldExtended-Leipzig]       [grxl1000]
    \definefontsynonym [CBGreek-Regular-BoldExtended-Roman]         [grxr1000]
    \loadmapfile [cbgreek.map]
\stoptypescript

\starttypescript [sans] [cbgreek] [name]
    \definefontsynonym [CBGreek-Sans-Medium-Normal]              [gsmn1000]
    \definefontsynonym [CBGreek-Sans-Medium-Oblique]             [gsmo1000]
    \definefontsynonym [CBGreek-Sans-Medium-Italic]              [gsmi1000]
    \definefontsynonym [CBGreek-Sans-Medium-UprightItalic]       [gsmu1000]
    \definefontsynonym [CBGreek-Sans-Medium-Caps]                [gsmc1000]
    \definefontsynonym [CBGreek-Sans-Medium-Leipzig]             [gsml1000]
    \definefontsynonym [CBGreek-Sans-Medium-Roman]               [gsmr1000]
    \definefontsynonym [CBGreek-Sans-BoldExtended-Normal]        [gsxn1000]
    \definefontsynonym [CBGreek-Sans-BoldExtended-Oblique]       [gsxo1000]
    \definefontsynonym [CBGreek-Sans-BoldExtended-Italic]        [gsxi1000]
    \definefontsynonym [CBGreek-Sans-BoldExtended-UprightItalic] [gsxu1000]
    \definefontsynonym [CBGreek-Sans-BoldExtended-Caps]          [gsxc1000]
    \definefontsynonym [CBGreek-Sans-BoldExtended-Leipzig]       [gsxl1000]
    \definefontsynonym [CBGreek-Sans-BoldExtended-Roman]         [gsxr1000]
    \loadmapfile [cbgreek.map]
\stoptypescript

\starttypescript [mono] [cbgreek] [name]
    \definefontsynonym [CBGreek-Typewriter-Medium-Normal]        [gttn1000]
    \definefontsynonym [CBGreek-Typewriter-Medium-Oblique]       [gtto1000]
    \definefontsynonym [CBGreek-Typewriter-Medium-Italic]        [gtti1000]
    \definefontsynonym [CBGreek-Typewriter-Medium-UprightItalic] [gttu1000]
    \definefontsynonym [CBGreek-Typewriter-Medium-Caps]          [gttc1000]
    \definefontsynonym [CBGreek-Typewriter-Medium-Leipzig]       [gttl1000]
    \definefontsynonym [CBGreek-Typewriter-Medium-Roman]         [gttr1000]
    \loadmapfile [cbgreek.map]
\stoptypescript

\starttypescript [serif] [cbgreek] [name]
    \definefontsynonym [Serif]            [CBGreek-Regular-Medium-Normal]
    \definefontsynonym [SerifSlanted]     [CBGreek-Regular-Medium-Oblique]
    \definefontsynonym [SerifItalic]      [CBGreek-Regular-Medium-Italic]
    \definefontsynonym [SerifCaps]        [CBGreek-Regular-Medium-Caps]
    \definefontsynonym [SerifBold]        [CBGreek-Regular-BoldExtended-Normal]
    \definefontsynonym [SerifBoldSlanted] [CBGreek-Regular-BoldExtended-Oblique]
    \definefontsynonym [SerifBoldItalic]  [CBGreek-Regular-BoldExtended-Italic]
    \definefontsynonym [SerifBoldCaps]    [CBGreek-Regular-BoldExtended-Caps]
    \loadmapfile [cbgreek.map]
\stoptypescript

\starttypescript [sans] [cbgreek] [name]
    \definefontsynonym [Sans]            [CBGreek-Sans-Medium-Normal]
    \definefontsynonym [SansSlanted]     [CBGreek-Sans-Medium-Oblique]
    \definefontsynonym [SansItalic]      [CBGreek-Sans-Medium-Italic]
    \definefontsynonym [SansCaps]        [CBGreek-Sans-Medium-Caps]
    \definefontsynonym [SansBold]        [CBGreek-Sans-BoldExtended-Normal]
    \definefontsynonym [SansBoldSlanted] [CBGreek-Sans-BoldExtended-Oblique]
    \definefontsynonym [SansBoldItalic]  [CBGreek-Sans-BoldExtended-Italic]
    \definefontsynonym [SansBoldCaps]    [CBGreek-Sans-BoldExtended-Caps]
    \loadmapfile [cbgreek.map]
\stoptypescript

\starttypescript [mono] [cbgreek] [name]
    \definefontsynonym [Mono]        [CBGreek-Typewriter-Medium-Normal]
    \definefontsynonym [MonoSlanted] [CBGreek-Typewriter-Medium-Oblique]
    \definefontsynonym [MonoItalic]  [CBGreek-Typewriter-Medium-Italic]
    \definefontsynonym [MonoCaps]    [CBGreek-Typewriter-Medium-Caps]
    \loadmapfile [cbgreek.map]
\stoptypescript

% Please note that we use Bold Extended instead of Bold

\starttypescript [serif] [cbgreek-all] [size]

  \definebodyfont [4pt,5pt] [rm]
    [tf=grmn0500 sa 1,sl=grmo0500 sa 1,it=grmi0500 sa 1,
     bf=grxn0500 sa 1,bs=grxo0500 sa 1,bi=grxi0500 sa 1,
     sc=grmc0500 sa 1]

  \definebodyfont [6pt] [rm]
    [tf=grmn0600,sl=grmo0600,it=grmi0600,
     bf=grxn0600,bs=grxo0600,bi=grxi0600,
     sc=grmc0600]

  \definebodyfont [7pt] [rm]
    [tf=grmn0700,sl=grmo0700,it=grmi0700,
     bf=grxn0700,bs=grxo0700,bi=grxi0700,
     sc=grmc0700]

  \definebodyfont [8pt] [rm]
    [tf=grmn0800,sl=grmo0800,it=grmi0800,
     bf=grxn0800,bs=grxo0800,bi=grxi0800,
     sc=grmc0800]

  \definebodyfont [9pt] [rm]
    [tf=grmn0900,sl=grmo0900,it=grmi0900,
     bf=grxn0900,bs=grxo0900,bi=grxi0900,
     sc=grmc0900]

  \definebodyfont [10pt] [rm]
    [tf=grmn1000,sl=grmo1000,it=grmi1000,
     bf=grxn1000,bs=grxo1000,bi=grxi1000,
     sc=grmc1000]

  \definebodyfont [11pt] [rm]
    [tf=grmn1095,sl=grmo1095,it=grmi1095,
     bf=grxn1095,bs=grxo1095,bi=grxi1095,
     sc=grmc1095]

  \definebodyfont [12pt] [rm]
    [tf=grmn1200,sl=grmo1200,it=grmi1200,
     bf=grxn1200,bs=grxo1200,bi=grxi1200,
     sc=grmc1200]

  \definebodyfont [14.4pt,17.3pt,20.7pt] [rm]
    [tf=grmn1440 sa 1,sl=grmo1440 sa 1,it=grmi1440 sa 1,
     bf=grxn1440 sa 1,bs=grxo1440 sa 1,bi=grxi1440 sa 1,
     sc=grmc1440 sa 1]

  \loadmapfile [cbgreek.map]

\stoptypescript

\starttypescript [sans] [cbgreek-all] [size]

  \definebodyfont [4pt,5pt] [ss]
    [tf=gsmn0500 sa 1,sl=gsmo0500 sa 1,it=gsmi0500 sa 1,
     bf=gsxn0500 sa 1,bs=gsxo0500 sa 1,bi=gsxi0500 sa 1,
     sc=gsmc0500 sa 1]

  \definebodyfont [6pt] [ss]
    [tf=gsmn0600,sl=gsmo0600,it=gsmi0600,
     bf=gsxn0600,bs=gsxo0600,bi=gsxi0600,
     sc=gsmc0600]

  \definebodyfont [7pt] [ss]
    [tf=gsmn0700,sl=gsmo0700,it=gsmi0700,
     bf=gsxn0700,bs=gsxo0700,bi=gsxi0700,
     sc=gsmc0700]

  \definebodyfont [8pt] [ss]
    [tf=gsmn0800,sl=gsmo0800,it=gsmi0800,
     bf=gsxn0800,bs=gsxo0800,bi=gsxi0800,
     sc=gsmc0800]

  \definebodyfont [9pt] [ss]
    [tf=gsmn0900,sl=gsmo0900,it=gsmi0900,
     bf=gsxn0900,bs=gsxo0900,bi=gsxi0900,
     sc=gsmc0900]

  \definebodyfont [10pt] [ss]
    [tf=gsmn1000,sl=gsmo1000,it=gsmi1000,
     bf=gsxn1000,bs=gsxo1000,bi=gsxi1000,
     sc=gsmc1000]

  \definebodyfont [11pt] [ss]
    [tf=gsmn1095,sl=gsmo1095,it=gsmi1095,
     bf=gsxn1095,bs=gsxo1095,bi=gsxi1095,
     sc=gsmc1095]

  \definebodyfont [12pt] [ss]
    [tf=gsmn1200,sl=gsmo1200,it=gsmi1200,
     bf=gsxn1200,bs=gsxo1200,bi=gsxi1200,
     sc=gsmc1200]

  \definebodyfont [14.4pt,17.3pt,20.7pt] [ss]
    [tf=gsmn1440 sa 1,sl=gsmo1440 sa 1,it=gsmi1440 sa 1,
     bf=gsxn1440 sa 1,bs=gsxo1440 sa 1,bi=gsxi1440 sa 1,
     sc=gsmc1440 sa 1]

  \loadmapfile [cbgreek.map]

\stoptypescript

\starttypescript [mono] [cbgreek-all] [size]

  \definebodyfont [4pt,5pt] [tt]
    [tf=gttn0500 sa 1,sl=gtto0500 sa 1,it=gtti0500 sa 1,
     sc=gttc0500 sa 1]

  \definebodyfont [6pt] [tt]
    [tf=gttn0600,sl=gtto0600,it=gtti0600,
     sc=gttc0600]

  \definebodyfont [7pt] [tt]
    [tf=gttn0700,sl=gtto0700,it=gtti0700,
     sc=gttc0700]

  \definebodyfont [8pt] [tt]
    [tf=gttn0800,sl=gtto0800,it=gtti0800,
     sc=gttc0800]

  \definebodyfont [9pt] [tt]
    [tf=gttn0900,sl=gtto0900,it=gtti0900,
     sc=gttc0900]

  \definebodyfont [10pt] [tt]
    [tf=gttn1000,sl=gtto1000,it=gtti1000,
     sc=gttc1000]

  \definebodyfont [11pt] [tt]
    [tf=gttn1095,sl=gtto1095,it=gtti1095,
     sc=gttc1095]

  \definebodyfont [12pt] [tt]
    [tf=gttn1200,sl=gtto1200,it=gtti1200,
     sc=gttc1200]

  \definebodyfont [14.4pt,17.3pt,20.7pt] [tt]
    [tf=gttn1440 sa 1,sl=gtto1440 sa 1,it=gtti1440 sa 1,
     sc=gttc1440 sa 1]

  \loadmapfile [cbgreek.map]

\stoptypescript

\starttypescript [serif] [cbgreek-medium] [size]

  \definebodyfont [4pt,5pt,6pt,7pt,8pt,9pt] [rm]
    [tf=grmn0800 sa 1,sl=grmo0800 sa 1,it=grmi0800 sa 1,
     bf=grxn0800 sa 1,bs=grxo0800 sa 1,bi=grxi0800 sa 1,
     sc=grmc0800 sa 1]

  \definebodyfont [10pt,11pt] [rm]
    [tf=grmn1000 sa 1,sl=grmo1000 sa 1,it=grmi1000 sa 1,
     bf=grxn1000 sa 1,bs=grxo1000 sa 1,bi=grxi1000 sa 1,
     sc=grmc1000 sa 1]

  \definebodyfont [12pt,14.4pt,17.3pt,20.7pt] [rm]
    [tf=grmn1200 sa 1,sl=grmo1200 sa 1,it=grmi1200 sa 1,
     bf=grxn1200 sa 1,bs=grxo1200 sa 1,bi=grxi1200 sa 1,
     sc=grmc1200 sa 1]

  \loadmapfile [cbgreek.map]

\stoptypescript

\starttypescript [sans] [cbgreek-medium] [size]

  \definebodyfont [4pt,5pt,6pt,7pt,8pt,9pt] [ss]
    [tf=gsmn0800 sa 1,sl=gsmo0800 sa 1,it=gsmi0800 sa 1,
     bf=gsxn0800 sa 1,bs=gsxo0800 sa 1,bi=gsxi0800 sa 1,
     sc=gsmc0800 sa 1]

  \definebodyfont [10pt,11pt] [ss]
    [tf=gsmn1000 sa 1,sl=gsmo1000 sa 1,it=gsmi1000 sa 1,
     bf=gsxn1000 sa 1,bs=gsxo1000 sa 1,bi=gsxi1000 sa 1,
     sc=gsmc1000 sa 1]

  \definebodyfont [12pt,14.4pt,17.3pt,20.7pt] [ss]
    [tf=gsmn1200 sa 1,sl=gsmo1200 sa 1,it=gsmi1200 sa 1,
     bf=gsxn1200 sa 1,bs=gsxo1200 sa 1,bi=gsxi1200 sa 1,
     sc=gsmc1200 sa 1]

  \loadmapfile [cbgreek.map]

\stoptypescript

\starttypescript [mono] [cbgreek-medium] [size]

  \definebodyfont [4pt,5pt,6pt,7pt,8pt,9pt] [tt]
    [tf=gttn0800 sa 1,sl=gtto0800 sa 1,it=gtti0800 sa 1,
     sc=gttc0800 sa 1]

  \definebodyfont [10pt,11pt] [tt]
    [tf=gttn1000 sa 1,sl=gtto1000 sa 1,it=gtti1000 sa 1,
     sc=gttc1000 sa 1]

  \definebodyfont [12pt,14.4pt,17.3pt,20.7pt] [tt]
    [tf=gttn1200 sa 1,sl=gtto1200 sa 1,it=gtti1200 sa 1,
     sc=gttc1200 sa 1]

  \loadmapfile [cbgreek.map]

\stoptypescript

\starttypescript [cbgreek-all]

  \definebodyfontenvironment [cbgreek] [default] []

  \definetypeface [cbgreek] [rm] [serif] [cbgreek] [cbgreek-all]
  \definetypeface [cbgreek] [ss] [sans]  [cbgreek] [cbgreek-all]
  \definetypeface [cbgreek] [tt] [mono]  [cbgreek] [cbgreek-all]

\stoptypescript

\starttypescript [cbgreek-medium] % lowercase, patched HH

  \definebodyfontenvironment [cbgreek] [default] []

  \definetypeface [cbgreek] [rm] [serif] [cbgreek] [cbgreek-medium]
  \definetypeface [cbgreek] [ss] [sans]  [cbgreek] [cbgreek-medium]
  \definetypeface [cbgreek] [tt] [mono]  [cbgreek] [cbgreek-medium]

\stoptypescript

\starttypescript [cbgreek] % lowercase, patched HH

  \definebodyfontenvironment [cbgreek] [default] []

  \definetypeface [cbgreek] [rm] [serif] [cbgreek] [default]
  \definetypeface [cbgreek] [ss] [sans]  [cbgreek] [default]
  \definetypeface [cbgreek] [tt] [mono]  [cbgreek] [default]

\stoptypescript

\stoptypescriptcollection

\endinput
