ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Still don't understand how to switch fonts in the new context
@ 2001-08-21 10:15 Olya Briginets
  2001-08-21 13:45 ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Olya Briginets @ 2001-08-21 10:15 UTC (permalink / raw)


Hello ConTeXt gurus,

I think I'm able to use particular fonts in particular encoding,
but could someone tell me, what is the *intended* way to set body fonts,
encodings etc. in the new ConTeXt?

Namely,

-- to use some input encoding, I should say something like 
\enableregime[windows], and that's all. 
Right?

-- I guess there must be few commands to set up body font for my whole dosument,
so that after this setup I can use regular commands like \tfa, \tf, \ss etc. For
example, I may wish that my bodyfont was sansserif, besides, some particular
sansserif, either cmss or ecss or Helvetica, and that it was it particular
encoding, say ec (or texnansi). 
What setup command should I use?

-- is there any connection between font setup and language setup, either in user
document or in the format file?
I think there must be no such a connection, except via *.pat files, so user must
use correct encoding to get correct hyphenation.

Olya


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Still don't understand how to switch fonts in the new context
  2001-08-21 10:15 Still don't understand how to switch fonts in the new context Olya Briginets
@ 2001-08-21 13:45 ` Hans Hagen
  2001-08-21 19:59   ` Olya Briginets
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2001-08-21 13:45 UTC (permalink / raw)
  Cc: ConTeXt mailing list

At 01:15 PM 8/21/2001 +0300, Olya Briginets wrote:

>-- to use some input encoding, I should say something like
>\enableregime[windows], and that's all.
>Right?

right, but i think that you need another one -)

>-- I guess there must be few commands to set up body font for my whole 
>dosument,
>so that after this setup I can use regular commands like \tfa, \tf, \ss 
>etc. For
>example, I may wish that my bodyfont was sansserif, besides, some particular
>sansserif, either cmss or ecss or Helvetica, and that it was it particular
>encoding, say ec (or texnansi).
>What setup command should I use?

in the new way you load a (set of) typescripts, and preferably define a 
typeface

\definetypeface [nicefonts] .....

after that both

\setuptypeface
\setupbodyfont

accent nicefont as key (\nicefont is also okay). The \setup command defines 
the bodyfont, the \switchto commands the local variant.

In one doc, you can mix typefaces

>-- is there any connection between font setup and language setup, either 
>in user
>document or in the format file?
>I think there must be no such a connection, except via *.pat files, so 
>user must
>use correct encoding to get correct hyphenation.

