Font recognition with command "context", but not with command "texexec"
Hi, this might be a very simple problem, but I tried to figure it out for some time now without success. Reading manuals, searching with Google, etc. did not help. So if it actually is very simple, I herewith apologize. I really tried to solve it without the mailing list. Here is the Problem: The command "texexec" ignores the bodyfont setup. When I process the following code \setupbodyfont[gentium] \starttext This little text is enough to demonstrate the problem. \stoptext with the command "texexec /filename/", the default font is used. Only when i use the command "context/filename/.tex", context uses the font gentium. The gentium font is a truetype font and stored on my system under /usr/share/fonts. I use Linux Mint Debian Edition 201204. My .bashrc file contains the following line: export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts;/usr/share/fonts" I use the standalone version of context with pdftex. The command \contextversion returns "2012.07.27 16:41", i.e. the time I last updated it. Using the mkiv switch did not help. texexec mkiv /filename/ Any comments are welcome. Best, martin
Am 28.07.2012 um 21:11 schrieb Martin Rimmler
Hi,
this might be a very simple problem, but I tried to figure it out for some time now without success. Reading manuals, searching with Google, etc. did not help. So if it actually is very simple, I herewith apologize. I really tried to solve it without the mailing list.
Here is the Problem: The command "texexec" ignores the bodyfont setup. When I process the following code
\setupbodyfont[gentium]
\starttext This little text is enough to demonstrate the problem. \stoptext
with the command "texexec filename", the default font is used. Only when i use the command "context filename.tex", context uses the font gentium. The gentium font is a truetype font and stored on my system under /usr/share/fonts. I use Linux Mint Debian Edition 201204. My .bashrc file contains the following line:
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts;/usr/share/fonts"
I use the standalone version of context with pdftex. The command \contextversion returns "2012.07.27 16:41", i.e. the time I last updated it.
Using the mkiv switch did not help.
texexec mkiv filename
Any comments are welcome.
For MkII you have to load the typescript file and the typescript yourself while for MkIV these two steps are done together with the \setupbodyfont command when the name for the typeface, typescript and file is the same (e.g. gentium and type-gentium). \usetypescriptfile[type-gentium] \usetypescript[gentium][texnansi] \setupbodyfont[gentium] \starttext This little text is enough to demonstrate the problem. \stoptext Wolfgang
On 07/29/2012 03:34 AM, Wolfgang Schuster wrote:
For MkII you have to load the typescript file and the typescript yourself while for MkIV these two steps are done together with the \setupbodyfont command when the name for the typeface, typescript and file is the same (e.g. gentium and type-gentium).
\usetypescriptfile[type-gentium] \usetypescript[gentium][texnansi] \setupbodyfont[gentium]
\starttext This little text is enough to demonstrate the problem. \stoptext
Wolfgang
Just curious: will ConTeXt use the fontconfig mechanism some day or are there technical/philosophical reasons not to? -- Bill Meahan, Westland, Michigan USA “Writing is a combination of intangible creative fantasy and appallingly hard work.” —Anthony Powell This message is digitally signed with an X.509 certificate to prove it is from me and has not been altered since it was sent.
On Sun, Jul 29, 2012 at 3:39 PM, Bill Meahan wrote:
Just curious: will ConTeXt use the fontconfig mechanism some day or are there technical/philosophical reasons not to?
Do you mean MKII or MKIV? For MKII the answer is no. MKIV can - to a certain extent - read and interpret fontconfig's XML configuration file. The real question is whether ConTeXt finds the right file. On windows there is fonts.conf used by XeTeX and it might be that MKIV reads that file, but I'm not sure. There is no seriously technical reason, it's more that developers aren't too eager to have dependencies on external libraries. And the fact that at least on Windows and Mac the system fonts are being searched for on their standard locations. Mojca
On 29-7-2012 22:36, Mojca Miklavec wrote:
On Sun, Jul 29, 2012 at 3:39 PM, Bill Meahan wrote:
Just curious: will ConTeXt use the fontconfig mechanism some day or are there technical/philosophical reasons not to?
Do you mean MKII or MKIV? For MKII the answer is no. MKIV can - to a certain extent - read and interpret fontconfig's XML configuration file. The real question is whether ConTeXt finds the right file. On windows there is fonts.conf used by XeTeX and it might be that MKIV reads that file, but I'm not sure.
Last time I checked (more than a year ago) it did read that file. You can check that with \enabletrackers[fonts.names] when the database is generated.
There is no seriously technical reason, it's more that developers aren't too eager to have dependencies on external libraries. And the fact that at least on Windows and Mac the system fonts are being searched for on their standard locations.
Or: "the developers never check that as they don't depend on system fonts in projects" (I always copy font files to known locations i.e. texmf-fonts). Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Mon, Jul 30, 2012 at 1:05 AM, Hans Hagen wrote:
On 29-7-2012 22:36, Mojca Miklavec wrote:
For MKII the answer is no. MKIV can - to a certain extent - read and interpret fontconfig's XML configuration file. The real question is whether ConTeXt finds the right file. On windows there is fonts.conf used by XeTeX and it might be that MKIV reads that file, but I'm not sure.
Last time I checked (more than a year ago) it did read that file.
What I have in mind is that it's far from being trivial to find the right fonts.conf, on linux in particular. On my mac I have: /Applications/Gimp.app/Contents/Resources/etc/fonts/fonts.conf /Applications/MPlayer OSX Extended.app/Contents/Resources/fonts/fonts.conf /opt/local/etc/fonts/fonts.conf /usr/X11/lib/X11/fontconfig/conf.avail/05-osx-fonts.conf /usr/X11/lib/X11/fontconfig/conf.d/05-osx-fonts.conf /usr/X11/lib/X11/fontconfig/fonts.conf So feel free to guess which one to use ;) I believe that one should at least consider /usr/X11/lib/X11/fontconfig/fonts.conf & /usr/X11/lib/X11/fontconfig/conf.d/05-osx-fonts.conf in my case, but there is no "include the other file", so ConTeXt would actually have to start reading both. The first two files are bundled with applications (Gimp, MPlayer) and aso have their own caches & their own settings, so when users start messing and configuring the system-wide settings, those two applications won't obey those anyway. One has to set at least the variable FONTCONFIG_PATH which means that it won't work out of the box, in which case one can just as well set OSFONTDIR directly. I think that I asked Fedora packagers to set FONTCONFIG_PATH in their distribution though. Mojca
On Mon, Jul 30, 2012 at 09:50:44AM +0200, Mojca Miklavec wrote:
On Mon, Jul 30, 2012 at 1:05 AM, Hans Hagen wrote:
On 29-7-2012 22:36, Mojca Miklavec wrote:
For MKII the answer is no. MKIV can - to a certain extent - read and interpret fontconfig's XML configuration file. The real question is whether ConTeXt finds the right file. On windows there is fonts.conf used by XeTeX and it might be that MKIV reads that file, but I'm not sure.
Last time I checked (more than a year ago) it did read that file.
What I have in mind is that it's far from being trivial to find the right fonts.conf, on linux in particular. On my mac I have:
/Applications/Gimp.app/Contents/Resources/etc/fonts/fonts.conf /Applications/MPlayer OSX Extended.app/Contents/Resources/fonts/fonts.conf /opt/local/etc/fonts/fonts.conf /usr/X11/lib/X11/fontconfig/conf.avail/05-osx-fonts.conf /usr/X11/lib/X11/fontconfig/conf.d/05-osx-fonts.conf /usr/X11/lib/X11/fontconfig/fonts.conf
So feel free to guess which one to use ;)
I believe that one should at least consider /usr/X11/lib/X11/fontconfig/fonts.conf & /usr/X11/lib/X11/fontconfig/conf.d/05-osx-fonts.conf in my case, but there is no "include the other file", so ConTeXt would actually have to start reading both.
fonts.conf should have something like: <include ignore_missing="yes">conf.d</include> no? Here it does, otherwise fontconfig itself has no way of reading other files. But the whole thing is tricky, because the default path to the root fonts.conf file is set into libfontconfig at build time, ConTeXt has no way of knowing that, short of linking to libfontconfig.
The first two files are bundled with applications (Gimp, MPlayer) and aso have their own caches & their own settings, so when users start messing and configuring the system-wide settings, those two applications won't obey those anyway.
Which is very pointless, there should be only one fontconfig installed system wide, but that mac anyway :) Regards, Khaled
On Mon, Jul 30, 2012 at 11:06 AM, Khaled Hosny wrote:
On Mon, Jul 30, 2012 at 09:50:44AM +0200, Mojca Miklavec wrote:
On Mon, Jul 30, 2012 at 1:05 AM, Hans Hagen wrote:
On 29-7-2012 22:36, Mojca Miklavec wrote:
For MKII the answer is no. MKIV can - to a certain extent - read and interpret fontconfig's XML configuration file. The real question is whether ConTeXt finds the right file. On windows there is fonts.conf used by XeTeX and it might be that MKIV reads that file, but I'm not sure.
Last time I checked (more than a year ago) it did read that file.
What I have in mind is that it's far from being trivial to find the right fonts.conf, on linux in particular. On my mac I have:
/Applications/Gimp.app/Contents/Resources/etc/fonts/fonts.conf /Applications/MPlayer OSX Extended.app/Contents/Resources/fonts/fonts.conf /opt/local/etc/fonts/fonts.conf /usr/X11/lib/X11/fontconfig/conf.avail/05-osx-fonts.conf /usr/X11/lib/X11/fontconfig/conf.d/05-osx-fonts.conf /usr/X11/lib/X11/fontconfig/fonts.conf
So feel free to guess which one to use ;)
I believe that one should at least consider /usr/X11/lib/X11/fontconfig/fonts.conf & /usr/X11/lib/X11/fontconfig/conf.d/05-osx-fonts.conf in my case, but there is no "include the other file", so ConTeXt would actually have to start reading both.
fonts.conf should have something like:
<include ignore_missing="yes">conf.d</include>
Oh, sorry, that's right. I missed that one.
no? Here it does, otherwise fontconfig itself has no way of reading other files. But the whole thing is tricky, because the default path to the root fonts.conf file is set into libfontconfig at build time, ConTeXt has no way of knowing that, short of linking to libfontconfig.
The first two files are bundled with applications (Gimp, MPlayer) and aso have their own caches & their own settings, so when users start messing and configuring the system-wide settings, those two applications won't obey those anyway.
Which is very pointless, there should be only one fontconfig installed system wide, but that mac anyway :)
I might be wrong, but I tend to believe that Mac doesn't ship with fontconfig at all. Or rather, fontconfig is part of X11 only (which is part of OS X) and I've heard rumors that 10.8 doesn't ship with X11 by default. I believe it's the other way around: applications on Mac should not use fontconfig ;), but when they do (most of them being ported from linux), they cannot rely on fontconfig's presence on the system. It's more or less the same situation on windows. When you launch VLC, MPlayer, gnuplot/wxt or XeTeX after a long time, it spends the first minute refreshing font cache. Mojca
On Mon, Jul 30, 2012 at 11:16:44AM +0200, Mojca Miklavec wrote:
I believe it's the other way around: applications on Mac should not use fontconfig ;), but when they do (most of them being ported from linux), they cannot rely on fontconfig's presence on the system.
It's more or less the same situation on windows. When you launch VLC, MPlayer, gnuplot/wxt or XeTeX after a long time, it spends the first minute refreshing font cache.
Right, I think fontconfig should turn itself into a warper around native system font services on such systems and not manage a cache on its own, which is better than porting every fontconfig using application. OT anyway. Regards, Khaled
participants (6)
-
Bill Meahan
-
Hans Hagen
-
Khaled Hosny
-
Martin Rimmler
-
Mojca Miklavec
-
Wolfgang Schuster