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
2008/7/10 Neiaglov Dmitry
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
On Thu, Jul 10, 2008 at 1:02 AM, Diego Depaoli
2008/7/10 Neiaglov Dmitry
: 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
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.
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 -----------------------------------------------------------------
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
2008/7/10 Neiaglov Dmitry
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
On Thu, Jul 10, 2008 at 8:50 AM, Neiaglov Dmitry
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
\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
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 -----------------------------------------------------------------
participants (5)
-
Diego Depaoli
-
Hans Hagen
-
Mojca Miklavec
-
Neiaglov Dmitry
-
Wolfgang Schuster