How to use OTF files in ConTeXt?
up vote
3
down vote
favorite
Is there a way For ConTeXt to use uninstalled .otf files in an arbitrary folder?
In my current LaTeX files, for example, I have:
setmainfont{ProximaNova}[
UprightFont=*-Regular,
ItalicFont=*-RegularItalic,
BoldFont=*-Bold,
BoldItalicFont=*-BoldItalic,
Path=../../fonts/ProximaNova/,
Extension=.otf]
It picks up the font files from a specific folder where I store all of my fonts. The naming is sometimes different between fonts so they are spec'ed in setmainfont.
The best I can tell from this question and documentation is that ConTeXt needs to read the fonts from some OSFONTDIR, which can be more can one folder, but must be specified in this variable. I can't use just any .otf files, specified directly in the .tex file. Or am I misreading? I don't think I saw anything indicating that typescript can take paths to files?
fonts context
New contributor
Roxy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
3
down vote
favorite
Is there a way For ConTeXt to use uninstalled .otf files in an arbitrary folder?
In my current LaTeX files, for example, I have:
setmainfont{ProximaNova}[
UprightFont=*-Regular,
ItalicFont=*-RegularItalic,
BoldFont=*-Bold,
BoldItalicFont=*-BoldItalic,
Path=../../fonts/ProximaNova/,
Extension=.otf]
It picks up the font files from a specific folder where I store all of my fonts. The naming is sometimes different between fonts so they are spec'ed in setmainfont.
The best I can tell from this question and documentation is that ConTeXt needs to read the fonts from some OSFONTDIR, which can be more can one folder, but must be specified in this variable. I can't use just any .otf files, specified directly in the .tex file. Or am I misreading? I don't think I saw anything indicating that typescript can take paths to files?
fonts context
New contributor
Roxy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
While you may call fonts by file name, the font has to be in the font name database. The easiest approach is to have a script that runs mtxrun wirh appropriate parameters to update the database.
– TeXnician
yesterday
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
Is there a way For ConTeXt to use uninstalled .otf files in an arbitrary folder?
In my current LaTeX files, for example, I have:
setmainfont{ProximaNova}[
UprightFont=*-Regular,
ItalicFont=*-RegularItalic,
BoldFont=*-Bold,
BoldItalicFont=*-BoldItalic,
Path=../../fonts/ProximaNova/,
Extension=.otf]
It picks up the font files from a specific folder where I store all of my fonts. The naming is sometimes different between fonts so they are spec'ed in setmainfont.
The best I can tell from this question and documentation is that ConTeXt needs to read the fonts from some OSFONTDIR, which can be more can one folder, but must be specified in this variable. I can't use just any .otf files, specified directly in the .tex file. Or am I misreading? I don't think I saw anything indicating that typescript can take paths to files?
fonts context
New contributor
Roxy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Is there a way For ConTeXt to use uninstalled .otf files in an arbitrary folder?
In my current LaTeX files, for example, I have:
setmainfont{ProximaNova}[
UprightFont=*-Regular,
ItalicFont=*-RegularItalic,
BoldFont=*-Bold,
BoldItalicFont=*-BoldItalic,
Path=../../fonts/ProximaNova/,
Extension=.otf]
It picks up the font files from a specific folder where I store all of my fonts. The naming is sometimes different between fonts so they are spec'ed in setmainfont.
The best I can tell from this question and documentation is that ConTeXt needs to read the fonts from some OSFONTDIR, which can be more can one folder, but must be specified in this variable. I can't use just any .otf files, specified directly in the .tex file. Or am I misreading? I don't think I saw anything indicating that typescript can take paths to files?
fonts context
fonts context
New contributor
Roxy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Roxy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Roxy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked yesterday
Roxy
2263
2263
New contributor
Roxy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Roxy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Roxy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
While you may call fonts by file name, the font has to be in the font name database. The easiest approach is to have a script that runs mtxrun wirh appropriate parameters to update the database.
– TeXnician
yesterday
add a comment |
While you may call fonts by file name, the font has to be in the font name database. The easiest approach is to have a script that runs mtxrun wirh appropriate parameters to update the database.
– TeXnician
yesterday
While you may call fonts by file name, the font has to be in the font name database. The easiest approach is to have a script that runs mtxrun wirh appropriate parameters to update the database.
– TeXnician
yesterday
While you may call fonts by file name, the font has to be in the font name database. The easiest approach is to have a script that runs mtxrun wirh appropriate parameters to update the database.
– TeXnician
yesterday
add a comment |
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
I don't have the Proxima Nova font, but I just downloaded the Cormorant font, so I'll use this one. Then I use definefontfamily to set up the font.
definefontfamily [mainface] [serif] [Latin Modern Roman]
[tf=file:Cormorant-Regular.ttf,
it=file:Cormorant-Italic.ttf,
bf=file:Cormorant-Bold.ttf,
bi=file:Cormorant-BoldItalic.ttf,
sc=file:CormorantSC-Regular.ttf]
definefontfamily [mainface] [sans] [Latin Modern Sans]
definefontfamily [mainface] [mono] [Latin Modern Mono] [features=none]
definefontfamily [mainface] [math] [Latin Modern Math]
setupbodyfont [mainface]
starttext
samplefile{knuth}
stoptext
I could have hardcoded the complete file path but that is too unflexible in my opinion. Instead I pass an appropriate value of OSFONTDIR to ConTeXt, as such
OSFONTDIR="~/Downloads/Cormorant_Install_v3.601/1. TrueType Font Files" context test.mkvi

