ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* XeTeX and precise font sizes
@ 2008-07-09 22:13 Neiaglov Dmitry
  2008-07-09 23:02 ` Diego Depaoli
  0 siblings, 1 reply; 9+ messages in thread
From: Neiaglov Dmitry @ 2008-07-09 22:13 UTC (permalink / raw)
  To: ntg-context

Hello there!

I was googling around, but couldn't really figure out how to use  
OpenType fonts with ConTeXt and XeTeX with precise sizes in points. I  
am trying to create a subsection style with Gentium 24pt.

I am creating a typeface like it's recommended in the documentation:

\definetypeface			[Gentium][rm][Xserif][Gentium]

Then I create my own subsection style:

\setuphead				[subsection]
						[alternative=inmargin,
						numbercolor=orange,
						style=\Gentium]

So far so good, but it actually types the subsection out with some pre- 
determined font size.

What I'm trying to do is get my subsections at the size of, say,  
precisely 24 pt.

Stuff like

\definetypeface			[Gentium][rm][Xserif][Gentium]
\definefont				[Subs][Gentium at 24pt]

apparently invokes non-XeTeX font routines (pardon my ignorance):

kpathsea: Running mktextfm subsections
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1;  
nonstopmode; input subsections
This is METAFONT, Version 2.71828 (Web2C 7.5.6)
kpathsea: Running mktexmf subsections
! I can't find file `subsections'.

The best I was able to get was adding rscale

\definetypeface			[Gentium][rm][Xserif][Gentium][rscale=1.4]

which is bad for two reasons: first, it's not logically correct, since  
I am planning to use my typeface for different sizes throughout the  
document, and second, I really want to control my sizes in points.

Thanks in advance,
Dima
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: XeTeX and precise font sizes
  2008-07-09 22:13 XeTeX and precise font sizes Neiaglov Dmitry
@ 2008-07-09 23:02 ` Diego Depaoli
  2008-07-10  5:48   ` Wolfgang Schuster
  2008-07-10  6:50   ` Neiaglov Dmitry
  0 siblings, 2 replies; 9+ messages in thread
From: Diego Depaoli @ 2008-07-09 23:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2008/7/10 Neiaglov Dmitry <dima@getalime.ru>:
> Hello there!
>
> I was googling around,
you mis-googled :-)
http://www.google.com/cse?q=gentium&cx=016640200293943433883:w-6slqs1kjg&cof=FORID:0&sa=Special+Search

> OpenType fonts with ConTeXt and XeTeX with precise sizes in points. I
> am trying to create a subsection style with Gentium 24pt.

following code should be work.

\starttypescript[serif][gentium-basic]
\definefontsynonym[Serif]          [GentiumBasic]
\definefontsynonym[SerifItalic]    [GentiumBasicItalic]
\definefontsynonym[SerifBold]      [GentiumBasicBold]
\definefontsynonym[SerifBoldItalic][GentiumBasicBoldItalic]
\stoptypescript

\starttypescript[serif][gentium-basic]
\definefontsynonym[GentiumBasic]          [file:GenBasR] [features=default]
\definefontsynonym[GentiumBasicItalic]    [file:GenBasI] [features=default]
\definefontsynonym[GentiumBasicBold]      [file:GenBasB] [features=default]
\definefontsynonym[GentiumBasicBoldItalic][file:GenBasBI][features=default]
\stoptypescript

\starttypescript[gentium-basic]
\definetypeface[gentium][rm][serif][gentium-basic][default]
\stoptypescript
\usetypescript[gentium-basic]
\setupcolors[state=start]
\def\subsectfont{\setupbodyfont[gentium,24pt]}
\setuphead                              [subsection]
                                               [alternative=inmargin,
                                               numbercolor=orange,
                                               style=\subsectfont]

\starttext

\section {a section}
\subsection {a subsection}
\input knuth

\stoptext

Cheers

-- 
Diego Depaoli
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: XeTeX and precise font sizes
  2008-07-09 23:02 ` Diego Depaoli
@ 2008-07-10  5:48   ` Wolfgang Schuster
  2008-07-10  6:50   ` Neiaglov Dmitry
  1 sibling, 0 replies; 9+ messages in thread
