Ahoi, Following a previous discussion, I've been advised to "try to avoid \switchtobodyfont and use \definedfont or \definefont instead". (1) What's the difference between \definefont and \definedfont ? (2) In the underneath example... (2a) how to implement \define(d)font for font switching ? (2b) how to define \myFontHook ? Thanks, Alan \usemodule[t-lettrine] \usetypescriptfile[tps_arial] \usetypescript[arial] \definetypeface[myFont][arial] \usetypescriptfile[tps_timesnewroman] \usetypescript[timesnewroman] \definetypeface[myOtherFont][timesnewroman] \def\myFontSize{12pt} \def\myOtherFontSize{20pt} \setupbodyfont[myFont,\myFontSize] \setuphead[chapter][style={\switchtobodyfont[myOtherFont,\myOtherFontSize]}] \starttext \chapter{Chapter One} %\lettrine[FontHook={\myFontHook}]{T}{hus}, I came to the conclusion that the designer of a new \lettrine{T}{hus}, I came to the conclusion that the designer of a new system must not only be the implementer and first large-- scale user; the designer should also write the first user manual. \stoptext
Alan Stone wrote:
Ahoi,
Following a previous discussion, I've been advised to "try to avoid \switchtobodyfont and use \definedfont or \definefont instead".
what is better depends on the situation - for a structured document using \switchtobodyfont is ok - for special layout elements (headers, title pages, keywords) \definefont might be handier (esp when funny sizes are used) - when using \definefont it can be handy to use the symbolic names (Serif, SansBold etc) and sizes (sa 1.2) because that makes redefinition easier
(1) What's the difference between \definefont and \definedfont ?
\definefont defines a macro that represents a font, and \definedfont just switches to a font (the forst one is more efficient when you switch often)
(2) In the underneath example...
(2a) how to implement \define(d)font for font switching ?
(2b) how to define \myFontHook ?
Thanks, Alan
\usemodule[t-lettrine]
\usetypescriptfile[tps_arial] \usetypescript[arial]
... just look how gyre typefaces are defined
\setupbodyfont[myFont,\myFontSize]
just \setupbodyfont[myFont,12pt] and an occasional \definefont[BigFont][SerifBold sa 3.5] which gives you \BigFont
\setuphead[chapter][style={\switchtobodyfont[myOtherFont,\myOtherFontSize]}]
it depends on what can occur in a title, if there's math and monospaced and whatever being used mixed, then best use a typeface (apart from the one time definition it's quite fast to switch a typeface) ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Wolfgang Schuster wrote:
On Tue, Mar 17, 2009 at 11:27 PM, Hans Hagen
wrote: - for a structured document using \switchtobodyfont is ok
What do you mean with structured document?
one where there is some logic in using fonts (and color) which unfortunately is seldom the case in styles that i have to write for customers -) ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On Tue, Mar 17, 2009 at 11:27 PM, Hans Hagen
Alan Stone wrote:
Ahoi,
Following a previous discussion, I've been advised to "try to avoid \switchtobodyfont and use \definedfont or \definefont instead".
what is better depends on the situation
- for a structured document using \switchtobodyfont is ok
- for special layout elements (headers, title pages, keywords) \definefont might be handier (esp when funny sizes are used)
- when using \definefont it can be handy to use the symbolic names (Serif, SansBold etc) and sizes (sa 1.2) because that makes redefinition easier
(1) What's the difference between \definefont and \definedfont ?
\definefont defines a macro that represents a font, and \definedfont just switches to a font (the forst one is more efficient when you switch often)
(2) In the underneath example...
(2a) how to implement \define(d)font for font switching ?
(2b) how to define \myFontHook ?
Thanks, Alan
\usemodule[t-lettrine]
\usetypescriptfile[tps_arial] \usetypescript[arial]
... just look how gyre typefaces are defined
\setupbodyfont[myFont,\myFontSize]
just \setupbodyfont[myFont,12pt]
and an occasional \definefont[BigFont][SerifBold sa 3.5] which gives you \BigFont
Which low level command allows to fill in \definefont[SomeFont][SomeSynonym sa SomeScale] with SomeSynonym=Sans(X)/Serif(X) (X)=Bold/Italic, i.e. regardless of the synonym's name (defined in the typescript)?
\setuphead[chapter][style={\switchtobodyfont[myOtherFont,\myOtherFontSize]}]
it depends on what can occur in a title, if there's math and monospaced and whatever being used mixed, then best use a typeface (apart from the one time definition it's quite fast to switch a typeface)
Alan
Alan Stone wrote:
On Tue, Mar 17, 2009 at 11:27 PM, Hans Hagen
wrote: Alan Stone wrote:
Ahoi,
Following a previous discussion, I've been advised to "try to avoid \switchtobodyfont and use \definedfont or \definefont instead".
what is better depends on the situation
- for a structured document using \switchtobodyfont is ok
- for special layout elements (headers, title pages, keywords) \definefont might be handier (esp when funny sizes are used)
- when using \definefont it can be handy to use the symbolic names (Serif, SansBold etc) and sizes (sa 1.2) because that makes redefinition easier
(1) What's the difference between \definefont and \definedfont ? \definefont defines a macro that represents a font, and \definedfont just switches to a font (the forst one is more efficient when you switch often)
(2) In the underneath example...
(2a) how to implement \define(d)font for font switching ?
(2b) how to define \myFontHook ?
Thanks, Alan
\usemodule[t-lettrine]
\usetypescriptfile[tps_arial] \usetypescript[arial]
... just look how gyre typefaces are defined
\setupbodyfont[myFont,\myFontSize] just \setupbodyfont[myFont,12pt]
and an occasional \definefont[BigFont][SerifBold sa 3.5] which gives you \BigFont
Which low level command allows to fill in \definefont[SomeFont][SomeSynonym sa SomeScale] with SomeSynonym=Sans(X)/Serif(X) (X)=Bold/Italic, i.e. regardless of the synonym's name (defined in the typescript)?
it just follows the bodyfont \definefont[SomeFont][SerifBold sa 1.5] boils down to 'take the bold serif that we use in the bodyfont and scale it to 1.5 times the bodyfontsize' so, if you then choose another bodyfont (say times instead of palatino) you don't need to adapt all your definitions (there's also Normal, Bold etc that is even more generic in the sense that it can be sans or serif depending of the situation) these symbolic names are there for a reason as i never want to see hard coded font names (and features) in my document styles more than once ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On Wed, Mar 18, 2009 at 9:23 AM, Hans Hagen
Alan Stone wrote:
[...]
Which low level command allows to fill in \definefont[SomeFont][SomeSynonym sa SomeScale] with SomeSynonym=Sans(X)/Serif(X) (X)=Bold/Italic, i.e. regardless of the synonym's name (defined in the typescript)?
it just follows the bodyfont
\definefont[SomeFont][SerifBold sa 1.5]
And what about non-bodyfonts (some other sans or serif font) ? Alan
Alan Stone wrote:
On Wed, Mar 18, 2009 at 9:23 AM, Hans Hagen
wrote: Alan Stone wrote:
[...]
Which low level command allows to fill in \definefont[SomeFont][SomeSynonym sa SomeScale] with SomeSynonym=Sans(X)/Serif(X) (X)=Bold/Italic, i.e. regardless of the synonym's name (defined in the typescript)?
it just follows the bodyfont
\definefont[SomeFont][SerifBold sa 1.5]
And what about non-bodyfonts (some other sans or serif font) ?
wellm the whole idea of typefaces is that you can define many of them without interference ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On Wed, Mar 18, 2009 at 9:23 AM, Hans Hagen
[...] (there's also Normal, Bold etc that is even more generic in the sense that it can be sans or serif depending of the situation)
these symbolic names are there for a reason as i never want to see hard coded font names (and features) in my document styles more than once
What I'm looking for... With: \starttypescript [serif/sans] [somefont] \definefontsynonym [SomeFontRegular] [name:somefont] [features=default] \definefontsynonym [SomeFontItalic] [name:somefontitalic] [features=default] \definefontsynonym [SomeFontBold] [name:somefontbold] [features=default] \definefontsynonym [SomeFontBoldItalic] [name:somefontbolditalic] [features=default] \stoptypescript \starttypescript [serif/sans] [somefont] \setups [font:fallback:sans] \definefontsynonym [Regular] [SomeFontRegular] \definefontsynonym [Italic] [SomeFontItalic] \definefontsynonym [Bold] [SomeFontBold] \definefontsynonym [BoldItalic] [SomeFontBoldItalic] \stoptypescript \starttypescript [somefont] \definetypeface [somefont] [rm/ss] [serif/sans] [somefont] [default] \stoptypescript \usetypescriptfile[tps_somefont] \usetypescript[somefont] \definetypeface[myXTypeface][somefont] and... * somefont = arial, times, tahoma, courrier, ... * X = Body/Chapter/Section/.../Header/Footer/... how to... \def\myXSymbolicName=\somecommandRegular/Bold/Italic{myXTypeface} for... \definefont[myXFont][myXSymbolicName sa myXScale] Alan
On Wed, Mar 18, 2009 at 9:23 AM, Hans Hagen
(there's also Normal, Bold etc that is even more generic in the sense that it can be sans or serif depending of the situation)
Re. code in attachment Why is the font output not correct when using \usetypescriptfile[tps_arial_normal] ? Alan
Am 18.03.2009 um 16:26 schrieb Alan Stone:
On Wed, Mar 18, 2009 at 9:23 AM, Hans Hagen
wrote: (there's also Normal, Bold etc that is even more generic in the sense that it can be sans or serif depending of the situation) Re. code in attachment Why is the font output not correct when using \usetypescriptfile[tps_arial_normal] ?
Learn how to use \definetypeface, it's explained in the fonts manual and in the new ConTeXt manual. Wolfgang
On Wed, Mar 18, 2009 at 5:03 PM, Wolfgang Schuster
[...]
... it's explained in the fonts manual and in the new ConTeXt manual.
The most important thing I understand from reading the fonts manual and the ConTeXt manual's old and new font chapter for the n-th time (lost count), is that explaining fonts and their use is not a piece cake. As such, every effort in trying to explain it in a way that's understandable to non initiated people can only be appreciated and welcomed. Nevertheless, I wonder... Are fonts like men, or like women ? ;O) To be happy with a man you must understand him a lot and love him a little. To be happy with a woman you must love her a lot and not try to understand her at all.” - Helen Rowland As for the issue at hand... Let's say goodbye with a smile, dear, Just for a while, dear, we must part. Don't let the parting upset you, I'll not forget you, sweetheart. We'll meet again, don't know where, don't know when, But I know we'll meet again, some sunny day. Keep smiling through, just like you always do, 'Til the blue skies drive the dark clouds far away. So will you please say hello to the folks that I know, Tell them I won't be long. They'll be happy to know that as you saw me go, I was singing this song. After the rain comes the rainbow, You'll see the rain go, never fear, We two can wait for tomorrow, Goodbye to sorrow, my dear. ( source: http://ingeb.org/songs/wellmeet.html ) Alan
Alan Stone wrote:
The most important thing I understand from reading the fonts manual and the ConTeXt manual's old and new font chapter for the n-th time (lost count), is that explaining fonts and their use is not a piece cake. As such, every effort in trying to explain it in a way that's understandable to non initiated people can only be appreciated and welcomed.
Any remaining inclarity in any published documentation is by definition unexpected by the author of that documentation. So if something is unclear, you really have to mention specifically what it is exactly that is unclear. Otherwise, no progress will ever be made... Best wishes, Taco
On Thu, Mar 19, 2009 at 4:24 PM, Taco Hoekwater
Alan Stone wrote:
The most important thing I understand from reading the fonts manual and the ConTeXt manual's old and new font chapter for the n-th time (lost count), is that explaining fonts and their use is not a piece cake. As such, every effort in trying to explain it in a way that's understandable to non initiated people can only be appreciated and welcomed.
Any remaining inclarity in any published documentation is by definition unexpected by the author of that documentation.
Hmmm... By definition ??? What a fascinating point of view.
So if something is unclear, you really have to mention specifically what it is exactly that is unclear. Otherwise, no progress will ever be made...
Indeed. However, please take into account that... This topic is (way ?) beyond my present means of comprehension. So be prepared to receive some stupid and/or hilarious questions. ;O) It might also be, quoting the great Alberto, and with all due respect (really) for the author(s)... “If you can't explain it simply, you don't understand it well enough” - Albert Einstein
From my own small experience, it's often a mix of both.
And that's ok. That means there's means of improvement, learning and growth for everybody involved. Considering the complexity of the matter and taking into account the great Alberto's wise words, I'll try to understand my own questions first before posting them in a hopefully understandable way. Talk soon. Cheers, Alan
Best wishes, Taco
On Thu, Mar 19, 2009 at 12:24 PM, Taco Hoekwater
Alan Stone wrote:
The most important thing I understand from reading the fonts manual and the ConTeXt manual's old and new font chapter for the n-th time (lost count), is that explaining fonts and their use is not a piece cake. As such, every effort in trying to explain it in a way that's understandable to non initiated people can only be appreciated and welcomed.
Any remaining inclarity in any published documentation is by definition unexpected by the author of that documentation. So if something is unclear, you really have to mention specifically what it is exactly that is unclear. Otherwise, no progress will ever be made...
When I write, I try to guess the level of understanding/background of the
reader. With fonts (also graphics) it isn't appropriate to provide all the
background in a TeX documentation, so what is needed is a some
pointers to the required background material. I do expect a reader
who comes without the required background to find things they don't
understand, but the way to handle that is to send them to the appropriate
references.
--
George N. White III
Alan Stone wrote:
Are fonts like men, or like women ? ;O)
fonts are simply complex ... - no real consistency (esp in names) - complicted by the fact that we want (in tex) some coherent system - complicated even more by math - and by incomplete fonts - and ... - and ... to some extend luatex/mkiv is making it a bit more convenient but even then .. - fonts can have truckloads of features - and related bugs - and ... 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 -----------------------------------------------------------------
On Thu, Mar 19, 2009 at 4:29 PM, Hans Hagen
Alan Stone wrote:
Are fonts like men, or like women ? ;O)
fonts are simply complex ...
Ok, they're like women then. Alan
- no real consistency (esp in names) - complicted by the fact that we want (in tex) some coherent system - complicated even more by math - and by incomplete fonts - and ... - and ...
to some extend luatex/mkiv is making it a bit more convenient but even then ..
- fonts can have truckloads of features - and related bugs - and ...
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 ___________________________________________________________________________________
-- Alan
Alan Stone schrieb:
On Wed, Mar 18, 2009 at 5:03 PM, Wolfgang Schuster
wrote: [...]
... it's explained in the fonts manual and in the new ConTeXt manual.
The most important thing I understand from reading the fonts manual and the ConTeXt manual's old and new font chapter for the n-th time (lost count), is that explaining fonts and their use is not a piece cake. As such, every effort in trying to explain it in a way that's understandable to non initiated people can only be appreciated and welcomed.
Nevertheless, I wonder...
Are fonts like men, or like women ? ;O)
To be happy with a man you must understand him a lot and love him a little. To be happy with a woman you must love her a lot and not try to understand her at all.” - Helen Rowland
As for the issue at hand...
Let's say goodbye with a smile, dear, Just for a while, dear, we must part. Don't let the parting upset you, I'll not forget you, sweetheart. We'll meet again, don't know where, don't know when, But I know we'll meet again, some sunny day. Keep smiling through, just like you always do, 'Til the blue skies drive the dark clouds far away.
So will you please say hello to the folks that I know, Tell them I won't be long. They'll be happy to know that as you saw me go, I was singing this song.
After the rain comes the rainbow, You'll see the rain go, never fear, We two can wait for tomorrow, Goodbye to sorrow, my dear.
( source: http://ingeb.org/songs/wellmeet.html )
i can't help it, but the song reminds me of the end of Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb the same is true for fonts ;) - Peter
Alan ___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- "Es ist doch ein Trost, das Geldgier manchmal blöd macht." - Kottan in "Kottan ermittelt", Folge 9: "Die Einteilung" -
Am 18.03.2009 um 16:26 schrieb Alan Stone:
On Wed, Mar 18, 2009 at 9:23 AM, Hans Hagen
wrote: (there's also Normal, Bold etc that is even more generic in the sense that it can be sans or serif depending of the situation)
Read and understand! % Typescript for Arial \starttypescript [sans] [arial] \setups [font:fallback:sans] \definefontsynonym [Sans] [ArialNormal] \definefontsynonym [SansItalic] [ArialItalic] \definefontsynonym [SansBold] [ArialBold] \definefontsynonym [SansBoldItalic] [ArialBoldItalic] \stoptypescript \starttypescript [sans] [arial] \definefontsynonym [ArialNormal] [name:arial] [features=default] \definefontsynonym [ArialItalic] [name:arialitalic] [features=default] \definefontsynonym [ArialBold] [name:arialbold] [features=default] \definefontsynonym [ArialBoldItalic] [name:arialbolditalic] [features=default] \stoptypescript \starttypescript [arial] \definetypeface [arial] [ss] [sans] [arial] [default] \stoptypescript % Load the Arial typescript for certain elements \usetypescript[sans][arial] % Load the main typescripts and set the font for the document \usetypescript[palatino] \setupbodyfont[palatino] % Define a new font for the header and set it \definefont[SectionStyle][ArialBold sa 1.5] % Symbolic name for Arial \setuphead[section][style=SectionStyle] \starttext \section{Knuth} \input Knuth \section{Zapf} \input zapf \stoptext Wolfgang
2009/3/19 Wolfgang Schuster
Am 18.03.2009 um 16:26 schrieb Alan Stone:
On Wed, Mar 18, 2009 at 9:23 AM, Hans Hagen
wrote: (there's also Normal, Bold etc that is even more generic in the sense that it can be sans or serif depending of the situation) Read and understand!
Thanks for your comments Wolfgang. Hope they're useful and beneficial to other people. The example I adapted and was enquiring about was in the context of what Hans replied earlier...
(there's also Normal, Bold etc that is even more generic in the sense that it can be sans or serif depending of the situation)
Hans, does what you meant by the above correspond to Wolfgang's example or did you mean something else ? If so, what precisely please ? Thanks, Alan
% Typescript for Arial
\starttypescript [sans] [arial] \setups [font:fallback:sans] \definefontsynonym [Sans] [ArialNormal] \definefontsynonym [SansItalic] [ArialItalic] \definefontsynonym [SansBold] [ArialBold] \definefontsynonym [SansBoldItalic] [ArialBoldItalic] \stoptypescript
\starttypescript [sans] [arial] \definefontsynonym [ArialNormal] [name:arial] [features=default] \definefontsynonym [ArialItalic] [name:arialitalic] [features=default] \definefontsynonym [ArialBold] [name:arialbold] [features=default] \definefontsynonym [ArialBoldItalic] [name:arialbolditalic] [features=default] \stoptypescript
\starttypescript [arial] \definetypeface [arial] [ss] [sans] [arial] [default] \stoptypescript
% Load the Arial typescript for certain elements
\usetypescript[sans][arial]
% Load the main typescripts and set the font for the document
\usetypescript[palatino] \setupbodyfont[palatino]
% Define a new font for the header and set it
\definefont[SectionStyle][ArialBold sa 1.5] % Symbolic name for Arial
\setuphead[section][style=SectionStyle]
\starttext
\section{Knuth}
\input Knuth
\section{Zapf}
\input zapf
\stoptext
Wolfgang
Am 23.03.2009 um 11:51 schrieb Alan Stone:
(there's also Normal, Bold etc that is even more generic in the sense that it can be sans or serif depending of the situation)
Hans, does what you meant by the above correspond to Wolfgang's example or did you mean something else ? If so, what precisely please?
\starttext \rm text {\definedfont[Normal sa 2]text} text {\definedfont[Bold sa 2]text} text \ss text {\definedfont[Normal sa 2]text} text {\definedfont[Bold sa 2]text} text \stoptext Wolfgang
participants (6)
-
Alan Stone
-
George N. White III
-
Hans Hagen
-
Peter Rolf
-
Taco Hoekwater
-
Wolfgang Schuster