These basic set of rules should also apply to fourier or any other
font that still needs better math support. I'm posting them on the
list for future reference (for when the next volunteer pops up).


On Fri, Feb 19, 2010 at 14:50, Troy Henderson wrote:
>
> I have followed the first set of instructions at
>
> http://wiki.contextgarden.net/Lucida
...
> Is there an easy way to adapt the configuration file(s) for MKII to MKIV?
> If this is possible but just requires a tedious process, I'm willing
> to do this, but I have no clue of the steps needed.

So here are some basic instructions:

Step 1: check what's in the fonts
=====

The file lucida.map includes the following lines:

hlcda LucidaNewMath-Arrows-Demi <lbmad.pfb
hlcdim LucidaNewMath-DemiItalic <lbmdi.pfb
hlcdima LucidaNewMath-AltDemiItalic <lbmdo.pfb
hlcdm LucidaNewMath-Demibold <lbmd.pfb
hlcdy LucidaNewMath-Symbol-Demi <lbmsd.pfb
hlcra LucidaNewMath-Arrows <lbma.pfb
hlcrim LucidaNewMath-Italic <lbmi.pfb
hlcrima LucidaNewMath-AltItalic <lbmo.pfb
hlcrm LucidaNewMath-Roman <lbmr.pfb
hlcrv LucidaNewMath-Extension <lbme.pfb
hlcry LucidaNewMath-Symbol <lbms.pfb

After short inspection you may notice that some are just bold
variants, so you are basically left with only 6 files that you need to
take care of:

hlcrm LucidaNewMath-Roman <lbmr.pfb
hlcrim LucidaNewMath-Italic <lbmi.pfb
hlcrima LucidaNewMath-AltItalic <lbmo.pfb

hlcrv LucidaNewMath-Extension <lbme.pfb
hlcry LucidaNewMath-Symbol <lbms.pfb
hlcra LucidaNewMath-Arrows <lbma.pfb

You may want to visualize the content of those fonts by using:

\loadmapfile[lucida.map]
\starttext
\showfont[hlcrm]
\showfont[hlcrim]
\showfont[hlcrima]
\showfont[hlcrv]
\showfont[hlcry]
\showfont[hlcra]
\stoptext

Step 2: compare
=====

It might be interesting to know what's in LM (so that you know what
you need to modify):

\starttext
\showfont[rm-lmr10]
\showfont[lmmi10]
\showfont[lmex10]
\showfont[lmsy10]
\stoptext

as well as seing what's in ams fonts perhaps. Now all the info that
describes the content of these files is in math-tex.mkii (for MKII)
and math-vfu.lua (for MKIV):

mathematics.make_font ( "lmroman10-math", {
    { name = "lmroman10-regular.otf", features = "virtualmath", main = true },
    { name = "rm-lmr10.tfm", vector = "tex-mr-missing" } ,
    { name = "lmmi10.tfm", vector = "tex-mi", skewchar=0x7F },
    { name = "lmmi10.tfm", vector = "tex-it", skewchar=0x7F },
    { name = "lmsy10.tfm", vector = "tex-sy", skewchar=0x30,
parameters = true } ,
    { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
    { name = "msam10.tfm", vector = "tex-ma" },
    { name = "msbm10.tfm", vector = "tex-mb" },
 -- { name = "rm-lmbx10.tfm", vector = "tex-bf" } ,
    { name = "lmroman10-bold.otf", vector = "tex-bf" } ,
    { name = "lmmib10.tfm", vector = "tex-bi", skewchar=0x7F } ,
    { name = "lmsans10-regular.otf", vector = "tex-ss", optional=true },
    { name = "lmmono10-regular.otf", vector = "tex-tt", optional=true },
    { name = "eufm10.tfm", vector = "tex-fraktur", optional=true },
    { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true },
} )

You may want to check any tfm font mentioned here as well as any
vector="..." mentioned.

fonts.enc.math["tex-mi"] = {
    [0x1D6E4] = 0x00, -- Gamma
    [0x1D6E5] = 0x01, -- Delta
    [0x1D6E9] = 0x02, -- Theta
    [0x1D6F3] = 0x02, -- varTheta (not present in TeX)
    [0x1D6EC] = 0x03, -- Lambda
    [0x1D6EF] = 0x04, -- Xi
    [0x1D6F1] = 0x05, -- Pi

There's a very precious source of information available for unicode
mappings for many fonts that might be worth considering:
     tex4ht/ht-fonts/unicode/

Step 3: make use of available glyph information
=====

3a)
You may use lucidabr.sty as a pretty reliable source of information to
extract the mapping between:
- glyph name (in LaTeX)
- font
- slot

3b)
In char-def.lua there are some mappings between context commands and
unicode points. If any mapping is missing, you need to add it anyway
(else you won't be able to use that particular command), for all other
commands you already have unicode point, so when you find "rightarrow"
or some other glyph in font, you may look it up in char-def.lua to
determine the unicode number.

You may want to use both the comprehensive TeX symbol list as well as
the Unicode Standard to help you out if there are some glyphs you
don't know.

Step 4: fix math-lbr
=====

Step 5: complete the vectors in math-vfu.lua
=====

I'm not completly sure about some aspects of bold math, but here are
at least some points to start with.

Step 6: test
=====

Translate ams test paper and the comprehensive LaTeX symbol list to
ConTeXt in order to test if all the characters work ok in all the math
fonts supported by ConTeXt :) :) :)

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to