ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* font lookup
@ 2010-04-05 21:52 Wolfgang Werners-Lucchini
  2010-04-05 22:05 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Werners-Lucchini @ 2010-04-05 21:52 UTC (permalink / raw)
  To: ntg-context

Hallo,

how can I find the complete path of a existing font 
with luatex under context mkiv. I am looking for an
equivalent function to

kpse.lookup(fontname)

Wolfgang
___________________________________________________________________________________
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] 6+ messages in thread

* Re: font lookup
  2010-04-05 21:52 font lookup Wolfgang Werners-Lucchini
@ 2010-04-05 22:05 ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2010-04-05 22:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 05.04.10 23:52, schrieb Wolfgang Werners-Lucchini:
> Hallo,
>
> how can I find the complete path of a existing font
> with luatex under context mkiv. I am looking for an
> equivalent function to
>
> kpse.lookup(fontname)
>    
Here is a solution which consults ConTeXt’s font database, no path
in the output means the font is stored in the TeX tree.

Example:

\define[1]\FontLookup
{\dolookupfontbyspec{#1}
\ifcase\dolookupnoffound
Font not found\par
\else
Path: \dolookupgetkey{filename}\par
\fi}

\starttext
\FontLookup{fontname=texgyrepagellaregular}
\FontLookup{fontname=texgyrepagellaoblique}
\FontLookup{fontname=timesnewromanpsmt}
\stoptext

Result (on my system):

Path: texgyrepagella-regular.otf
Font not found
Path: /Library/Fonts/Times New Roman.ttf

Wolfgang

___________________________________________________________________________________
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] 6+ messages in thread

* Re: font lookup
       [not found] <mailman.352.1270542660.4277.ntg-context@ntg.nl>
@ 2010-04-07 10:54 ` Wolfgang Werners-Lucchini
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Werners-Lucchini @ 2010-04-07 10:54 UTC (permalink / raw)
  To: ntg-context

> > When you know the filename, you can get the complete path like
> this:
> >
> > \starttext
> >
> \ctxlua{tex.print(resolvers.find_file("texgyrepagella-regular.otf"))
> }
> > \stoptext
> >    
> Your question is now answered but why do you need the complete
> path?
> 
> Wolfgang

I want to modify an example from Patrick (Eigenen Fontloader 
erstellen) in his blog. I hope I will learn a little from this.

Wolfgang
___________________________________________________________________________________
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] 6+ messages in thread

* Re: font lookup
  2010-04-06  5:20   ` Peter Münster
@ 2010-04-06  7:52     ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2010-04-06  7:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Wolfgang Werners-Lucchini

Am 06.04.10 07:20, schrieb Peter Münster:
> When you know the filename, you can get the complete path like this:
>
> \starttext
> \ctxlua{tex.print(resolvers.find_file("texgyrepagella-regular.otf"))}
> \stoptext
>    
Your question is now answered but why do you need the complete path?

Wolfgang

___________________________________________________________________________________
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] 6+ messages in thread

* Re: font lookup
  2010-04-06  0:24 ` Wolfgang Werners-Lucchini
@ 2010-04-06  5:20   ` Peter Münster
  2010-04-06  7:52     ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Münster @ 2010-04-06  5:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Apr 06 2010, Wolfgang Werners-Lucchini wrote:

> > Result (on my system):
> > 
> > Path: texgyrepagella-regular.otf
> 
> Hmm! How does context resolve the complete path afterwards?

Hello Wolfgang,

When you know the filename, you can get the complete path like this:

\starttext
\ctxlua{tex.print(resolvers.find_file("texgyrepagella-regular.otf"))}
\stoptext

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/


___________________________________________________________________________________
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] 6+ messages in thread

* Re: font lookup
       [not found] <mailman.347.1270506020.4277.ntg-context@ntg.nl>
@ 2010-04-06  0:24 ` Wolfgang Werners-Lucchini
  2010-04-06  5:20   ` Peter Münster
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Werners-Lucchini @ 2010-04-06  0:24 UTC (permalink / raw)
  To: ntg-context

Thank you Wolfgang,

> > how can I find the complete path of a existing font
> > with luatex under context mkiv. I am looking for an
> > equivalent function to
> >
> > kpse.lookup(fontname)
> >    
> Here is a solution which consults ConTeXt?s font database, no path
> in the output means the font is stored in the TeX tree.
> 
> Example:
> 
> \define[1]\FontLookup
> {\dolookupfontbyspec{#1}
> \ifcase\dolookupnoffound
> Font not found\par
> \else
> Path: \dolookupgetkey{filename}\par
> \fi}
> 
> \starttext
> \FontLookup{fontname=texgyrepagellaregular}
> \FontLookup{fontname=texgyrepagellaoblique}
> \FontLookup{fontname=timesnewromanpsmt}
> \stoptext
> 
> Result (on my system):
> 
> Path: texgyrepagella-regular.otf

Hmm! How does context resolve the complete path afterwards?

> Font not found
> Path: /Library/Fonts/Times New Roman.ttf

Isn't there a lua solution?

Wolfgang

___________________________________________________________________________________
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] 6+ messages in thread

end of thread, other threads:[~2010-04-07 10:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-05 21:52 font lookup Wolfgang Werners-Lucchini
2010-04-05 22:05 ` Wolfgang Schuster
     [not found] <mailman.347.1270506020.4277.ntg-context@ntg.nl>
2010-04-06  0:24 ` Wolfgang Werners-Lucchini
2010-04-06  5:20   ` Peter Münster
2010-04-06  7:52     ` Wolfgang Schuster
     [not found] <mailman.352.1270542660.4277.ntg-context@ntg.nl>
2010-04-07 10:54 ` Wolfgang Werners-Lucchini

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).