From: Wolfgang Schuster @ 2008-07-10  5:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Jul 10, 2008 at 1:02 AM, Diego Depaoli <trebestie@gmail.com> wrote:
> 2008/7/10 Neiaglov Dmitry <dima@getalime.ru>:
>> Hello there!
>>
>> I was googling around,
> you mis-googled :-)
> http://www.google.com/cse?q=gentium&cx=016640200293943433883:w-6slqs1kjg&cof=FORID:0&sa=Special+Search
>
>> OpenType fonts with ConTeXt and XeTeX with precise sizes in points. I
>> am trying to create a subsection style with Gentium 24pt.
>
> following code should be work.
>
> \starttypescript[serif][gentium-basic]
> \definefontsynonym[Serif]          [GentiumBasic]
> \definefontsynonym[SerifItalic]    [GentiumBasicItalic]
> \definefontsynonym[SerifBold]      [GentiumBasicBold]
> \definefontsynonym[SerifBoldItalic][GentiumBasicBoldItalic]
> \stoptypescript
>
> \starttypescript[serif][gentium-basic]
> \definefontsynonym[GentiumBasic]          [file:GenBasR] [features=default]
> \definefontsynonym[GentiumBasicItalic]    [file:GenBasI] [features=default]
> \definefontsynonym[GentiumBasicBold]      [file:GenBasB] [features=default]
> \definefontsynonym[GentiumBasicBoldItalic][file:GenBasBI][features=default]
> \stoptypescript
>
> \starttypescript[gentium-basic]
> \definetypeface[gentium][rm][serif][gentium-basic][default]
> \stoptypescript
> \usetypescript[gentium-basic]

\setupbodyfont[gentium]

> \setupcolors[state=start]
> \def\subsectfont{\setupbodyfont[gentium,24pt]}
> \setuphead                              [subsection]
>                                               [alternative=inmargin,
>                                               numbercolor=orange,
>                                               style=\subsectfont]
>

\definefont[subsectfont][Serif at 24pt] % Gentium as bodyfont

or

\definefont[subsectfont][GentiumBasic at 24pt] % Gentium is not the bodyfont

and

\setuphead
  [subsection]
  [alternative=inmargin,
   numbercolor=orange,
   style=subsectfont]

> \starttext
>
> \section {a section}
> \subsection {a subsection}
> \input knuth
>
> \stoptext
>
> Cheers
>
> --
> Diego Depaoli

Wolfgang
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: XeTeX and precise font sizes
  2008-07-09 23:02 ` Diego Depaoli
  2008-07-10  5:48   ` Wolfgang Schuster
@ 2008-07-10  6:50   ` Neiaglov Dmitry
  2008-07-10  8:19     ` Hans Hagen
                       ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Neiaglov Dmitry @ 2008-07-10  6:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>> you mis-googled :-)
> http://www.google.com/cse?q=gentium&cx=016640200293943433883:w-6slqs1kjg&cof=FORID:0&sa=Special+Search

I really couldn't think that problem was font-dependent :)

> following code should be work.
>
> \starttypescript[serif][gentium-basic]
> \definefontsynonym[Serif]          [GentiumBasic]
> \definefontsynonym[SerifItalic]    [GentiumBasicItalic]
> \definefontsynonym[SerifBold]      [GentiumBasicBold]
> \definefontsynonym[SerifBoldItalic][GentiumBasicBoldItalic]
> \stoptypescript
>
> ...
>
> \stoptext


Yes, thanks, works fine, but does it really use XeTeX? The wiki says:  
"XeTeX offers some nice features in terms of automatically finding  
related fonts in a family" which would be really convenient to use. I  
really can't find docs on the difference between XeTeX and non-XeTeX  
font handling in ConTeXt.
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: XeTeX and precise font sizes
  2008-07-10  6:50   ` Neiaglov Dmitry
@ 2008-07-10  8:19     ` Hans Hagen
  2008-07-10 11:52     ` Diego Depaoli
  2008-07-10 14:10     ` Mojca Miklavec
  2 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2008-07-10  8:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Neiaglov Dmitry wrote:
>>> you mis-googled :-)
>> http://www.google.com/cse?q=gentium&cx=016640200293943433883:w-6slqs1kjg&cof=FORID:0&sa=Special+Search
> 
> I really couldn't think that problem was font-dependent :)
> 
>> following code should be work.
>>
>> \starttypescript[serif][gentium-basic]
>> \definefontsynonym[Serif]          [GentiumBasic]
>> \definefontsynonym[SerifItalic]    [GentiumBasicItalic]
>> \definefontsynonym[SerifBold]      [GentiumBasicBold]
>> \definefontsynonym[SerifBoldItalic][GentiumBasicBoldItalic]
>> \stoptypescript
>>
>> ...
>>
>> \stoptext
> 
> 
> Yes, thanks, works fine, but does it really use XeTeX? The wiki says:  
> "XeTeX offers some nice features in terms of automatically finding  
> related fonts in a family" which would be really convenient to use. I  
> really can't find docs on the difference between XeTeX and non-XeTeX  
> font handling in ConTeXt.

there is (and will be) no support for 'related fonts'

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: XeTeX and precise font sizes
  2008-07-10  6:50   ` Neiaglov Dmitry
  2008-07-10  8:19     ` Hans Hagen
@ 2008-07-10 11:52     ` Diego Depaoli
  2008-07-10 14:10     ` Mojca Miklavec
  2 siblings, 0 replies; 9+ messages in thread
From: Diego Depaoli @ 2008-07-10 11:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2008/7/10 Neiaglov Dmitry <dima@getalime.ru>:
>>> you mis-googled :-)
>> http://www.google.com/cse?q=gentium&cx=016640200293943433883:w-6slqs1kjg&cof=FORID:0&sa=Special+Search
>
> I really couldn't think that problem was font-dependent :)
Indeed... I pointed you to the very helpful 'special search' box in
the wiki's homepage.

> Yes, thanks, works fine, but does it really use XeTeX? The wiki says:
> "XeTeX offers some nice features in terms of automatically finding
> related fonts in a family" which would be really convenient to use. I
> really can't find docs on the difference between XeTeX and non-XeTeX
> font handling in ConTeXt.
Sorry, I don't know the answer (I'm a very beginner), but the given
example works (for me) only in xetex.

-- 
Diego Depaoli
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: XeTeX and precise font sizes
  2008-07-10  6:50   ` Neiaglov Dmitry
  2008-07-10  8:19     ` Hans Hagen
  2008-07-10 11:52     ` Diego Depaoli
@ 2008-07-10 14:10     ` Mojca Miklavec
  2008-07-10 16:09       ` Neiaglov Dmitry
  2 siblings, 1 reply; 9+ messages in thread
From: Mojca Miklavec @ 2008-07-10 14:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Jul 10, 2008 at 8:50 AM, Neiaglov Dmitry <dima@getalime.ru> wrote:
>>> you mis-googled :-)
>> http://www.google.com/cse?q=gentium&cx=016640200293943433883:w-6slqs1kjg&cof=FORID:0&sa=Special+Search
>
> I really couldn't think that problem was font-dependent :)
>
>> following code should be work.
>>
>> \starttypescript[serif][gentium-basic]
>> \definefontsynonym[Serif]          [GentiumBasic]
>> \definefontsynonym[SerifItalic]    [GentiumBasicItalic]
>> \definefontsynonym[SerifBold]      [GentiumBasicBold]
>> \definefontsynonym[SerifBoldItalic][GentiumBasicBoldItalic]
>> \stoptypescript
>>
>> ...
>>
>> \stoptext
>
>
> Yes, thanks, works fine, but does it really use XeTeX? The wiki says:
> "XeTeX offers some nice features in terms of automatically finding
> related fonts in a family" which would be really convenient to use. I
> really can't find docs on the difference between XeTeX and non-XeTeX
> font handling in ConTeXt.

Font tutorial is missing.

Here you have some examples, but they are outdated:
     http://wiki.contextgarden.net/Fonts_in_XeTeX

One feature that only works with XeTeX is this one (copied from wiki):

\definetypeface[Serapion][rm][Xserif][Serapion Pro]
\setupbodyfont[Serapion, 12pt]

this could also be:

% no idea about proper name of that font; try to run "fc-list Gentium"
\definetypeface[gentium-basic][rm][Xserif][Gentium Basic]
\setupbodyfont[gentium-basic, 12pt]

This will automatically assign bold, italic & bold italic. This
doesn't work with LuaTeX (not because it cannot work, but because it
has not been implemented).

The procedure that works with both LuaTeX & XeTeX & basically does
(almost) the same:

\starttypescript[serif][gentium-basic]
\definefontsynonym[Serif]          [GentiumBasic]
\definefontsynonym[SerifItalic]    [GentiumBasicItalic]
\definefontsynonym[SerifBold]      [GentiumBasicBold]
\definefontsynonym[SerifBoldItalic][GentiumBasicBoldItalic]
\stoptypescript

\starttypescript[serif][gentium-basic]
\definefontsynonym[GentiumBasic]          [file:GenBasR] [features=default]
\definefontsynonym[GentiumBasicItalic]    [file:GenBasI] [features=default]
\definefontsynonym[GentiumBasicBold]      [file:GenBasB] [features=default]
\definefontsynonym[GentiumBasicBoldItalic][file:GenBasBI][features=default]
\stoptypescript

\starttypescript[gentium-basic]
\definetypeface[gentium][rm][serif][gentium-basic][default]
\stoptypescript

The only difference is that Xsans uses the installed font (needs to be
available to other applications as well; alternative is to call
"name:" in all the definitions above), while "file:" will use the font
file from somewhere in texmf tree (kpathsea needs to see it).

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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: XeTeX and precise font sizes
  2008-07-10 14:10     ` Mojca Miklavec
