Dear list, I have the following sample: \showframe \starttext {\setupbodyfont[120pt]My Title} \stoptext Is there a way to make ConTeXt automatically calculate the size of the \setupbodyfont, so that the passage fits exactly to text width? Many thanks for your help, Pablo -- http://www.ousia.tk
Am 14.01.2015 um 17:50 schrieb Pablo Rodriguez
: Dear list,
I have the following sample:
\showframe \starttext {\setupbodyfont[120pt]My Title} \stoptext
Is there a way to make ConTeXt automatically calculate the size of the \setupbodyfont, so that the passage fits exactly to text width?
\starttext \WidthSpanningText{My Title}{\textwidth}{Serif} \WidthSpanningText{My Title}{12cm}{MonoBold} \WidthSpanningText{My Title}{14cm}{SansItalic} \stoptext Wolfgang
Am 14.01.2015 um 18:58 schrieb Wolfgang Schuster
: Am 14.01.2015 um 17:50 schrieb Pablo Rodriguez
: Dear list,
I have the following sample:
\showframe \starttext {\setupbodyfont[120pt]My Title} \stoptext
Is there a way to make ConTeXt automatically calculate the size of the \setupbodyfont, so that the passage fits exactly to text width?
\starttext
\WidthSpanningText{My Title}{\textwidth}{Serif}
\WidthSpanningText{My Title}{12cm}{MonoBold}
\WidthSpanningText{My Title}{14cm}{SansItalic}
\stoptext
Another solution is to use the \scale command: \starttext \scale[width=\textwidth]{My Title} \stoptext Wolfgang
On 01/14/2015 07:59 PM, Wolfgang Schuster wrote:
[...] Another solution is to use the \scale command:
\starttext \scale[width=\textwidth]{My Title} \stoptext
Many thanks for the new rely, Wolfgang. I think this is easier to remember. And replying to my previous question \dontleavehmode allows right (I mean correct ;-)) alignment. Many thanks for your help, Pablo -- http://www.ousia.tk
On 01/14/2015 06:58 PM, Wolfgang Schuster wrote:
[...] Is there a way to make ConTeXt automatically calculate the size of the \setupbodyfont, so that the passage fits exactly to text width?
\starttext \WidthSpanningText{My Title}{\textwidth}{Serif} \WidthSpanningText{My Title}{12cm}{MonoBold} \WidthSpanningText{My Title}{14cm}{SansItalic} \stoptext
Many thanks for your reply, Wolfgang. That was what I was looking for. There is a minor issue with alignment: \starttext \startalign[center] \widthspanningtext{text}{.5\textwidth}{Serif} \stopalign \hfill\widthspanningtext{text}{.5\textwidth}{Serif} \stoptext Am I missing something or is \hfill the only way to align the contents from \widthspanningtext? Many thanks for your help, Pablo -- http://www.ousia.tk
Am 14.01.2015 um 20:36 schrieb Pablo Rodriguez
: On 01/14/2015 06:58 PM, Wolfgang Schuster wrote:
[...] Is there a way to make ConTeXt automatically calculate the size of the \setupbodyfont, so that the passage fits exactly to text width?
\starttext \WidthSpanningText{My Title}{\textwidth}{Serif} \WidthSpanningText{My Title}{12cm}{MonoBold} \WidthSpanningText{My Title}{14cm}{SansItalic} \stoptext
Many thanks for your reply, Wolfgang.
That was what I was looking for.
There is a minor issue with alignment:
\starttext
\startalign[center] \widthspanningtext{text}{.5\textwidth}{Serif} \stopalign
\hfill\widthspanningtext{text}{.5\textwidth}{Serif}
\stoptext
Am I missing something or is \hfill the only way to align the contents from \widthspanningtext?
Use \midaligned{\WidthSpanningText{…}{…}{…}} or \startlinealignment[middle] \WidthSpanningText{…}{…}{…} \stoplinealignment Wolfgang
On Wed, 14 Jan 2015 17:50:12 +0100
Pablo Rodriguez
Dear list,
I have the following sample:
\showframe \starttext {\setupbodyfont[120pt]My Title} \stoptext
Is there a way to make ConTeXt automatically calculate the size of the \setupbodyfont, so that the passage fits exactly to text width?
Many thanks for your help,
Pablo
There is a MP solution: \starttext \startMPcode draw textext("My Title") xsized TextWidth ; \stopMPcode \stoptext Alan
On 01/14/2015 07:05 PM, Alan BRASLAU wrote:
[...] There is a MP solution:
\starttext \startMPcode draw textext("My Title") xsized TextWidth ; \stopMPcode \stoptext
Many thanks for your reply, Alan. It’s good to know that MP fits perfectly here. Many thanks for your help, Pablo -- http://www.ousia.tk
On 1/14/2015 7:05 PM, Alan BRASLAU wrote:
On Wed, 14 Jan 2015 17:50:12 +0100 Pablo Rodriguez
wrote: Dear list,
I have the following sample:
\showframe \starttext {\setupbodyfont[120pt]My Title} \stoptext
Is there a way to make ConTeXt automatically calculate the size of the \setupbodyfont, so that the passage fits exactly to text width?
Many thanks for your help,
Pablo
There is a MP solution:
\starttext \startMPcode draw textext("My Title") xsized TextWidth ; \stopMPcode \stoptext
\scale[width=\textwidth]{My Title} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (4)
-
Alan BRASLAU
-
Hans Hagen
-
Pablo Rodriguez
-
Wolfgang Schuster