ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [fonts] Why does ConTeXt keep telling me "source file is not found" ?
@ 2015-10-25 11:20 Goulven Guillard
  2015-10-28  8:43 ` luigi scarso
  0 siblings, 1 reply; 4+ messages in thread
From: Goulven Guillard @ 2015-10-25 11:20 UTC (permalink / raw)
  To: ntg-context

Hi,

I can't seem to make ConTeXt work with system fonts.  Let's take this 
simple example :

---------------------------------------------------------------------
\usemodule[simplefonts][size=12pt]
\setmainfont[liberationsans]
\starttext
Test text
\stoptext
---------------------------------------------------------------------

It won't compile :

---------------------------------------------------------------------
$ context aa.tex

mtx-context     | run 1: luatex 
--fmt="/opt/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en" 
--jobname="aa" 
--lua="/opt/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui" 
--no-parse-first-line --c:currentrun=1 --c:fulljobname="./aa" 
--c:input="./aa" --c:kindofrun=1 --c:maxnofruns=9 "cont-yes.mkiv"
This is LuaTeX, Version beta-0.81.0 (TeX Live 2016/dev) (rev 5350)
  \write18 enabled.

system          > callbacks > not registering frozen 'find_format_file'
open source     > 1 > 1 > 
/opt/context/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2015.10.09 21:28 MKIV beta  fmt: 2015.10.21  int: 
english/english

system          > 'cont-new.mkiv' loaded
open source     > 2 > 2 > 
/opt/context/tex/texmf-context/tex/context/base/cont-new.mkiv
close source    > 2 > 2 > 
/opt/context/tex/texmf-context/tex/context/base/cont-new.mkiv
system          > files > jobname 'aa', input './aa', result 'aa'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
open source     > 2 > 3 > /data/LédiFrance/catalogues/automatic/aa.tex
resolvers       > modules > 'simplefonts' is loaded
open source     > 3 > 4 > 
/opt/context/tex/texmf-modules/tex/context/third/simplefonts/t-simplefonts.mkiv
loading         > ConTeXt User Module / Simplefonts
resolvers       > lua > loading file 
'/opt/context/tex/texmf-modules/tex/context/third/simplefonts/t-simplefonts.lua' 
succeeded
close source    > 3 > 4 > 
/opt/context/tex/texmf-modules/tex/context/third/simplefonts/t-simplefonts.mkiv
fonts           > defining > source file 'LiberationSans-Regular.ttf' is 
not found
backend         > xmp > using file 
'/opt/context/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pages           > flushing realpage 1, userpage 1
close source    > 2 > 4 > /data/LédiFrance/catalogues/automatic/aa.tex
close source    > 1 > 4 > 
/opt/context/tex/texmf-context/tex/context/base/cont-yes.mkiv

!LuaTeX error: cannot find OpenType font file for reading ()
  ==> Fatal error occurred, no output PDF file produced!

mtx-context     | fatal error: return code: 1
---------------------------------------------------------------------

If I understand correctly, it fails on `defining > source file 
'LiberationSans-Regular.ttf' is not found`.  Yet said file is found by 
`mtx-run` (and has read access for all) :

---------------------------------------------------------------------
$ mtxrun --script fonts --list --all --pattern=Liberation

liberationmono              liberationmono 
/usr/share/fonts/liberation/LiberationMono-Regular.ttf
liberationmonobold          liberationmonobold 
/usr/share/fonts/liberation/LiberationMono-Bold.ttf
liberationmonobolditalic    liberationmonobolditalic 
/usr/share/fonts/liberation/LiberationMono-BoldItalic.ttf
liberationmonoitalic        liberationmonoitalic 
/usr/share/fonts/liberation/LiberationMono-Italic.ttf
liberationmononormal        liberationmono 
/usr/share/fonts/liberation/LiberationMono-Regular.ttf
liberationmonoregular       liberationmono 
/usr/share/fonts/liberation/LiberationMono-Regular.ttf
liberationsans              liberationsans 
/usr/share/fonts/liberation/LiberationSans-Regular.ttf
liberationsansbold          liberationsansbold 
/usr/share/fonts/liberation/LiberationSans-Bold.ttf
liberationsansbolditalic    liberationsansbolditalic 
/usr/share/fonts/liberation/LiberationSans-BoldItalic.ttf
liberationsansitalic        liberationsansitalic 
/usr/share/fonts/liberation/LiberationSans-Italic.ttf
liberationsansnormal        liberationsans 
/usr/share/fonts/liberation/LiberationSans-Regular.ttf
liberationsansregular       liberationsans 
/usr/share/fonts/liberation/LiberationSans-Regular.ttf
liberationserif             liberationserif 
/usr/share/fonts/liberation/LiberationSerif-Regular.ttf
liberationserifbold         liberationserifbold 
/usr/share/fonts/liberation/LiberationSerif-Bold.ttf
liberationserifbolditalic   liberationserifbolditalic 
/usr/share/fonts/liberation/LiberationSerif-BoldItalic.ttf
liberationserifitalic       liberationserifitalic 
/usr/share/fonts/liberation/LiberationSerif-Italic.ttf
liberationserifnormal       liberationserif 
/usr/share/fonts/liberation/LiberationSerif-Regular.ttf
liberationserifregular      liberationserif 
/usr/share/fonts/liberation/LiberationSerif-Regular.ttf
---------------------------------------------------------------------

I asked this question here : 
http://tex.stackexchange.com/questions/274582/why-does-context-keep-telling-me-source-file-is-not-found/274818

I got a reply suggesting that font management had changed and that this 
sample should work :

---------------------------------------------------------------------
\definefontfamily [test] [sans] [Liberation Sans]
\setupbodyfont [test,ss,12pt]
\starttext
Test text
\stoptext
---------------------------------------------------------------------

However this lead to exactly the same error as the previous sample.

What am I missing ?

Regards,

Goulven.

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [fonts] Why does ConTeXt keep telling me "source file is not found" ?
  2015-10-25 11:20 [fonts] Why does ConTeXt keep telling me "source file is not found" ? Goulven Guillard
@ 2015-10-28  8:43 ` luigi scarso
  2015-10-28  9:57   ` Goulven Guillard
  0 siblings, 1 reply; 4+ messages in thread
From: luigi scarso @ 2015-10-28  8:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 6026 bytes --]

On Sun, Oct 25, 2015 at 12:20 PM, Goulven Guillard <
lecotegougdelaforce@free.fr> wrote:

> Hi,
>
> I can't seem to make ConTeXt work with system fonts.  Let's take this
> simple example :
>
> ---------------------------------------------------------------------
> \usemodule[simplefonts][size=12pt]
> \setmainfont[liberationsans]
> \starttext
> Test text
> \stoptext
> ---------------------------------------------------------------------
>
> It won't compile :
>
> ---------------------------------------------------------------------
> $ context aa.tex
>
> mtx-context     | run 1: luatex
> --fmt="/opt/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
> --jobname="aa"
> --lua="/opt/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
> --no-parse-first-line --c:currentrun=1 --c:fulljobname="./aa"
> --c:input="./aa" --c:kindofrun=1 --c:maxnofruns=9 "cont-yes.mkiv"
> This is LuaTeX, Version beta-0.81.0 (TeX Live 2016/dev) (rev 5350)
>  \write18 enabled.
>
> system          > callbacks > not registering frozen 'find_format_file'
> open source     > 1 > 1 >
> /opt/context/tex/texmf-context/tex/context/base/cont-yes.mkiv
>
> ConTeXt  ver: 2015.10.09 21:28 MKIV beta  fmt: 2015.10.21  int:
> english/english
>
> system          > 'cont-new.mkiv' loaded
> open source     > 2 > 2 >
> /opt/context/tex/texmf-context/tex/context/base/cont-new.mkiv
> close source    > 2 > 2 >
> /opt/context/tex/texmf-context/tex/context/base/cont-new.mkiv
> system          > files > jobname 'aa', input './aa', result 'aa'
> fonts           > latin modern fonts are not preloaded
> languages       > language 'en' is active
> open source     > 2 > 3 > /data/LédiFrance/catalogues/automatic/aa.tex
> resolvers       > modules > 'simplefonts' is loaded
> open source     > 3 > 4 >
> /opt/context/tex/texmf-modules/tex/context/third/simplefonts/t-simplefonts.mkiv
> loading         > ConTeXt User Module / Simplefonts
> resolvers       > lua > loading file
> '/opt/context/tex/texmf-modules/tex/context/third/simplefonts/t-simplefonts.lua'
> succeeded
> close source    > 3 > 4 >
> /opt/context/tex/texmf-modules/tex/context/third/simplefonts/t-simplefonts.mkiv
> fonts           > defining > source file 'LiberationSans-Regular.ttf' is
> not found
> backend         > xmp > using file
> '/opt/context/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
> pages           > flushing realpage 1, userpage 1
> close source    > 2 > 4 > /data/LédiFrance/catalogues/automatic/aa.tex
> close source    > 1 > 4 >
> /opt/context/tex/texmf-context/tex/context/base/cont-yes.mkiv
>
> !LuaTeX error: cannot find OpenType font file for reading ()
>  ==> Fatal error occurred, no output PDF file produced!
>
> mtx-context     | fatal error: return code: 1
> ---------------------------------------------------------------------
>
> If I understand correctly, it fails on `defining > source file
> 'LiberationSans-Regular.ttf' is not found`.  Yet said file is found by
> `mtx-run` (and has read access for all) :
>
> ---------------------------------------------------------------------
> $ mtxrun --script fonts --list --all --pattern=Liberation
>
> liberationmono              liberationmono
> /usr/share/fonts/liberation/LiberationMono-Regular.ttf
> liberationmonobold          liberationmonobold
> /usr/share/fonts/liberation/LiberationMono-Bold.ttf
> liberationmonobolditalic    liberationmonobolditalic
> /usr/share/fonts/liberation/LiberationMono-BoldItalic.ttf
> liberationmonoitalic        liberationmonoitalic
> /usr/share/fonts/liberation/LiberationMono-Italic.ttf
> liberationmononormal        liberationmono
> /usr/share/fonts/liberation/LiberationMono-Regular.ttf
> liberationmonoregular       liberationmono
> /usr/share/fonts/liberation/LiberationMono-Regular.ttf
> liberationsans              liberationsans
> /usr/share/fonts/liberation/LiberationSans-Regular.ttf
> liberationsansbold          liberationsansbold
> /usr/share/fonts/liberation/LiberationSans-Bold.ttf
> liberationsansbolditalic    liberationsansbolditalic
> /usr/share/fonts/liberation/LiberationSans-BoldItalic.ttf
> liberationsansitalic        liberationsansitalic
> /usr/share/fonts/liberation/LiberationSans-Italic.ttf
> liberationsansnormal        liberationsans
> /usr/share/fonts/liberation/LiberationSans-Regular.ttf
> liberationsansregular       liberationsans
> /usr/share/fonts/liberation/LiberationSans-Regular.ttf
> liberationserif             liberationserif
> /usr/share/fonts/liberation/LiberationSerif-Regular.ttf
> liberationserifbold         liberationserifbold
> /usr/share/fonts/liberation/LiberationSerif-Bold.ttf
> liberationserifbolditalic   liberationserifbolditalic
> /usr/share/fonts/liberation/LiberationSerif-BoldItalic.ttf
> liberationserifitalic       liberationserifitalic
> /usr/share/fonts/liberation/LiberationSerif-Italic.ttf
> liberationserifnormal       liberationserif
> /usr/share/fonts/liberation/LiberationSerif-Regular.ttf
> liberationserifregular      liberationserif
> /usr/share/fonts/liberation/LiberationSerif-Regular.ttf
>



hm, strange. In Ubuntu 14.04:


$ ls  /usr/share/fonts/
cmap  truetype  type1  X11

and liberation is under truetype

/usr/share/fonts/truetype/liberation:

/usr/share/fonts/truetype/liberation:
LiberationMono-BoldItalic.ttf
LiberationMono-Bold.ttf
LiberationMono-Italic.ttf
LiberationMono-Regular.ttf
LiberationSans-BoldItalic.ttf
LiberationSans-Bold.ttf
LiberationSans-Italic.ttf
LiberationSansNarrow-BoldItalic.ttf
LiberationSansNarrow-Bold.ttf
LiberationSansNarrow-Italic.ttf
LiberationSansNarrow-Regular.ttf
LiberationSans-Regular.ttf
LiberationSerif-BoldItalic.ttf
LiberationSerif-Bold.ttf
LiberationSerif-Italic.ttf
LiberationSerif-Regular.ttf

what does
ls  /usr/share/fonts/liberation/LiberationSans-Regular.ttf
say ?

-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 7390 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [fonts] Why does ConTeXt keep telling me "source file is not found" ?
  2015-10-28  8:43 ` luigi scarso
