ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: context@vivaldi.net
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Fonts from various .otf to work with \bold, \emph, \bf, \bfa ...
Date: Fri, 07 Feb 2020 08:34:47 +0100	[thread overview]
Message-ID: <b50eb6a7e6765f1ce7546597fc8de6c3@vivaldi.net> (raw)
In-Reply-To: <f9edfb7c-031c-beb6-7571-96d36645ad3c@gmx.es>

[-- Attachment #1: Type: text/plain, Size: 3039 bytes --]

Hello Pablo,

thank you for showing the way; unfortunately, still something is 
missing:

- the resulting file uses LMRoman instead of WorkSans,

- the log confirms:

"selectfont      > The requested font 'WorkSans' has no files for the 
'tf' alternative, Latin Modern is used instead".

- Note that all WorkSans files:

   work-sans.bold.otf
   work-sans.bold-italic.otf
   work-sans.light.otf
   work-sans.light-italic.otf

     are placed in the same directory as the main source file. (I can zip 
them and upload somewhere for testing purposes.)

- In your code bellow, I cann't see any link to any work-sans .otf file 
name.

   - Does it mean that that ConTeXt browses its database of "known" 
fonts, searches for all fonts which contain "identification" as 
"WorkSans" (given from your \definefontfamily...[WorkSans])?

- Also, I see assignments [tf={style:light},it={style:lightitalic}]:

   - Should also an assignment for "bf=[style:...]" be provided?

   - How ConTeXt gets to know from "it={style:lightitalic}" that file 
"work-sans.light-italic.otf" should be used?

Sorry for elementary questions, I'm still "in captivity" of swtching 
fonts, their styles and font sizes by clicking a combo in Word toolbar 
(although I quit using Word about 15 ys ago). And although I'm aware of 
different dealing with fonts in TeX (and in professional typesetting in 
general), it's often difficult for me to imagine how exactly TeX 
switchches fonts, what is the relationship between (and how the comands 
cooperate) \definefontfamily, \setupbodyfontenvironment, \setupbodyfont, 
\definefontsynonym, \definefont, typescripts, simplefonts module and 
also what is the relations among parameters to the-above commands.

So any practical samples (e.g. here discussed) helps me much.

Best regards,

Lukas


> Hi Lukas,
> 
> I think this is what you might need:
> 
>     \definefontfamily
>         [mainface]
>         [rm]
>         [WorkSans]
>         [tf={style:light}, it={style:lightitalic}]
>     \setupbodyfont[mainface]
> 
>     \setupbodyfontenvironment
>         [default]
>         [a=1.2,
>          b=2.4,
>          c=3.6,
>          d=4.8,
>          em=italic]
> 
>     \starttext
>     \startTEXpage[offset=1em]
>         roman\\
>         {\bf bold}\\
>         {\it italic}\\
>         {\bi bold italic}\\
>         {\tfa roman}\\
>         {\bfb bold}\\
>         {\itc italic}\\
>         {\bid bold italic}\\
>     \stopTEXpage
>     \stoptext
> 
> I hope it helps,
> 
> Pablo
> --
> http://www.ousia.tk
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

[-- Attachment #2: t-Font.log --]
[-- Type: text/plain, Size: 8060 bytes --]

open source     > level 1, order 1, name 'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system          > 
system          > ConTeXt  ver: 2019.12.31 11:28 MKIV beta  fmt: 2020.1.8  int: english/english
system          > 
system          > 'cont-new.mkiv' loaded
open source     > level 2, order 2, name 'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system          > beware: some patches loaded from cont-new.mkiv
close source    > level 2, order 2, name 'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'

system          > jobfiles > using path: d:\\Lukas\\ConTeXt\\Styles
system          > files > jobname 't-Font', input 'D:\\Lukas\\Jobs\\KatMostu.TP\\Test\\t-Font.mkiv', result 't-Font'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
open source     > level 2, order 3, name 'D://Lukas/Jobs/KatMostu.TP/Test/t-Font.mkiv'
selectfont      > The requested font 'WorkSans' has no files for the 'tf' alternative, Latin Modern is used instead.
fonts           > preloading modern-designsize (math)
fonts           > typescripts > unknown library 'modern-designsize'
fonts           > 'fallback modern-designsize mm 12pt' is loaded
fonts           > preloading modern-designsize (mono)
fonts           > 'fallback modern-designsize tt 12pt' is loaded
backend         > xmp > using file 'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages           > flushing realpage 1, userpage 1, subpage 1
close source    > level 2, order 3, name 'D://Lukas/Jobs/KatMostu.TP/Test/t-Font.mkiv'
close source    > level 1, order 3, name 'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'

system          > start used files

system          > text: t-Font

system          > stop used files


system          > start used files

system          >    1: filename=char-prv.lua filetype=tex format=tex foundname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/char-prv.lua fullname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/char-prv.lua usedmethod=database
system          >    2: filename=cont-yes.mkiv filetype=tex foundname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv fullname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv usedmethod=database
system          >    3: filename=publ-imp-default.lua filetype=scripts foundname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/publ-imp-default.lua fullname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/publ-imp-default.lua usedmethod=database
system          >    4: filename=cont-new.mkiv filetype=tex foundname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv fullname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv usedmethod=database
system          >    5: filename=lang-exc.lua filetype=scripts foundname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/lang-exc.lua fullname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/lang-exc.lua usedmethod=database
system          >    6: filename=lang-us.lua filetype=scripts foundname=d:/Ctx-Beta/tex/texmf-context/tex/context/patterns/mkiv/lang-us.lua fullname=d:/Ctx-Beta/tex/texmf-context/tex/context/patterns/mkiv/lang-us.lua usedmethod=database
system          >    7: filename=D://Lukas/Jobs/KatMostu.TP/Test/t-Font.mkiv foundname=D://Lukas/Jobs/KatMostu.TP/Test/t-Font.mkiv fullname=D://Lukas/Jobs/KatMostu.TP/Test/t-Font.mkiv usedmethod=direct
system          >    8: filename=lm.lfg filetype=tex foundname=d:/Ctx-Beta/tex/texmf-context/tex/context/fonts/mkiv/lm.lfg fullname=d:/Ctx-Beta/tex/texmf-context/tex/context/fonts/mkiv/lm.lfg usedmethod=database
system          >    9: filename=lmroman10-regular filetype=otf format=otf foundname=d:/Ctx-Beta/tex/texmf/fonts/opentype/public/lm/lmroman10-regular.otf fullname=d:/Ctx-Beta/tex/texmf/fonts/opentype/public/lm/lmroman10-regular.otf usedmethod=database
system          >   10: filename=lmroman10-bold filetype=otf format=otf foundname=d:/Ctx-Beta/tex/texmf/fonts/opentype/public/lm/lmroman10-bold.otf fullname=d:/Ctx-Beta/tex/texmf/fonts/opentype/public/lm/lmroman10-bold.otf usedmethod=database
system          >   11: filename=lmroman10-italic filetype=otf format=otf foundname=d:/Ctx-Beta/tex/texmf/fonts/opentype/public/lm/lmroman10-italic.otf fullname=d:/Ctx-Beta/tex/texmf/fonts/opentype/public/lm/lmroman10-italic.otf usedmethod=database
system          >   12: filename=lmroman10-bolditalic filetype=otf format=otf foundname=d:/Ctx-Beta/tex/texmf/fonts/opentype/public/lm/lmroman10-bolditalic.otf fullname=d:/Ctx-Beta/tex/texmf/fonts/opentype/public/lm/lmroman10-bolditalic.otf usedmethod=database
system          >   13: filename=pdftex.map filetype=map format=map foundname=d:/Ctx-Beta/tex/texmf/fonts/map/pdftex/plain/pdftex.map fullname=d:/Ctx-Beta/tex/texmf/fonts/map/pdftex/plain/pdftex.map usedmethod=database
system          >   14: filename=lpdf-pdx.xml filetype=tex foundname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml fullname=d:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml usedmethod=database

system          > stop used files


system          > start commandline options

system          > currentrun="1"
system          > fulljobname="D:\\Lukas\\Jobs\\KatMostu.TP\\Test\\t-Font.mkiv"
system          > input="D:\\Lukas\\Jobs\\KatMostu.TP\\Test\\t-Font.mkiv"
system          > kindofrun="1"
system          > maxnofruns="9"
system          > nonstopmode="true"
system          > path="d:\\Lukas\\ConTeXt\\Styles"
system          > texmfbinpath="d:/Ctx-Beta/tex/texmf-mswin/bin"

system          > stop commandline options


system          > start commandline files

system          >    1: D:\\Lukas\\Jobs\\KatMostu.TP\\Test\\t-Font.mkiv

system          > stop commandline files


modules         > start used modules


modules         > stop used modules


mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: d:/Ctx-Beta/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.000 seconds, 0 scans with scantime 0.000 seconds, 0 shared scans, 14 found files, scanned paths: <none>
mkiv lua stats  > stored bytecode data: 450 modules (0.230 sec), 93 tables (0.013 sec), 543 chunks (0.243 sec)
mkiv lua stats  > traced context: maxstack: 1393, freed: 0, unreachable: 1393
mkiv lua stats  > cleaned up reserved nodes: 56 nodes, 9 lists of 442
mkiv lua stats  > node memory usage: 3 glue, 3 kern, 4 penalty, 17 attribute, 51 glue_spec, 6 attribute_list, 2 temp, 2 user_defined
mkiv lua stats  > node list callback tasks: 8 unique task lists, 7 instances (re)created, 57 calls
mkiv lua stats  > used backend: pdf (backend for directly generating pdf output)
mkiv lua stats  > jobdata time: 0.000 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks: internal: 166, file: 167, direct: 2, late: 0, function 513, total: 848
mkiv lua stats  > randomizer: resumed with value 0.86941528320313
mkiv lua stats  > result saved in file: t-Font.pdf, compresslevel 3, objectcompresslevel 1
mkiv lua stats  > loaded patterns: en::1, load time: 0.000
mkiv lua stats  > loaded fonts: 4 files: lmroman10-bold.otf, lmroman10-bolditalic.otf, lmroman10-italic.otf, lmroman10-regular.otf
mkiv lua stats  > font engine: otf 3.110, afm 1.513, tfm 1.000, 11 instances, 7 shared in backend, 1 common vectors, 6 common hashes, load time 0.031 seconds 
mkiv lua stats  > used platform: mswin, type: windows, binary subtree: texmf-mswin
mkiv lua stats  > used engine: luatex version 1.112 with functionality level 7226, banner: this is luatex, version 1.11.2 (tex live 2019/w32tex)
mkiv lua stats  > control sequences: 45371 of 65536 + 100000
mkiv lua stats  > lua properties: engine: lua 5.3, used memory: 55 MB, ctx: 54 MB, max: unknown MB), hash chars: min(32,40), symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 0.452 seconds, 1 processed pages, 1 shipped pages, 2.212 pages/second


[-- Attachment #3: t-Font.mkiv --]
[-- Type: text/plain, Size: 461 bytes --]

\definefontfamily
  [mainface]
  [rm]
  [WorkSans]
  [tf={style:light},it={style:lightitalic}]

\setupbodyfont[mainface]

\setupbodyfontenvironment
  [default]
  [a=1.2,
   b=2.4,
   c=3.6,
   d=4.8,
   em=italic]

\starttext
  \startTEXpage[offset=1em]
    roman\\
    {\bf bold}\\
    {\it italic}\\
    {\bi bold italic}\\
    {\tfa roman}\\
    {\bfb bold}\\
    {\itc italic}\\
    {\bid bold italic}\\
  \stopTEXpage
\stoptext

[-- Attachment #4: Fonts~~.jpg --]
[-- Type: image/jpeg, Size: 29839 bytes --]

[-- Attachment #5: 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
___________________________________________________________________________________

  reply	other threads:[~2020-02-07  7:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06  9:04 context
2020-02-06 19:24 ` Pablo Rodriguez
2020-02-07  7:34   ` context [this message]
2020-02-07 20:22     ` Pablo Rodriguez
2020-02-07 21:58       ` Henning Hraban Ramm
2020-02-08 11:49       ` Wolfgang Schuster

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=b50eb6a7e6765f1ce7546597fc8de6c3@vivaldi.net \
    --to=context@vivaldi.net \
    --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).