1

I tried to modify a copy of cmsy10, by renaming it. My aim is to insert a external glyph from another font family (e.g euler). With fontforge tools, I created the font and inserted it into my local tree. When I tried to use it (in Plain TeX) the log said that there weren't sufficient symbols.

I've inserted correctly the new font and created a map file too. In addition, TeX seems to recognize it because it creates correctly its font table. However, it does not work as symbol font family.

Right now, I think there are two possible aspects: I did something wrong during the customization with fontforge, or TeX does not allow so easily to insert a new font for the symbols.

Is it right?

Martino
  • 1,400
  • All we can tell is that you did something wrong, but with no information its not possible to say what. cmsy and euler are both (originally) metafont fonts, but I assume as you mention fontforge you are not modifying metfont sources but rather a type1? variant of the fonts. Have you also modified the tfm file to match,? really you need to give more clues. – David Carlisle Dec 01 '13 at 19:20
  • If you are using this from TeX, why modify the font rather than just use the glyphs from the separate fonts. Each character in math mode is drawn from a specified font so it is trivial to make all symbols except say + come from cm and + come from euler. – David Carlisle Dec 01 '13 at 19:25
  • @DavidCarlisle To the first comment: I've opened with fontforge the cmsy10.pfb font and another one, from which I just copy a single glyph and copy onto the respective in cmsy10. Then, I saved the font, creating pfb~ andafmfiles that I turned intotfmone withafm2tfmutility. Thus, I insert these two new font (pfb and tfm) into my local tree and tried to use it (with the subsitution of\tensy` font). – Martino Dec 01 '13 at 21:54
  • @DavidCarlisle Do you mean to use \char# instruction? However, my aim is to create a font the allows me to compile my .tex files without change or add anything. – Martino Dec 01 '13 at 21:56
  • No no change in markup in the expression. Unlike text mode where there is a "current font" in math, each character comes from a separately specified font, so you can globally specify that a comes from cmr - comes from cmsy and + comes from euler then $a+a-a$ will use the specified fonts. – David Carlisle Dec 01 '13 at 22:10
  • The afm file will not have any of the tex math font parameters required in the tfm file. You will need to edit the VPL (text version of tfm) file of the original. – David Carlisle Dec 01 '13 at 22:12
  • And how I should edit the vpl file? Anyway, I'm going to study what you've post in the answer below. – Martino Dec 01 '13 at 22:31
  • a vpl file is just text edit it in emacs or notepad or whatever – David Carlisle Dec 01 '13 at 22:43
  • A vpl file is used for virtual fonts. This seems to be an actual font. One would use tftopl on cmsy10.tfm to get a pl file, then rename it, add the metric information for the new character and run pltotf (assuming fontforge didn't change any metrics). – Dan Dec 02 '13 at 02:57

1 Answers1

5

There is no need to modify the font to make particular characters use different glyphs in math mode. The following shows the result of typesetting $abc+123$ after specifying that a should use the bold euler fraktur font, also as requested redefined \leq to use a character from Palatino (< as an example you can use any slot you want).

enter image description here

$abc + 123 \leq a$

\font\foo=eufb10

\newfam\foofam
\textfont\foofam=\foo
\count0=\foofam
\multiply\count0 by "100
\advance\count0 by `a
\mathcode`a=\count0
\count0=0



\font\foob=pplr8r at 10pt % map file resolves this to  <8r.enc <uplr8a.pfb
\newfam\foobfam
\textfont\foobfam=\foob
\count0=\foobfam
\multiply\count0 by "100 % the new fam
\advance\count0 by "3000 % mathrel
\advance\count0 by "3C % The character we want (not sure which you do want)
\mathchardef\leq\count0
\count0=0


$abc + 123 \leq a $




\bye
David Carlisle
  • 757,742
  • Unfortunately I don't understand how to use these instructions: could you give me another example, in which glyphs and symbols are redefined from another font family? In addition, could this font family belongs to a text one, and not to a math one? e.g. redefine \leq glyph as another glyph taken from uplr8r (this is just an example) – Martino Dec 02 '13 at 12:11
  • \leq is even easier as that isn't accessed by an input characters \mathcode but simply the definition of \leq which defines which font to use and which slot number. I'll add to answer in a bit – David Carlisle Dec 02 '13 at 12:13
  • I'll update my answer but also look at http://tex.stackexchange.com/questions/119467/how-latex-makes-use-of-font-related-files-i-e-fd-map-enc-def-etc-whe/119501#119501 – David Carlisle Dec 02 '13 at 12:35
  • That's almost what I'm looking for, but just another question: how can I access to another relation symbol e.g.: how can I redefined \geq glyph and so on by using that count? – Martino Dec 02 '13 at 13:15
  • @Lorenzo the "3C is the hex code of the glyph I used. If you know the font encoding you are pulling in you should know the character number, if you'd rather use decimal than hex omit the " prefix – David Carlisle Dec 02 '13 at 14:01
  • Ok I known the number of all characters, but how can I use \mathchardef after \mathchardef\leq\count0 in order to redefine another relation symbol? e.g. What I should write afer: \mathchardef\geq....? – Martino Dec 02 '13 at 15:49
  • @Lorenzo The system will be reminding you (as it is me) that you shouldn't ask followup questions in comments but rather ask a new question. But I hoped it was clear that for each character you just copy the block between (and including) the two \count0= lines and change "3C to whatever slot you need. – David Carlisle Dec 02 '13 at 16:11