1

How can I make ConTeXt ignore my system-fonts?

Currently, ConTeXt scans and uses all system fonts (all the files in the font folder of windows 7) first and the fonts in the ConTeXt folder second.

I want ConTeXt to ignore system fonts and only use fonts in the ConTeXt folder.

1
  • 2
    ConTeXt should not do this by default. Do you have the variable OSFONTDIR pointing to some of your system font directories?
    – Marco
    Oct 2, 2013 at 8:11

1 Answer 1

1

Answer: ConTeXt includes system fonts by default, unless the user prevents it by two steps. (tested under windows and found similar code for MacOS, but maybe not for linux)

The environment variable OSFONTDIR must be set and must not be empty. It can point to the desired font directory of fonts you want to use inside ConTeXt or to an empty directory.

At least on windows-systems, the file \fonts\conf\fonts.conf must also be changed. An XML-entry, by default <dir>c:/windows/fonts</dir>, must also be changed and set to the desired location of the fonts.

Background: If the environment variable OSFONTDIR is not set or is set to an empty string, it is filled with the path to the system font directory by mtxrun.lua

do
  local osfontdir=osgetenv("OSFONTDIR")
  if osfontdir and osfontdir~="" then
  elseif osname=="windows" then
    ossetenv("OSFONTDIR","c:/windows/fonts//")
  elseif osname=="macosx" then
    ossetenv("OSFONTDIR","$HOME/Library/Fonts//;/Library/Fonts//;/System/Library/Fonts//")
  end
end

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .