Hi all, could someone bring light into the way how to use symbols…in MKIV I wanted to extract a symbol from uzdr (Zapfdingbats). In MIII the that worked like this: \definefontsynonym[Dingbats][uzdr] \definesymbol[box][\getglyph{Dingbats}{\char113}] In MKIV this is not the case. I tried to find out with the font-manual, unfortunately it only shows the content of the symb-imp-eur.mkiv. I tried to find the fonts mentioned in that file, but miserably failed. I tried different approaches but get now result, except for the black diamond, but this is defined internally in ConTeXt (\definesymbol[blackdiamond] [\textormathchar{"2666}]. \definefontsynonym[Dingbats][uzdr] \definefontsynonym[MSAM][msam10] \definesymbol[boxA] [\getglyph{Dingbats}{\char113}] %Seems to be changed... \definesymbol[boxB] [\getglyph{Dingbats}{\char"274F}] % U+0274F, 00052, a74 \definesymbol[cuttingscissors] [\getglyph{Dingbats}{\utfchar{"2701}}] \definesymbol[blackdiamond] [\textormathchar{"2666}] \definesymbol[blackdiamondvar][\textormathchar{"25C6}] \definesymbol[diamondfilled] [\getglyph{MSAM}{\utfchar{"F0067}}] \starttext Thanks for support… Willi \symbol{boxA} \symbol{boxB} \symbol{cuttingscissors} \symbol{blackdiamond} \symbol{blackdiamondvar} \symbol{diamondfilled} \stoptext
On 11/20/2012 5:21 PM, Willi Egger wrote:
Hi all,
could someone bring light into the way how to use symbols…in MKIV
I wanted to extract a symbol from uzdr (Zapfdingbats).
(Somehow uzdr.afm and uzdr.pfb are not in my tex tree. I always thought that they were part of the standalone but nothing surprises me as these fonts have a history of instability.) (Copied from an upcoming font manual:) \startsection[title=Unicoding] Nowadays we will mostly use fonts that ship with a \UNICODE\ aware encoding. And in \CONTEXT, even if we use a \TYPEONE\ font, it gets mapped onto \UNICODE. However, there are some exceptions, for instance the Zapf Dingbats in \TYPEONE\ format. These have a rather obscure private encoding and the glyph names run from \type {a1} upto \type {a206} and have no relation to what the glyph represents. In the case of Dingbats we're somewhat lucky that they ended up in \UNICODE, so we can relocate the glyphs to match their rightful place. This is done by means of a goodies file. We already discussed this in \in {section} [goodies] so we only repeat the usage. \startbuffer \definefontfeature [dingbats] [mode=base, goodies=dingbats, unicoding=yes] \definefontsynonym [ZapfDingbats] [file:uzdr.afm] [features=dingbats] \stopbuffer \typebuffer \getbuffer I tend to qualify the Dingbat font in \TEX\ distributions as rather unstable because of name changes and them either or not being included. Therefore it's best to use the hard coded name because that triggers the most visible error message when the font is not found. A font like this can for instance be used with the glyph placement macros as is demonstrated below. In the last line we see that a direct \UTF\ input also works out well. \starttabulate[|||] \HL \NC \type{\getglyphdirect {ZapfDingbats*dingbats}{\number"2701}} \NC \getglyphdirect {ZapfDingbats*dingbats}{\number"2701} \NC \NR \NC \type{\getglyphdirect {ZapfDingbats*dingbats}{\char"2701}} \NC \getglyphdirect {ZapfDingbats*dingbats}{\char"2701} \NC \NR \NC \type{\getnamedglyphdirect{ZapfDingbats*dingbats}{a1}} \NC \getnamedglyphdirect{ZapfDingbats*dingbats}{a1} \NC \NR \NC \type{\getnamedglyphdirect{ZapfDingbats*dingbats}{a11}} \NC \getnamedglyphdirect{ZapfDingbats*dingbats}{a11} \NC \NR \HL \NC \type{\getglyphdirect {ZapfDingbats}{\number"2701}} \NC \getglyphdirect {ZapfDingbats}{\number"2701} \NC \NR \NC \type{\getglyphdirect {ZapfDingbats}{\char"2701}} \NC \getglyphdirect {ZapfDingbats}{\char"2701} \NC \NR \NC \type{\getnamedglyphdirect{ZapfDingbats}{a1}} \NC \getnamedglyphdirect{ZapfDingbats}{a1} \NC \NR \NC \type{\getnamedglyphdirect{ZapfDingbats}{a11}} \NC \getnamedglyphdirect{ZapfDingbats}{a11} \NC \NR \HL \NC \type{\definedfont[ZapfDingbats*dingbats]✁} \NC \definedfont[ZapfDingbats*dingbats]✁ \NC \NR \HL \stoptabulate Keep in mind that fonts like Dejavu (that we use here as document font) already has these characters which is why it shows up in the verbose part of the table. \stopsection -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans, thank you very much for this section. - I see that the approach is different from what I was trying to do. - I will study and try it! Willi On Nov 21, 2012, at 10:26 AM, Hans Hagen wrote:
On 11/20/2012 5:21 PM, Willi Egger wrote:
Hi all,
could someone bring light into the way how to use symbols…in MKIV
I wanted to extract a symbol from uzdr (Zapfdingbats).
(Somehow uzdr.afm and uzdr.pfb are not in my tex tree. I always thought that they were part of the standalone but nothing surprises me as these fonts have a history of instability.)
(Copied from an upcoming font manual:)
\startsection[title=Unicoding]
Nowadays we will mostly use fonts that ship with a \UNICODE\ aware encoding. And in \CONTEXT, even if we use a \TYPEONE\ font, it gets mapped onto \UNICODE. However, there are some exceptions, for instance the Zapf Dingbats in \TYPEONE\ format. These have a rather obscure private encoding and the glyph names run from \type {a1} upto \type {a206} and have no relation to what the glyph represents.
In the case of Dingbats we're somewhat lucky that they ended up in \UNICODE, so we can relocate the glyphs to match their rightful place. This is done by means of a goodies file. We already discussed this in \in {section} [goodies] so we only repeat the usage.
\startbuffer \definefontfeature [dingbats] [mode=base, goodies=dingbats, unicoding=yes]
\definefontsynonym [ZapfDingbats] [file:uzdr.afm] [features=dingbats] \stopbuffer
\typebuffer \getbuffer
I tend to qualify the Dingbat font in \TEX\ distributions as rather unstable because of name changes and them either or not being included. Therefore it's best to use the hard coded name because that triggers the most visible error message when the font is not found.
A font like this can for instance be used with the glyph placement macros as is demonstrated below. In the last line we see that a direct \UTF\ input also works out well.
\starttabulate[|||] \HL \NC \type{\getglyphdirect {ZapfDingbats*dingbats}{\number"2701}} \NC \getglyphdirect {ZapfDingbats*dingbats}{\number"2701} \NC \NR \NC \type{\getglyphdirect {ZapfDingbats*dingbats}{\char"2701}} \NC \getglyphdirect {ZapfDingbats*dingbats}{\char"2701} \NC \NR \NC \type{\getnamedglyphdirect{ZapfDingbats*dingbats}{a1}} \NC \getnamedglyphdirect{ZapfDingbats*dingbats}{a1} \NC \NR \NC \type{\getnamedglyphdirect{ZapfDingbats*dingbats}{a11}} \NC \getnamedglyphdirect{ZapfDingbats*dingbats}{a11} \NC \NR \HL \NC \type{\getglyphdirect {ZapfDingbats}{\number"2701}} \NC \getglyphdirect {ZapfDingbats}{\number"2701} \NC \NR \NC \type{\getglyphdirect {ZapfDingbats}{\char"2701}} \NC \getglyphdirect {ZapfDingbats}{\char"2701} \NC \NR \NC \type{\getnamedglyphdirect{ZapfDingbats}{a1}} \NC \getnamedglyphdirect{ZapfDingbats}{a1} \NC \NR \NC \type{\getnamedglyphdirect{ZapfDingbats}{a11}} \NC \getnamedglyphdirect{ZapfDingbats}{a11} \NC \NR \HL \NC \type{\definedfont[ZapfDingbats*dingbats]✁} \NC \definedfont[ZapfDingbats*dingbats]✁ \NC \NR \HL \stoptabulate
Keep in mind that fonts like Dejavu (that we use here as document font) already has these characters which is why it shows up in the verbose part of the table.
\stopsection
--
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________
participants (2)
-
Hans Hagen
-
Willi Egger