How to use OTF files in ConTeXt?











up vote
3
down vote

favorite
1












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?










share|improve this question







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















up vote
3
down vote

favorite
1












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?










share|improve this question







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













up vote
3
down vote

favorite
1









up vote
3
down vote

favorite
1






1





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?










share|improve this question







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






share|improve this question







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.











share|improve this question







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.









share|improve this question




share|improve this question






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


















  • 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










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


enter image description here






share|improve this answer





















  • @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










  • @Roxy Fallback purposes.
    – Henri Menke
    yesterday











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Roxy is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















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

























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


enter image description here






share|improve this answer





















  • @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










  • @Roxy Fallback purposes.
    – Henri Menke
    yesterday















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


enter image description here






share|improve this answer





















  • @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










  • @Roxy Fallback purposes.
    – Henri Menke
    yesterday













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


enter image description here






share|improve this answer












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


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









Henri Menke

67.3k7148255




67.3k7148255












  • @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










  • @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










  • 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










Roxy is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















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.















 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Entries order in /etc/network/interfaces

新発田市

Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)