ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* m-ipsum broken
@ 2021-01-24  1:10 Jairo A. del Rio
  2021-01-24 12:40 ` Hans Hagen
  2021-01-24 15:44 ` new font trickery Hans Hagen
  0 siblings, 2 replies; 9+ messages in thread
From: Jairo A. del Rio @ 2021-01-24  1:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi, list

Compiling m-ipsum yields an error in latest LMTX (2021.01.22 09:41)

Jairo

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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread
* new font trickery
@ 2020-12-22 21:28 Hans Hagen
  2020-12-23 10:36 ` mf
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2020-12-22 21:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,


I finally decided to start an experiment that I had on my todo list for 
a while: dynamically scaling fonts. Below is an example of usage (plus 
some comment). In that example some 2*200 different font sizes are used 
which in mkiv demands 400 font definitions. This costs time and memory. 
The example below runs (on my old laptop) in less than 2 seconds and 
only uses two instances. I bet that our CJK users will love it.

I post it because:

(1) I need to discuss the impact with Wolfgang ... how do we integrate 
this. We can for instance define some sizes (\tfa \tfb ...) differently.

(2) I want to see if average performance improves on huge documents with 
many fonts / sizes (that is for Massimiliano to test).

(3) Are there side effects? It does work for math (rather neat trickery) 
but maybe we need an additional configration for that.

(4) I considered several variants but for now use a low level 
\glyphscale command that takes a number (in goodl old tex tradition a 
scale of 1.0 is entered as 1000).

(5) The implementation can be improved a bit (performance wise). There 
is a bit more overhead involved but usually I can compensate that.

(6) It will not be backported to MKIV so one can only test in LMTX. 
it's a bit of a mix between engine and context features.

(7) There can be bugs (unforseen side effects, or typos in the somewhat 
quick patches in the source).

Consider it an experiment, but so far I'm rather satisfied,

Hans



%%%% EXAMPLE %%%%

\setuplayout[middle]

\setupbodyfont[pagella,10pt]

\setupalign[verytolerant,stretch]

\setupwhitespace[big]

\starttext

\startbuffer
\definescaledfont[bfe][scale=2000,style=bf]

\setuphead[chapter][style=\bfe]

\dostepwiserecurse {10} {2020} {10} {
     \title{Here we go #1!}
     \start
     \glyphscale#1\relax
     \setupinterlinespace
     \samplefile{ward}%
     \bf
     \samplefile{ward}
     \par
     \stop
     \page
}
\stopbuffer

\getbuffer

\title{Scaled fonts}

Although \CONTEXT\ is quite efficient with fonts there is always room for
improvement. However, after years of finetuning the font mechanisms 
there was not
that much room left. This made me think of a different approach to scaling.
Nowadays fonts seldom come in design sizes. Also, in \CONTEXT\ \MKIV\ and
therefore \LMTX\ we always had so called dynamic features: apply additional
features locally, although that comes with a small penalty in 
performance, it
saves additional font instances. It is a good approach for the 
occasional small
stretch of glyphs, like small capped logos and such.

We now can also do dynamic font scaling, which means that we don't need 
to define
a new font instance when the same feature set is used. Or course in 
addition to
this features one can still use the dynamic features. This means that for
instance chapter titling can use the bodyfont instance and just apply 
additional
scaling. Although for a normal run the number of loaded fonts is 
normally small,
and the number of instances also isn't that impressive it can happen in 
a large
document that you end up with a few dozen. That number can now be 
reduced to half
a dozen.

Of course there can be side effects, whcich is why it's currently tagged as
experimental. There is also a small performance hit because we now need 
to track
it but that is gained back because we load less fonts and have less 
glyph runs.
It even works in math, although there some different trickery is needed.

\typebuffer

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

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

end of thread, other threads:[~2021-01-24 21:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24  1:10 m-ipsum broken Jairo A. del Rio
2021-01-24 12:40 ` Hans Hagen
2021-01-24 15:44 ` new font trickery Hans Hagen
2021-01-24 16:34   ` Pablo Rodriguez
     [not found]     ` <149c1645-b437-bc71-76f6-8ccd3bf1e650@xs4all.nl>
2021-01-24 17:16       ` Pablo Rodriguez
2021-01-24 21:25         ` Hans Hagen
  -- strict thread matches above, loose matches on Subject: below --
2020-12-22 21:28 Hans Hagen
2020-12-23 10:36 ` mf
2020-12-23 10:46   ` Hans Hagen

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