ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Simple font size changes command
@ 2016-06-09 21:47 josephcanedo
  2016-06-12 15:19 ` Alan BRASLAU
  0 siblings, 1 reply; 5+ messages in thread
From: josephcanedo @ 2016-06-09 21:47 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 684 bytes --]

Dear all,


In a simple document using only 1 font but with different sizes what are the easiest switch commands to change font size locally ? I am aware of \tfa, \tfx etc …. but they do not seem to size in absolute size but rather relatively to current font size. In the following MWE :


\starttext


{\tfd Foo {\tfx Bar1}} {\tfx Bar2} Baz.


\stoptext



Bar1 is typeset much larger than Bar2.


I’d look to write something like but don’t know who to get \BigSize and \SmallSize defined (and have Bar1 and Bar2 of same size) :


{\BigSize Foo {\SmallSize Bar1}} {\SmallSize Bar2} Baz. 


Many thanks for any hint.


Best regards


Joseph Canedo

[-- Attachment #1.2: Type: text/html, Size: 1923 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Simple font size changes command
  2016-06-09 21:47 Simple font size changes command josephcanedo
@ 2016-06-12 15:19 ` Alan BRASLAU
  2016-06-12 16:57   ` josephcanedo
  0 siblings, 1 reply; 5+ messages in thread
From: Alan BRASLAU @ 2016-06-12 15:19 UTC (permalink / raw)
  To: josephcanedo; +Cc: ntg-context

On Thu, 9 Jun 2016 21:47:07 +0000
<josephcanedo@gmail.com> wrote:

> Dear all,
> 
> 
> In a simple document using only 1 font but with different sizes what
> are the easiest switch commands to change font size locally ? I am
> aware of \tfa, \tfx etc …. but they do not seem to size in absolute
> size but rather relatively to current font size. In the following
> MWE :
> 
> 
> \starttext
> 
> 
> {\tfd Foo {\tfx Bar1}} {\tfx Bar2} Baz.
> 
> 
> \stoptext
> 
> 
> 
> Bar1 is typeset much larger than Bar2.
> 
> 
> I’d look to write something like but don’t know who to get \BigSize
> and \SmallSize defined (and have Bar1 and Bar2 of same size) :
> 
> 
> {\BigSize Foo {\SmallSize Bar1}} {\SmallSize Bar2} Baz. 
> 
> 
> Many thanks for any hint.

Perhaps (untested):

\definealternativestyle [BigFont] [{\setbodyfont [12pt]}]
\definealternativestyle [SmallFont] [{\setbodyfont [8pt]}]
\definehighlight [BigSize] [style=BigFont]
\definehighlight [SmallSize] [style=SmallFont]

\BigSize{Foo \SmallSize{Bar1}} \SmallSize{Bar2} Baz.

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Simple font size changes command
  2016-06-12 15:19 ` Alan BRASLAU
@ 2016-06-12 16:57   ` josephcanedo
  2016-06-13  3:19     ` Alan BRASLAU
  0 siblings, 1 reply; 5+ messages in thread
From: josephcanedo @ 2016-06-12 16:57 UTC (permalink / raw)
  To: Alan BRASLAU; +Cc: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1851 bytes --]

Thanks Alan for the suggestion, I’ll try it. Doing more research I figured out that \definefont defined such simple command at the expense of eventually repeating the font name and features. 


\definefont[SmallFont][name:EBGaramond*base,xxicentury at \SmallFontSize]  % \SmallFont works


I was also a bit surprised with \tf<size> behaviour when used inside a scope of another one leading to 2 different sizes in output, as in


{\tfd Foo {\tfx Bar1}} {\tfx Bar2} Baz.


For the sake of knowledge I would be interested in knowing if this is expected eventually. 


Thanks a lot


Joseph

 



From: Alan BRASLAU
Sent: ‎Sunday‎, ‎June‎ ‎12‎, ‎2016 ‎5‎:‎19‎ ‎PM
To: josephcanedo@gmail.com
Cc: ntg-context@ntg.nl





On Thu, 9 Jun 2016 21:47:07 +0000
<josephcanedo@gmail.com> wrote:

> Dear all,
> 
> 
> In a simple document using only 1 font but with different sizes what
> are the easiest switch commands to change font size locally ? I am
> aware of \tfa, \tfx etc …. but they do not seem to size in absolute
> size but rather relatively to current font size. In the following
> MWE :
> 
> 
> \starttext
> 
> 
> {\tfd Foo {\tfx Bar1}} {\tfx Bar2} Baz.
> 
> 
> \stoptext
> 
> 
> 
> Bar1 is typeset much larger than Bar2.
> 
> 
> I’d look to write something like but don’t know who to get \BigSize
> and \SmallSize defined (and have Bar1 and Bar2 of same size) :
> 
> 
> {\BigSize Foo {\SmallSize Bar1}} {\SmallSize Bar2} Baz. 
> 
> 
> Many thanks for any hint.

Perhaps (untested):

\definealternativestyle [BigFont] [{\setbodyfont [12pt]}]
\definealternativestyle [SmallFont] [{\setbodyfont [8pt]}]
\definehighlight [BigSize] [style=BigFont]
\definehighlight [SmallSize] [style=SmallFont]

\BigSize{Foo \SmallSize{Bar1}} \SmallSize{Bar2} Baz.

[-- Attachment #1.2: Type: text/html, Size: 4120 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Simple font size changes command
  2016-06-12 16:57   ` josephcanedo
@ 2016-06-13  3:19     ` Alan BRASLAU
  2016-06-13  7:30       ` josephcanedo
  0 siblings, 1 reply; 5+ messages in thread
From: Alan BRASLAU @ 2016-06-13  3:19 UTC (permalink / raw)
  To: josephcanedo; +Cc: ntg-context

On Sun, 12 Jun 2016 16:57:26 +0000
<josephcanedo@gmail.com> wrote:

> I was also a bit surprised with \tf<size> behaviour when used inside
> a scope of another one leading to 2 different sizes in output, as in
> 
> {\tfd Foo {\tfx Bar1}} {\tfx Bar2} Baz.
> 
> For the sake of knowledge I would be interested in knowing if this is
> expected eventually.

Yes, and this appears to me to be the most logical behavior.

By the way, the use of such "low-level" font changes is not very good
style in any case, and should be limited to special cases. In
particular, this will not export well in tagged output to xml, for
example, which is why I suggest the use of styles and "highlight".

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

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

* Re: Simple font size changes command
  2016-06-13  3:19     ` Alan BRASLAU
@ 2016-06-13  7:30       ` josephcanedo
  0 siblings, 0 replies; 5+ messages in thread
From: josephcanedo @ 2016-06-13  7:30 UTC (permalink / raw)
  To: Alan BRASLAU; +Cc: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1084 bytes --]

It is (very) limited to few words only to reproduce how an old Bible I am trying to typeset  (words added in the text to ease the understand were printed in smaller size).


Thanks a lot

Regards


Joseph





From: Alan BRASLAU
Sent: ‎Monday‎, ‎June‎ ‎13‎, ‎2016 ‎5‎:‎19‎ ‎AM
To: josephcanedo@gmail.com
Cc: ntg-context@ntg.nl





On Sun, 12 Jun 2016 16:57:26 +0000
<josephcanedo@gmail.com> wrote:

> I was also a bit surprised with \tf<size> behaviour when used inside
> a scope of another one leading to 2 different sizes in output, as in
> 
> {\tfd Foo {\tfx Bar1}} {\tfx Bar2} Baz.
> 
> For the sake of knowledge I would be interested in knowing if this is
> expected eventually.

Yes, and this appears to me to be the most logical behavior.

By the way, the use of such "low-level" font changes is not very good
style in any case, and should be limited to special cases. In
particular, this will not export well in tagged output to xml, for
example, which is why I suggest the use of styles and "highlight".

Alan

[-- Attachment #1.2: Type: text/html, Size: 3154 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

end of thread, other threads:[~2016-06-13  7:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-09 21:47 Simple font size changes command josephcanedo
2016-06-12 15:19 ` Alan BRASLAU
2016-06-12 16:57   ` josephcanedo
2016-06-13  3:19     ` Alan BRASLAU
2016-06-13  7:30       ` josephcanedo

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).