ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: Scaling characters without font switching in CLD
Date: Sat, 12 Aug 2023 17:34:06 +0200	[thread overview]
Message-ID: <eee3ab0f-875e-39f9-a546-44b76aa81b1d@xs4all.nl> (raw)
In-Reply-To: <894c91b8-c97f-44a0-a6dd-ae6e7a342060@Spark>

On 8/12/2023 4:03 PM, Hamid,Idris wrote:

> \tfx causes a switch to computer modern.

Indeed. Something I need to discuss with Wolfgang as double checking is 
needed before I patch.

> But what if we want to scale independently of font switching?
There is no need to go lua here (esp when you have not done vf magick 
before and i'm not going to debug code that i have little clue what it's 
about to do).

- we cheat here and yuse glyph scaled (I have to provide a relative to 
current x/y scaling, don't use \glyphscale as that one is used by 
context itself
- we use the style variant so that it adapts
- you have to replace "Serif" with "YourFont" and map that one onto a 
file (YourFont YourFontBold etc)
- more about these box manipulations in the low level manual

\startsetups glyph:iTee
     \dontleavehmode\hpack\bgroup
         \setbox\scratchbox \ruledhbox \bgroup
             \glyphxscale 400
             \glyphyscale 400
             \getglyphstyled{Serif}{T}% choose a font here
         \egroup
         \scratchheight 2.75\ht\scratchbox
         \boxyoffset    \scratchbox\scratchheight
         \boxorientation\scratchbox\plustwo
         \ht            \scratchbox\scratchheight
         \box\scratchbox
     \egroup
\stopsetups

\definesymbol
   [iTee]
   [\directsetup{glyph:iTee}]

\startTEXpage [offset=1ts,width=2cm]
     \ruledhbox {\tfx T \symbol{iTee}} \par
     \ruledhbox {T      \symbol{iTee}} \par
     \ruledhbox {\tfa T \symbol{iTee}} \par
     \ruledhbox {\bfd T \symbol{iTee}}
\stopTEXpage

Hans

-----------------------------------------------------------------
                                           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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2023-08-12 15:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-12 14:03 [NTG-context] " Hamid,Idris
2023-08-12 15:34 ` Hans Hagen [this message]
2023-08-12 18:05   ` [NTG-context] " Hamid,Idris
2023-08-12 20:10     ` Hans Hagen via ntg-context
2023-08-12 21:33       ` Hamid,Idris
2023-08-12 21:48         ` Hans Hagen
2023-08-12 22:11           ` Hamid,Idris
2023-08-12 22:16             ` Hamid,Idris
2023-08-12 22:56               ` Hamid,Idris
2023-08-13 12:32                 ` Hans Hagen via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eee3ab0f-875e-39f9-a546-44b76aa81b1d@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).