ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] understanding units / dimensions
@ 2024-08-25 11:45 Henning Hraban Ramm
  2024-08-25 12:15 ` [NTG-context] " Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Henning Hraban Ramm @ 2024-08-25 11:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

At the meeting I noted a few units that I didn’t know about, while I 
already knew many.

* general units: in, m, cm, mm (ft?)
* typographical units: pt, dd, bp, pc, cc, sp
* font related: em, ex, fs, fa, fd, fc, ch
* layout related: pw, ph, tw, th, cw, cd, lw, hs, vh
* frame related: fw, fh, fo
* funits: dk, es, tv, eu

Are there even more?

(Did you know all of them? This will be in the test…)


Questions:

How differs "1" from "2"?
* em fs
* lw hs
* ph vh


I want to update https://wiki.contextgarden.net/Dimensions

Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: understanding units / dimensions
  2024-08-25 11:45 [NTG-context] understanding units / dimensions Henning Hraban Ramm
@ 2024-08-25 12:15 ` Wolfgang Schuster
  2024-08-25 13:52   ` Henning Hraban Ramm
  2024-08-26  7:27   ` Hans Hagen via ntg-context
  0 siblings, 2 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2024-08-25 12:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm

Henning Hraban Ramm schrieb am 25.08.2024 um 13:45:
> At the meeting I noted a few units that I didn’t know about, while I 
> already knew many.
>
> * general units: in, m, cm, mm (ft?)
> * typographical units: pt, dd, bp, pc, cc, sp
> * font related: em, ex, fs, fa, fd, fc, ch
> * layout related: pw, ph, tw, th, cw, cd, lw, hs, vh
> * frame related: fw, fh, fo
> * funits: dk, es, tv, eu
>
> Are there even more?

Yes, there are more of them.

Look into the lowlevel-registers document which describes how they are
created and also how you can define your own identifiers with \newuserunit.

> Questions:
>
> How differs "1" from "2"?
> * em fs

\startbuffer[dimensions]
\starttabulate
\NC em \EQ \the\dimexpr1em\relax \NC\NR % \emwidth
\NC fs \EQ \the\dimexpr1fs\relax \NC\NR % \globalbodyfontsize
\stoptabulate
\stopbuffer

\starttext

\getbuffer[dimensions]

\setupbodyfont[14.4pt]

\getbuffer[dimensions]

\stoptext


> * lw hs

lw stands for \linewidth which is the default value for rulethickness in 
\framed etc.

hs is just \hsize.

> * ph vh

ph is \paperheight.

vh doesn't exist.


Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: understanding units / dimensions
  2024-08-25 12:15 ` [NTG-context] " Wolfgang Schuster
@ 2024-08-25 13:52   ` Henning Hraban Ramm
  2024-08-25 15:19     ` Henning Hraban Ramm
  2024-08-26  7:27   ` Hans Hagen via ntg-context
  1 sibling, 1 reply; 5+ messages in thread
From: Henning Hraban Ramm @ 2024-08-25 13:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 25.08.24 um 14:15 schrieb Wolfgang Schuster:
>> Are there even more?
> 
> Yes, there are more of them.
> 
> Look into the lowlevel-registers document which describes how they are
> created and also how you can define your own identifiers with \newuserunit.

Thank you! There must have been a manual, but I didn’t guess “registers” 
was relevant.

>> Questions:
>>
>> How differs "1" from "2"?
>> * em fs

> \NC em \EQ \the\dimexpr1em\relax \NC\NR % \emwidth
> \NC fs \EQ \the\dimexpr1fs\relax \NC\NR % \globalbodyfontsize

Ok, so they can differ minimally; in my 10pt setup I get the same value.

>> * lw hs
> 
> lw stands for \linewidth which is the default value for rulethickness in 
> \framed etc.

I mixed up \linewidth with \textwidth, thought the one was LaTeX and the 
other \ConTeXt, since we’re talking about rulewidth otherwise.

> hs is just \hsize.

Then it makes sense.

>> * ph vh
> ph is \paperheight.
> vh doesn't exist.

Ok, I had mis-noted vh from some older talk, meeting, or whatever, and 
forgot vs.

Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: understanding units / dimensions
  2024-08-25 13:52   ` Henning Hraban Ramm
@ 2024-08-25 15:19     ` Henning Hraban Ramm
  0 siblings, 0 replies; 5+ messages in thread
From: Henning Hraban Ramm @ 2024-08-25 15:19 UTC (permalink / raw)
  To: ntg-context

Am 25.08.24 um 15:52 schrieb Henning Hraban Ramm:
>> vh doesn't exist.
> 
> Ok, I had mis-noted vh from some older talk, meeting, or whatever, and 
> forgot vs.

Stumbled upon it again:
At the end of https://www.tug.org/TUGboat/tb42-3/tb132hagen-dk.pdf
Hans wrote:

vw (relative to the \hsize), vh (relative to
the \vsize), maybe a percentage (but of what) and
ch (width of the current zero digit character).

As if that wasn’t official documentation…

WRT to funits see also 
https://www.tug.org/TUGboat/tb44-2/tb137egger-edith.pdf

HR
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: understanding units / dimensions
  2024-08-25 12:15 ` [NTG-context] " Wolfgang Schuster
  2024-08-25 13:52   ` Henning Hraban Ramm
@ 2024-08-26  7:27   ` Hans Hagen via ntg-context
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen via ntg-context @ 2024-08-26  7:27 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 8/25/2024 2:15 PM, Wolfgang Schuster wrote:

>> How differs "1" from "2"?
>> * em fs
> 
> \startbuffer[dimensions]
> \starttabulate
> \NC em \EQ \the\dimexpr1em\relax \NC\NR % \emwidth
> \NC fs \EQ \the\dimexpr1fs\relax \NC\NR % \globalbodyfontsize
> \stoptabulate
> \stopbuffer
> 
> \starttext
> 
> \getbuffer[dimensions]
> 
> \setupbodyfont[14.4pt]
> 
> \getbuffer[dimensions]
> 
> \stoptext
Often they are the same (basically font units) but there can be some 
rounding going on; also bodyfont sizes are clipped

\starttext
     \the\numexpr(\dimexpr1fs\relax/65536)*100\relax\par
     \the\numexpr(\dimexpr1em\relax/65536)*100\relax

     \the\dimexpr1fs\relax\par
     \the\dimexpr1em\relax
\stoptext

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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 / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-08-26  7:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-25 11:45 [NTG-context] understanding units / dimensions Henning Hraban Ramm
2024-08-25 12:15 ` [NTG-context] " Wolfgang Schuster
2024-08-25 13:52   ` Henning Hraban Ramm
2024-08-25 15:19     ` Henning Hraban Ramm
2024-08-26  7:27   ` Hans Hagen via ntg-context

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