@ 2015-10-28  9:57   ` Goulven Guillard
  2015-10-28 10:22     ` luigi scarso
  0 siblings, 1 reply; 4+ messages in thread
From: Goulven Guillard @ 2015-10-28  9:57 UTC (permalink / raw)
  To: ntg-context

Le 28/10/2015 09:43, luigi scarso a écrit :
> hm, strange. In Ubuntu 14.04:

FWIW, I'm using Fedora 20.


> what does
> ls  /usr/share/fonts/liberation/LiberationSans-Regular.ttf
> say ?

$ ls -l /usr/share/fonts/liberation/LiberationSans-Regular.ttf
-rw-r--r--. 1 root root 139632 28 août   2013 
/usr/share/fonts/liberation/LiberationSans-Regular.ttf

Actually it seems the issue is with kpsepath not searching fonts files 
recursively.  I tried to set OSFONTDIR="/usr/share/fonts//" (with two 
trailing slashes — I even tried more…) but it didn't help, though 
kpsewhich --var-value=OSFONTDIR gives the expected path.

I've ended linking all fonts directly in $HOME/.fonts/, but of course a 
cleaner solution would still be welcome.

Regards,

Goulven.


___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [fonts] Why does ConTeXt keep telling me "source file is not found" ?
  2015-10-28  9:57   ` Goulven Guillard
@ 2015-10-28 10:22     ` luigi scarso
  0 siblings, 0 replies; 4+ messages in thread