@Roxy You can also define a typescript, which is actually my preferred way.definefontfamilyis document in the Garden: wiki.contextgarden.net/Command/definefontfamily
– Henri Menke
yesterday
Thanks. If you are using new font files, why do the commands have to reference an unrelated font, i.e. Latin Modern Roman in your example?
– Roxy
yesterday
@Roxy Fallback purposes.
– Henri Menke
yesterday
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
I don't have the Proxima Nova font, but I just downloaded the Cormorant font, so I'll use this one. Then I use definefontfamily to set up the font.
definefontfamily [mainface] [serif] [Latin Modern Roman]
[tf=file:Cormorant-Regular.ttf,
it=file:Cormorant-Italic.ttf,
bf=file:Cormorant-Bold.ttf,
bi=file:Cormorant-BoldItalic.ttf,
sc=file:CormorantSC-Regular.ttf]
definefontfamily [mainface] [sans] [Latin Modern Sans]
definefontfamily [mainface] [mono] [Latin Modern Mono] [features=none]
definefontfamily [mainface] [math] [Latin Modern Math]
setupbodyfont [mainface]
starttext
samplefile{knuth}
stoptext
I could have hardcoded the complete file path but that is too unflexible in my opinion. Instead I pass an appropriate value of OSFONTDIR to ConTeXt, as such
OSFONTDIR="~/Downloads/Cormorant_Install_v3.601/1. TrueType Font Files" context test.mkvi

@Roxy You can also define a typescript, which is actually my preferred way.definefontfamilyis document in the Garden: wiki.contextgarden.net/Command/definefontfamily
– Henri Menke
yesterday
Thanks. If you are using new font files, why do the commands have to reference an unrelated font, i.e. Latin Modern Roman in your example?
– Roxy
yesterday
@Roxy Fallback purposes.
– Henri Menke
yesterday
add a comment |
up vote
4
down vote
accepted
I don't have the Proxima Nova font, but I just downloaded the Cormorant font, so I'll use this one. Then I use definefontfamily to set up the font.
definefontfamily [mainface] [serif] [Latin Modern Roman]
[tf=file:Cormorant-Regular.ttf,
it=file:Cormorant-Italic.ttf,
bf=file:Cormorant-Bold.ttf,
bi=file:Cormorant-BoldItalic.ttf,
sc=file:CormorantSC-Regular.ttf]
definefontfamily [mainface] [sans] [Latin Modern Sans]
definefontfamily [mainface] [mono] [Latin Modern Mono] [features=none]
definefontfamily [mainface] [math] [Latin Modern Math]
setupbodyfont [mainface]
starttext
samplefile{knuth}
stoptext
I could have hardcoded the complete file path but that is too unflexible in my opinion. Instead I pass an appropriate value of OSFONTDIR to ConTeXt, as such
OSFONTDIR="~/Downloads/Cormorant_Install_v3.601/1. TrueType Font Files" context test.mkvi