@ 2008-07-10 16:09       ` Neiaglov Dmitry
  2008-07-10 21:35         ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Neiaglov Dmitry @ 2008-07-10 16:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>
>
> \starttypescript[serif][gentium-basic]
> \definefontsynonym[Serif]          [GentiumBasic]
> \definefontsynonym[SerifItalic]    [GentiumBasicItalic]
> \definefontsynonym[SerifBold]      [GentiumBasicBold]
> \definefontsynonym[SerifBoldItalic][GentiumBasicBoldItalic]
> \stoptypescript


Cool, that clarifies a lot for me, thanks :) So \startypescript uses  
xetex after all!

The most compact construction I got working was the following:

\definetypeface			[LiberationSans][ss][Xsans][Liberation Sans][default] 
[encoding=uc]
...
\def\subsect{\setupbodyfont[LiberationSans, 18pt]}
...
\setuphead				[subsection]
						...
						style=\subsect]

Unfortunately, ConTeXt tends to compile this document three times  
before giving me the PDF. (Makes you wonder!)

And anyway, what is the difference between typescripts and typefaces  
in ConTeXt terms? The only thing I found in docs was that \definefont  
works in the context of the current construction.

Best regards,
Dima
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: XeTeX and precise font sizes
  2008-07-10 16:09       ` Neiaglov Dmitry
@ 2008-07-10 21:35         ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2008-07-10 21:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Neiaglov Dmitry wrote:
>>
>> \starttypescript[serif][gentium-basic]
>> \definefontsynonym[Serif]          [GentiumBasic]
>> \definefontsynonym[SerifItalic]    [GentiumBasicItalic]
>> \definefontsynonym[SerifBold]      [GentiumBasicBold]
>> \definefontsynonym[SerifBoldItalic][GentiumBasicBoldItalic]
>> \stoptypescript
> 
> 
> Cool, that clarifies a lot for me, thanks :) So \startypescript uses  
> xetex after all!

it's more the reverse ... typescripts are the interface and deep down it 
is translated to the right commands for pdftex, zetex or luatex

> Unfortunately, ConTeXt tends to compile this document three times  
> before giving me the PDF. (Makes you wonder!)

normally there ar etwo runs (depends on how many changes in the 
documents); any macro package that uses multi pass data will do several 
runs to be sure that the cross refs and lists are ok (also, some pdf 
constructs use forward references that need to be resolved)

> And anyway, what is the difference between typescripts and typefaces  
> in ConTeXt terms? The only thing I found in docs was that \definefont  
> works in the context of the current construction.

typescripts are just definitions and invoking a one of them (which 
itself may invoke another) will define a typeface which itself 
eventually results in a bunch of font definitions

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2008-07-10 21:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-09 22:13 XeTeX and precise font sizes Neiaglov Dmitry
2008-07-09 23:02 ` Diego Depaoli
2008-07-10  5:48   ` Wolfgang Schuster
2008-07-10  6:50   ` Neiaglov Dmitry
2008-07-10  8:19     ` Hans Hagen
2008-07-10 11:52     ` Diego Depaoli
2008-07-10 14:10     ` Mojca Miklavec
2008-07-10 16:09       ` Neiaglov Dmitry
2008-07-10 21:35         ` 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).