From: luigi scarso @ 2015-10-28 10:22 UTC (permalink / raw)
  To: lecotegougdelaforce, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 4107 bytes --]

On Wed, Oct 28, 2015 at 10:57 AM, Goulven Guillard <
lecotegougdelaforce@free.fr> wrote:

> Le 28/10/2015 09:43, luigi scarso a écrit :
>
>> hm, strange. In Ubuntu 14.04:
>>
>
> FWIW, I'm using Fedora 20.
>
>
> what does
>> ls  /usr/share/fonts/liberation/LiberationSans-Regular.ttf
>> say ?
>>
>
> $ ls -l /usr/share/fonts/liberation/LiberationSans-Regular.ttf
> -rw-r--r--. 1 root root 139632 28 août   2013
> /usr/share/fonts/liberation/LiberationSans-Regular.ttf
>
>
ok



> Actually it seems the issue is with kpsepath not searching fonts files
> recursively.  I tried to set OSFONTDIR="/usr/share/fonts//" (with two
> trailing slashes — I even tried more…) but it didn't help, though kpsewhich
> --var-value=OSFONTDIR gives the expected path.
>
> I've ended linking all fonts directly in $HOME/.fonts/, but of course a
> cleaner solution would still be welcome.
>
>
>

hm mkiv doesn't use  kpsepath.

