[NTG-context] using cmbright and hfbright fonts

M.J. Kallen mj_kallen at yahoo.com
Thu Nov 23 12:01:20 CET 2006


Ok, I've solved the AMS symbol problem by defining the following typescripts:

\starttypescript [math] [cmbr] [default]
    \definefontsynonym [Cmbr-Math-Alpha] [cmbras10]
    \definefontsynonym [Cmbr-Math-Beta] [cmbrbs10]
\stoptypescript

\starttypescript [math] [cmbr] [name]
    \definefontsynonym [MathAlpha] [Cmbr-Math-Alpha]
    \definefontsynonym [MathBeta] [Cmbr-Math-Beta]
\stoptypescript

Now it just needs cleaning up... In anticipation of further refinement, I've put a test on my wiki userpage at http://wiki.contextgarden.net/User:Maarten-Jan. ConTeXt live has the CM bright font installed, but not the hfbright Type1 version. 

Maarten-Jan

----- Original Message ----
From: M.J. Kallen <mj_kallen at yahoo.com>
To: [NTG-context] maillist <ntg-context at ntg.nl>
Sent: Tuesday, November 21, 2006 1:10:54 PM
Subject: [NTG-context] using cmbright and hfbright fonts

Hi all,

I couldn't find anything on using the Computer
Modern Bright font together with the Type1 versions (hfbright) so I
experimented a little myself. I consider myself a ConTeXt novice, so I
hope others can help me improve it.