@Roxy You can also define a typescript, which is actually my preferred way.definefontfamilyis document in the Garden: wiki.contextgarden.net/Command/definefontfamily
– Henri Menke
yesterday
Thanks. If you are using new font files, why do the commands have to reference an unrelated font, i.e. Latin Modern Roman in your example?
– Roxy
yesterday
@Roxy Fallback purposes.
– Henri Menke
yesterday
add a comment |
up vote
4
down vote
accepted
up vote
4
down vote
accepted
I don't have the Proxima Nova font, but I just downloaded the Cormorant font, so I'll use this one. Then I use definefontfamily to set up the font.
definefontfamily [mainface] [serif] [Latin Modern Roman]
[tf=file:Cormorant-Regular.ttf,
it=file:Cormorant-Italic.ttf,
bf=file:Cormorant-Bold.ttf,
bi=file:Cormorant-BoldItalic.ttf,
sc=file:CormorantSC-Regular.ttf]
definefontfamily [mainface] [sans] [Latin Modern Sans]
definefontfamily [mainface] [mono] [Latin Modern Mono] [features=none]
definefontfamily [mainface] [math] [Latin Modern Math]
setupbodyfont [mainface]
starttext
samplefile{knuth}
stoptext
I could have hardcoded the complete file path but that is too unflexible in my opinion. Instead I pass an appropriate value of OSFONTDIR to ConTeXt, as such
OSFONTDIR="~/Downloads/Cormorant_Install_v3.601/1. TrueType Font Files" context test.mkvi

I don't have the Proxima Nova font, but I just downloaded the Cormorant font, so I'll use this one. Then I use definefontfamily to set up the font.
definefontfamily [mainface] [serif] [Latin Modern Roman]
[tf=file:Cormorant-Regular.ttf,
it=file:Cormorant-Italic.ttf,
bf=file:Cormorant-Bold.ttf,
bi=file:Cormorant-BoldItalic.ttf,
sc=file:CormorantSC-Regular.ttf]
definefontfamily [mainface] [sans] [Latin Modern Sans]
definefontfamily [mainface] [mono] [Latin Modern Mono] [features=none]
definefontfamily [mainface] [math] [Latin Modern Math]
setupbodyfont [mainface]
starttext
samplefile{knuth}
stoptext
I could have hardcoded the complete file path but that is too unflexible in my opinion. Instead I pass an appropriate value of OSFONTDIR to ConTeXt, as such
OSFONTDIR="~/Downloads/Cormorant_Install_v3.601/1. TrueType Font Files" context test.mkvi

answered yesterday
Henri Menke
67.3k7148255
67.3k7148255
@Roxy You can also define a typescript, which is actually my preferred way.definefontfamilyis document in the Garden: wiki.contextgarden.net/Command/definefontfamily
– Henri Menke
yesterday
Thanks. If you are using new font files, why do the commands have to reference an unrelated font, i.e. Latin Modern Roman in your example?
– Roxy
yesterday
@Roxy Fallback purposes.
– Henri Menke
yesterday
add a comment |
@Roxy You can also define a typescript, which is actually my preferred way.definefontfamilyis document in the Garden: wiki.contextgarden.net/Command/definefontfamily
– Henri Menke
yesterday
Thanks. If you are using new font files, why do the commands have to reference an unrelated font, i.e. Latin Modern Roman in your example?
– Roxy
yesterday
@Roxy Fallback purposes.
– Henri Menke
yesterday
@Roxy You can also define a typescript, which is actually my preferred way.
definefontfamily is document in the Garden: wiki.contextgarden.net/Command/definefontfamily– Henri Menke
yesterday
@Roxy You can also define a typescript, which is actually my preferred way.
definefontfamily is document in the Garden: wiki.contextgarden.net/Command/definefontfamily– Henri Menke
yesterday
Thanks. If you are using new font files, why do the commands have to reference an unrelated font, i.e. Latin Modern Roman in your example?
– Roxy
yesterday
Thanks. If you are using new font files, why do the commands have to reference an unrelated font, i.e. Latin Modern Roman in your example?
– Roxy
yesterday
@Roxy Fallback purposes.
– Henri Menke
yesterday
@Roxy Fallback purposes.
– Henri Menke
yesterday
add a comment |
Roxy is a new contributor. Be nice, and check out our Code of Conduct.
Roxy is a new contributor. Be nice, and check out our Code of Conduct.
Roxy is a new contributor. Be nice, and check out our Code of Conduct.
Roxy is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461295%2fhow-to-use-otf-files-in-context%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
While you may call fonts by file name, the font has to be in the font name database. The easiest approach is to have a script that runs mtxrun wirh appropriate parameters to update the database.
– TeXnician
yesterday