that's kind of font related, but you can have a language dependency. Czech 
for instance gets two sets of patterns loaded, one for ec and one for il2 
[actually the same patterns with different mappings, see cont-usr.tex:

\installlanguage [cz] [mapping={il2,ec},encoding={il2,ec}]

This means that patterns will be loaded twice.

It all sounds (and is) complicated but once it works ...

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Still don't understand how to switch fonts in the new context
  2001-08-21 13:45 ` Hans Hagen
@ 2001-08-21 19:59   ` Olya Briginets
  2001-08-22 12:06     ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Olya Briginets @ 2001-08-21 19:59 UTC (permalink / raw)


Hello Hans,

Thank for your answer, I read it and then I reread mfonts.pdf and I thought that
I got the point, but in practice, something still does not fork, with predefined
typefaces.

I have problem specifying font encoding: it works only until font switching
command. I write (the example from Willi Egger):

  \setupencoding[default=ec]
  \setupbodyfont[pos,ber]
  \enableencoding[ec]
  \enableregime[windows]

  \starttext

  \Adiaeresis Ä\"Argerlicher Fall.

  \"Uberaus gesch\"atzt.

  Gro\SS ist die Zuneigung.

  äöüèàé

  \"a, \"o, \"u, \'e,  \`e

  \aa, \AA

  \tf
  %\enableencoding[ec]

  \Adiaeresis Ä\"Argerlicher Fall.

  \"Uberaus gesch\"atzt.

  Gro\SS ist die Zuneigung.

  äöüèàé

  \"a, \"o, \"u, \'e,  \`e

  \aa, \AA

  \stoptext

And after any font switching command, even \tf, accents go wrong -- id est those
defined via \defineaccent (those that are input verbatim like ä are OK). If I
put \enableencoding[ec] after font switching command, accents are fixed, but
surely I'm not supposed to put \enableencoding[ec] after each font switch.

What have I missed? How to set up encoding globally? (\setupbodyfont does not
seem to accept encoding as argument.)

Olya


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Still don't understand how to switch fonts in the new context
  2001-08-21 19:59   ` Olya Briginets
@ 2001-08-22 12:06     ` Hans Hagen
  2001-08-22 18:28       ` Olya Briginets
       [not found]       ` <5.1.0.14.1.20010823181735.0256b7d0@server-1>
  0 siblings, 2 replies; 9+ messages in thread
From: Hans Hagen @ 2001-08-22 12:06 UTC (permalink / raw)
  Cc: ConTeXt mailing list

Hi,

I have problem specifying font encoding: it works only until font switching
>command. I write (the example from Willi Egger):
>
>   \setupencoding[default=ec]
>   \setupbodyfont[pos,ber]
>   \enableencoding[ec]
>   \enableregime[windows]
>
>   \starttext
>
>   \Adiaeresis Ä\"Argerlicher Fall.
.....
>And after any font switching command, even \tf, accents go wrong -- id est 
>those
>defined via \defineaccent (those that are input verbatim like ä are OK). If I
>put \enableencoding[ec] after font switching command, accents are fixed, but
>surely I'm not supposed to put \enableencoding[ec] after each font switch.
>
>What have I missed? How to set up encoding globally? (\setupbodyfont does not
>seem to accept encoding as argument.)

You only have to \enable encoding if there is a real reason for it. 
Normally the encoding is switched with the font. So, it looks like a 
misconfiguration.

You can add the following code to cont-new.tex (assuming you use pdfetex)

\unprotect

\def\tracedfontencoding#1%
   {\ifcsname\??ff#1\s!encoding\endcsname
      \space[\csname\??ff#1\s!encoding\endcsname]%
    \fi}

\def\tracedfontname#1%
   {\ifcsname\??ff\fontclass#1\endcsname
      #1\tracedfontencoding{\fontclass#1}\space->\space
        \@EA\tracedfontname\csname\??ff\fontclass#1\endcsname
    \else\ifcsname\??ff#1\endcsname
      #1\tracedfontencoding{#1}\space->\space
        \@EA\tracedfontname\csname\??ff#1\endcsname
    \else
      #1%
    \fi\fi}

\protect

You can now say something like

\message{\tracedfontname{Serif}} and see what font name is actually used 
and where in the chain the encoding is set.

The last name in the row should be defined in a map file and mapped onto a 
real filename. Either this map file is loaded runtime, or the entry should 
be in your local pdftex map file.

Now, if there is no [ec] in this chain, you're not using ec, which means 
some error in the setup.

Once you've sorted out what you want / need, we can add some entries to 
typescripts useful for your language

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Still don't understand how to switch fonts in the new context
  2001-08-22 12:06     ` Hans Hagen
@ 2001-08-22 18:28       ` Olya Briginets
  2001-08-23 16:17         ` Hans Hagen
       [not found]       ` <5.1.0.14.1.20010823181735.0256b7d0@server-1>
  1 sibling, 1 reply; 9+ messages in thread
From: Olya Briginets @ 2001-08-22 18:28 UTC (permalink / raw)


Hello Hans,

Hans Hagen wrote:
> 
> Hi,
> 
> I have problem specifying font encoding: it works only until font switching
> >command. I write (the example from Willi Egger):
> >
> >   \setupencoding[default=ec]
> >   \setupbodyfont[pos,ber]
> >   \enableencoding[ec]
> >   \enableregime[windows]
> >
> >   \starttext
> >
> >   \Adiaeresis Ä\"Argerlicher Fall.

[skipped]

> You can add the following code to cont-new.tex (assuming you use pdfetex)

[skipped]

> You can now say something like
> 
> \message{\tracedfontname{Serif}} and see what font name is actually used
> and where in the chain the encoding is set.

I did it and get
  Serif -> Times-Roman -> ec-utmr8a [ec] -> ptmr8t 
just what I expected, so it seems that it's all OK with fonts. 
It seems to me that the problem is not with fonts, but either with encodings or
with font switching commands, like \tf, \tfa etc. 

One more time: 
after \setupencoding[default=ec] \setupbodyfont[pos,ber] fonts seems to be
correct, but commands like \Adiaeresis are -- well, not undefined, but seems not
defined correctly. 
If I write 
  \enableencoding[ec], 
or if I write directly in my document
  \definecharacter Adiaeresis      196
and so on, it helps, but only up to next font switching command.
\tf spoils encoding again, so I need \enableencoding[ec] again.

> The last name in the row should be defined in a map file and mapped onto a
> real filename. Either this map file is loaded runtime, or the entry should
> be in your local pdftex map file.

I checked both pdf and dvi output (with dvitype utility), and revealed that the
fonts there are what I expected, but instead of, say, A or U with diaeresis
(umlaut) I got A or U, combined with the character with code 127 -- I mean,
instead of all umlauts, tildes, grave and acute accents, char 127 are used. I
have no idea why.

> Now, if there is no [ec] in this chain, you're not using ec, which means
> some error in the setup.

It seems that _fonts_ are ec, but definitions from enco-ec don't work.
In fact, it seems that some of definitions in \fonstrategies somehow switches
font to default encoding or something else, but I'm not able to dig so deep.

> Once you've sorted out what you want / need, we can add some entries to
> typescripts useful for your language

Currently I'm just trying to make system work with already supported languages
and fonts, e.g. deutch and urw fonts. I know that simple \setupbodyfont[ber,pos]
did work in previous ConTeXt versions. 

> Hans

Olya


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Still don't understand how to switch fonts in the new context
  2001-08-22 18:28       ` Olya Briginets
@ 2001-08-23 16:17         ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2001-08-23 16:17 UTC (permalink / raw)
  Cc: ConTeXt mailing list

At 09:28 PM 8/22/2001 +0300, Olya Briginets wrote:

The strange thing is that it works ok here.

>Currently I'm just trying to make system work with already supported languages
>and fonts, e.g. deutch and urw fonts. I know that simple 
>\setupbodyfont[ber,pos]
>did work in previous ConTeXt versions.

I sent you the latest zip.

try \usetypescript[berry] \setupbodyfont[pos] or better, forget about the 
old method and use

\definetypeface ....

[see manual and fontdemo]

Hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Still don't understand how to switch fonts in the new context / ec versus 8r
       [not found]         ` <3B858F30.4DF1A13B@ukrpost.net>
@ 2001-08-24  8:04           ` Hans Hagen
  2001-08-26  7:23             ` Still don't understand how to switch fonts in the new context / ecversus 8r Olya Briginets
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2001-08-24  8:04 UTC (permalink / raw)
  Cc: ntg-context

Hi,

I think that the problem is as follows:

-- you want toi use times
-- you want to use the files already on the system
-- so you load the berry typescript
-- context does then assume ec encoding
-- since we deal with times, pdftex assumes embedding
-- but the ec name (ending with 8t) is not in the psfonts file
-- about which pdftex does not care since it is resident

now, can you see what happens when instead you use 8r encoding?

   \usetypescript [berry] [8r]

instead of [berry] [ec] (if that works ok, i'll change it in the typescript)

those names have entries in the psfonts.map file.

Alternatively, you can just generate the ec-.... names (using texfont, see 
texfont.dat) and forget about the berry mapping.

Here I now use the ec-prefixed ones and always embed the files (urw) since 
one cannot longer trust the embedded adobe 15.

Btw, for me the order of useable fonts is now 8r / texnansi / ec [from high 
to low]; also, the texnansi on ctan/tex live 6 is indeed faulty.

Hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Still don't understand how to switch fonts in the new context / ecversus 8r
  2001-08-24  8:04           ` Still don't understand how to switch fonts in the new context / ec versus 8r Hans Hagen
@ 2001-08-26  7:23             ` Olya Briginets
  2001-08-27  7:56               ` Still don't understand how to switch fonts in the new context / ec versus 8r Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Olya Briginets @ 2001-08-26  7:23 UTC (permalink / raw)


Hello Hans,

Hans Hagen wrote:
> 
> Hi,
> 
> I think that the problem is as follows:
> 
> -- you want toi use times
> -- you want to use the files already on the system
> -- so you load the berry typescript
> -- context does then assume ec encoding
> -- since we deal with times, pdftex assumes embedding
> -- but the ec name (ending with 8t) is not in the psfonts file
> -- about which pdftex does not care since it is resident
> 
> now, can you see what happens when instead you use 8r encoding?
> 
>    \usetypescript [berry] [8r]
> 
> instead of [berry] [ec] (if that works ok, i'll change it in the typescript)
> 
> those names have entries in the psfonts.map file.

No, this does not work, doing so I have just plain A, U etc. instead of
umlauted and accented ones.

> 
> Alternatively, you can just generate the ec-.... names (using texfont, see
> texfont.dat) and forget about the berry mapping.

This works! I did not use texfont (will try it soon, now we celebrate 10 years
of
Ukraine "independence" so I'm mostly hanging around looking at fireworks and
such).
I manually copied utmr8t.tfm to ec-utmr8a.tfm, 
created file foo.map (just to try) with lines like
  ec-utmr8a <ec.enc <utmr8a.pfb
and loaded it with loadmap[foo], and here I have all accents in proper places.

However, I still wonder why the old method did not work.
After 
  \definetypeface[tms][rm][serif][times][default][encoding=ec]
  \usetypescript[berry][ec]
  \setupbodyfont[serif,tms]
I got that \characterencoding is @default@, not @ec@, while
\usetypescript[berry][ec] implies that \Adiaeresis is \@ec@Adiaeresis, not
\@default@Adiaeresis.
I guess this is because some @@fontencoding becomes @default@ while defining
typeface in such a way, despite [encoding=ec].
I see inconsistency here. Or there isn't?

I want to learn a way to use some cyrillic fonts, maybe in different encodings,
and make it as seamless as possible, that's why I'd wish to do it the *right*
way, not just working somehow.

Olya


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Still don't understand how to switch fonts in the new context / ec versus 8r
  2001-08-26  7:23             ` Still don't understand how to switch fonts in the new context / ecversus 8r Olya Briginets
@ 2001-08-27  7:56               ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2001-08-27  7:56 UTC (permalink / raw)
  Cc: ConTeXt mailing list

At 10:23 AM 8/26/2001 +0300, Olya Briginets wrote:

>However, I still wonder why the old method did not work.
>After
>   \definetypeface[tms][rm][serif][times][default][encoding=ec]
>   \usetypescript[berry][ec]
>   \setupbodyfont[serif,tms]
>I got that \characterencoding is @default@, not @ec@, while
>\usetypescript[berry][ec] implies that \Adiaeresis is \@ec@Adiaeresis, not
>\@default@Adiaeresis.
>I guess this is because some @@fontencoding becomes @default@ while defining
>typeface in such a way, despite [encoding=ec].
>I see inconsistency here. Or there isn't?

maybe, in any case, if so, i will run into it and repair it, for the momen 
tuse the working versions

>I want to learn a way to use some cyrillic fonts, maybe in different 
>encodings,
>and make it as seamless as possible, that's why I'd wish to do it the *right*
>way, not just working somehow.

sure, but then forget about the berry naming and go the ec-* or 8r-* or 
t2a-* way since then at least you *know* what the encodings involved are. 
The mapping to berry is just there for good old times sake and i'm not 
going to extend that list of names myself; we should do it in such a way 
that users kind of understand what is happening.

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-08-27  7:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-21 10:15 Still don't understand how to switch fonts in the new context Olya Briginets
2001-08-21 13:45 ` Hans Hagen
2001-08-21 19:59   ` Olya Briginets
2001-08-22 12:06     ` Hans Hagen
2001-08-22 18:28       ` Olya Briginets
2001-08-23 16:17         ` Hans Hagen
     [not found]       ` <5.1.0.14.1.20010823181735.0256b7d0@server-1>
     [not found]         ` <3B858F30.4DF1A13B@ukrpost.net>
2001-08-24  8:04           ` Still don't understand how to switch fonts in the new context / ec versus 8r Hans Hagen
2001-08-26  7:23             ` Still don't understand how to switch fonts in the new context / ecversus 8r Olya Briginets
2001-08-27  7:56               ` Still don't understand how to switch fonts in the new context / ec versus 8r Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).