Attached are two source
files: cmbr.tex and textfragment-context.tex. The latter is the text
used to test fonts in the free font survey (http://www.tug.org/tex-archive/info/Free_Math_Font_Survey/survey.html)
loosely adjusted for use in ConTeXt. The first file contains my
attempt at defining typescripts for CM Bright and compares regular
modern with CM Bright. I have a pdf output available for
those who do not have the necessary font files.

I'm
particularly interested in CM Bright/hfbright, because of the sans
serif math font which I believe is a good candidate for use with other
sans serif fonts (like the Verdana example in This Way #9). Besides
fixing any mistakes in my typescripts and setting things like bold math
and encodings up correctly, the one thing that remains to be done (I think) is to
define the math collection for cmbr. I'm not sure if something
elaborate like math-ams.tex is required. hfbright has two files
hfbras10.afm and hfbrbs10.afm, which look very similar to msam10.afm
and msbm10.afm so maybe there's an easier way (font synonyms?) of using
the hfbright AMS symbols instead of the regular AMS symbols?

I
think this would be a nice addition (perhaps in the form of a module)
to ConTeXt. Any suggestions and help are greatly appreciated!

Maarten-Jan







____________________________________________________________________________________
Sponsored Link

Mortgage rates near 39yr lows. 
$310k for $999/mo. Calculate new payment! 
www.LowerMyBills.com/lre
%&context

\starttypescript [sans] [cmbr] [texnansi]

    \definefontsynonym [Cmbr]           [cmbr10]

    \definefontsynonym [Cmbr-Bold]      [cmbrbx10]

    \definefontsynonym [Cmbr-Slanted]   [cmbrsl10]

\stoptypescript



\starttypescript [sans] [cmbr] [name]

    \definefontsynonym [Sans]           [Cmbr]

    \definefontsynonym [SansBold]       [Cmbr-Bold]

    \definefontsynonym [SansItalic]     [Cmbr-Slanted] % no italic as far as I can see

    \definefontsynonym [SansSlanted]    [Cmbr-Slanted]

\stoptypescript



\starttypescript [serif] [cmbr] [name] % serif is the same as sans

    \definefontsynonym [Serif]           [Cmbr]

    \definefontsynonym [SerifBold]       [Cmbr-Bold]

    \definefontsynonym [SerifItalic]     [Cmbr-Slanted] % no italic as far as I can see

    \definefontsynonym [SerifSlanted]    [Cmbr-Slanted]

\stoptypescript



\starttypescript [mono] [cmbr] [texnansi]

    \definefontsynonym [Cmbr-Mono]          [cmtl10]

    \definefontsynonym [Cmbr-MonoSlanted]   [cmsltl10]

\stoptypescript



\starttypescript [mono] [cmbr] [name]

    \definefontsynonym [Mono]           [Cmbr-Mono]

    \definefontsynonym [MonoSlanted]    [Cmbr-MonoSlanted]

\stoptypescript



\starttypescript [math] [cmbr] [default]

    \definefontsynonym [Cmbr-Math-Letters]    [cmbrmi10]

    \definefontsynonym [Cmbr-Math-Symbols]    [cmbrsy10]

\stoptypescript



\starttypescript [math] [cmbr] [name]

    \definefontsynonym [MathRoman]        [Cmbr]

    \definefontsynonym [MathItalic]        [Cmbr-Math-Letters]

    \definefontsynonym [MathSymbol]        [Cmbr-Math-Symbols]

\stoptypescript



\starttypescript [math] [cmbr] [name]

    \definefontsynonym [Calligraphic]    [MathSymbol]        

\stoptypescript



\starttypescript [boldmath,bfmath] [cmbr] [default]

    \definefontsynonym [Cmbr-Math-Letters-Bold]    [cmbrbm10]

\stoptypescript



\starttypescript [Cmbr]

    \definetypeface [Cmbr] [ss] [sans] [cmbr] [default] [encoding=texnansi]

    \definetypeface [Cmbr] [tt] [mono] [cmbr] [default] [encoding=texnansi]

    \definetypeface [Cmbr] [mm] [math] [cmbr] [default] [encoding=default]

    \definetypeface [Cmbr] [rm] [serif] [cmbr] [default] [encoding=texnansi]



%    \usemathcollection[cmbr]

\stoptypescript



\starttext

\switchtobodyfont[modern,10pt]



\showbodyfont



\blank[big]



\input textfragment-context



%\showmathcharacters



%----------------------------

\loadmapfile[hfbright.map] % required to embed Type1 fonts

\usetypescript[Cmbr]



\switchtobodyfont[Cmbr,10pt]



\showbodyfont



\blank[big]



\input textfragment-context



%\showmathcharacters



\stoptext


%&context

{\bf Theorem 1 (Residue Theorem).}
Let $f$ be analytic in the region $G$ except for the isolated singularities $a_1,a_2,\ldots,a_m$. If $\gamma$ is a closed rectifiable curve in $G$ which does not pass through any of the points $a_k$ and if $\gamma\approx 0$ in $G$ then
\startformula
\frac{1}{2\pi i}\int_\gamma f = \sum_{k=1}^m n(\gamma;a_k) \text{Res}(f;a_k).
\stopformula

{\bf Theorem 2 (Maximum Modulus).}
{\em Let $G$ be a bounded open set in ${\mb C}$ and suppose that $f$ is a continuous function on $G^-$ which is analytic in $G$. Then}
\startformula
\max\{|f(z)|:z\in G^-\}=\max \{|f(z)|:z\in \partial G \}.
\stopformula
%\vspace*{-1em}

\define\abc{abcdefghijklmnopqrstuvwxyz}
\define\ABC{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\define\alphabeta{\alpha\beta\gamma\delta\epsilon\varepsilon\zeta\eta\theta\vartheta\iota\kappa\varkappa\lambda\mu\nu\xi o\pi\varpi\rho\varrho\sigma\varsigma\tau\upsilon\phi\varphi\chi\psi\omega}
\define\AlphaBeta{\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega}

%\ABC \quad $\ABC$

%\abc \quad $\abc$ \quad $01234567890$

%$\AlphaBeta$ \quad $\alphabeta$ \quad $\ell\wp\aleph\infty\propto\emptyset\nabla\partial\mho\imath\jmath\hslash\eth$

${\rm A} \Lambda \Delta \nabla {\rm B C D} \Sigma {\rm E F} \Gamma {\rm G H I J K L M N O} \Theta \Omega \mho {\rm P} \Phi \Pi \Xi {\rm Q R S T U V W X Y} \Upsilon \Psi {\rm Z} $  $ \quad 1234567890 $

%$\mathit{A \Lambda \Delta B C D E F \Gamma G H I J K L M N O \Theta \Omega P \Phi \Pi \Xi Q R S T U V W X Y \Upsilon \Psi Z }$

% don't allow overfull boxes
$a\alpha b \beta c \partial d \delta e \epsilon \varepsilon f \zeta \xi g \gamma h \hbar \hslash \iota i \imath j \jmath k \kappa \varkappa l \ell \lambda m n \eta \theta \vartheta o \sigma \varsigma \phi \varphi \wp p \rho \varrho q r s t \tau \pi u \mu \nu v \upsilon w \omega \varpi x \chi y \psi z$ $\infty \propto \emptyset \varnothing {\rm d}\eth \backepsilon$

${\cal \ABC} \quad {\mb \ABC}$

%\boldmath $\alpha + b = 27$



_______________________________________________
ntg-context mailing list
ntg-context at ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


 
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com


More information about the ntg-context mailing list