Assuming that you are in yor context tree
(/opt/contex, if I read correctly)
make a symlink of /usr/share/fonts/liberation
under tex/texmf-local
so that
tex/texmf-local/liberation
has the ttf fonts.

Then, to be sure,
$ mtxrun --generate

compile this file  test.tex

\usetypescript[liberation]
\setupbodyfont[liberation,12pt]
\starttext
Test text
\stoptext

$ context test.tex


and check  it with
$ pdffonts test.pdf
name                                 type              encoding         emb
sub uni object ID
------------------------------------ ----------------- ---------------- ---
--- --- ---------
CJLCWM+LiberationSerif               CID TrueType      Identity-H       yes
yes yes     16  0

Again
$ mtxrun --script fonts --list --all --pattern=Liberation



liberationmono                   liberationmono
LiberationMono-Regular.ttf
liberationmonobold               liberationmonobold
LiberationMono-Bold.ttf
liberationmonobolditalic         liberationmonobolditalic
LiberationMono-BoldItalic.ttf
liberationmonoitalic             liberationmonoitalic
LiberationMono-Italic.ttf
liberationmononormal             liberationmonoitalic
LiberationMono-Italic.ttf
liberationmonoregular            liberationmono
LiberationMono-Regular.ttf
liberationsans                   liberationsans
LiberationSans-Regular.ttf
liberationsansbold               liberationsansbold
LiberationSans-Bold.ttf
liberationsansbolditalic         liberationsansbolditalic
LiberationSans-BoldItalic.ttf
liberationsansitalic             liberationsansitalic
LiberationSans-Italic.ttf
liberationsansnarrow             liberationsansnarrow
LiberationSansNarrow-Regular.ttf
liberationsansnarrowbold         liberationsansnarrowbold
LiberationSansNarrow-Bold.ttf
liberationsansnarrowbolditalic   liberationsansnarrowbolditalic
LiberationSansNarrow-BoldItalic.ttf
liberationsansnarrowitalic       liberationsansnarrowitalic
LiberationSansNarrow-Italic.ttf
liberationsansnarrownormal       liberationsansnarrowitalic
LiberationSansNarrow-Italic.ttf
liberationsansnarrowregular      liberationsansnarrow
LiberationSansNarrow-Regular.ttf
liberationsansnormal             liberationsansitalic
LiberationSans-Italic.ttf
liberationsansregular            liberationsans
LiberationSans-Regular.ttf
liberationserif                  liberationserif
 LiberationSerif-Regular.ttf
liberationserifbold              liberationserifbold
 LiberationSerif-Bold.ttf
liberationserifbolditalic        liberationserifbolditalic
 LiberationSerif-BoldItalic.ttf
liberationserifitalic            liberationserifitalic
 LiberationSerif-Italic.ttf
liberationserifnormal            liberationserifitalic
 LiberationSerif-Italic.ttf
liberationserifregular           liberationserif
 LiberationSerif-Regular.ttf


In tex/context/base
there are several typescript files
type-imp*mkiv
you can have a look at them.

This is my way to use system font: just copy them into context.
A symlink or a true copy both have pros & cons, but I tend to prefer true
copy
(really, I try to avoid system fonts at all).


-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 6630 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-28 10:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-25 11:20 [fonts] Why does ConTeXt keep telling me "source file is not found" ? Goulven Guillard
2015-10-28  8:43 ` luigi scarso
2015-10-28  9:57   ` Goulven Guillard
2015-10-28 10:22     ` luigi scarso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).