Re: [NTG-context] Referencing fonts by path within ConTeXt

2021-08-07 Thread Wolfgang Schuster via ntg-context

Joey McCollum via ntg-context schrieb am 07.08.2021 um 22:29:

Hi,

I'm interested in packaging a ConTeXt project in a self-contained way, 
so that the environment/component/project .tex files, the bibliography 
.bib file(s), and fonts used for typesetting are all provided in one 
place. (The goal is that others can generate the PDFs themselves from 
the source files as long as they have a sufficiently recent version of 
ConTeXt installed.) The usual ConTeXt directory structure makes sense 
for most of this, but it doesn't address the possibility of accessing 
fonts locally. I think I could do this with a script that temporarily 
sets the OSFONTDIR variable to the local fonts directory and then 
invokes ConTeXt to typeset the project-level file, but I was wondering 
if there is an easier way to do this from within ConTeXt. 
Specifically, is there a way to specify a font via a local path with 
font setup commands in an environment file?


You can use

    \usefontpath[...]

to set a directory where ConTeXt searches for fonts but this works only 
when you use a typescript and not for \definefontfamily.


Wolfgang

___
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
___


Re: [NTG-context] Referencing fonts by path within ConTeXt

2021-08-07 Thread Henning Hraban Ramm via ntg-context


> Am 07.08.2021 um 22:29 schrieb Joey McCollum via ntg-context 
> :
> 
> Hi,
> 
> I'm interested in packaging a ConTeXt project in a self-contained way, so 
> that the environment/component/project .tex files, the bibliography .bib 
> file(s), and fonts used for typesetting are all provided in one place. (The 
> goal is that others can generate the PDFs themselves from the source files as 
> long as they have a sufficiently recent version of ConTeXt installed.) The 
> usual ConTeXt directory structure makes sense for most of this, but it 
> doesn't address the possibility of accessing fonts locally. I think I could 
> do this with a script that temporarily sets the OSFONTDIR variable to the 
> local fonts directory and then invokes ConTeXt to typeset the project-level 
> file, but I was wondering if there is an easier way to do this from within 
> ConTeXt. Specifically, is there a way to specify a font via a local path with 
> font setup commands in an environment file?

You can just specify your fonts in the typescript as 
[file:relative_path/fontname.otf].

OSFONTDIR isn’t as reliable as you need "mtxrun --script fonts --reload" after 
changing it (and sometimes "mtxrun --generate" before).

Hraban
___
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
___


[NTG-context] Referencing fonts by path within ConTeXt

2021-08-07 Thread Joey McCollum via ntg-context
Hi,

I'm interested in packaging a ConTeXt project in a self-contained way, so
that the environment/component/project .tex files, the bibliography .bib
file(s), and fonts used for typesetting are all provided in one place. (The
goal is that others can generate the PDFs themselves from the source files
as long as they have a sufficiently recent version of ConTeXt installed.)
The usual ConTeXt directory structure makes sense for most of this, but it
doesn't address the possibility of accessing fonts locally. I think I could
do this with a script that temporarily sets the OSFONTDIR variable to the
local fonts directory and then invokes ConTeXt to typeset the project-level
file, but I was wondering if there is an easier way to do this from within
ConTeXt. Specifically, is there a way to specify a font via a local path
with font setup commands in an environment file?

Thank you!

Joey
___
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
___