ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Ulrike Fischer <news3@nililand.de>
To: ntg-context@ntg.nl
Subject: Re: font pathes with colons
Date: Mon, 11 Jun 2018 18:35:22 +0200	[thread overview]
Message-ID: <s940qf7x5157$.dlg@nililand.de> (raw)
In-Reply-To: <0f587016-e628-0ac9-0ce6-666d0c4e0b01@xs4all.nl>

Am Sun, 10 Jun 2018 13:24:40 +0200 schrieb Hans Hagen:

> i changed the parser for generic a bit so you need to check careful next 
> beta as i'm only testing some basic plain loading

It broke ;-(

luaotfload complained about a missing registersplit,
then about a missing addspecifier, so I reinserted from the previous
version (from UF to /UF) (around line 32865)

local resolvefile=fontgoodies and fontgoodies.filenames and
fontgoodies.filenames.resolve or function(s) return s end
-- UF
local splitter,splitspecifiers=nil,""
local P,C,S,Cc,Cs=lpeg.P,lpeg.C,lpeg.S,lpeg.Cc,lpeg.Cs
local left=P("(")
local right=P(")")
local colon=P(":")
local space=P(" ")
local lbrace=P("{")
local rbrace=P("}")
definers.defaultlookup="file"
local prefixpattern=P(false)
local function addspecifier(symbol)
  splitspecifiers=splitspecifiers..symbol
  local method=S(splitspecifiers)
  local lookup=C(prefixpattern)*colon
  local sub=left*C(P(1-left-right-method)^1)*right
  local specification=C(method)*C(P(1)^1)
  local
name=Cs((lbrace/"")*(1-rbrace)^1*(rbrace/"")+(1-sub-specification)^1)

splitter=P((lookup+Cc(""))*name*(sub+Cc(""))*(specification+Cc("")))
end
local function addlookup(str,default)
  prefixpattern=prefixpattern+P(str)
end
definers.addlookup=addlookup
addlookup("file")
addlookup("name")
addlookup("spec")
local function getspecification(str)
  return lpegmatch(splitter,str or "")
end
definers.getspecification=getspecification
function definers.registersplit(symbol,action,verbosename)
  addspecifier(symbol)
  variants[symbol]=action
  if verbosename then
    variants[verbosename]=action
  end
end
-- /UF


Then it complained about a missing upvalue getthreshold so I
reinserted:

local getthreshold
--UF
injections.threshold=0
getthreshold=function(font)
    local p=fontdata[font].parameters
    local f=p.factor
    local s=p.spacing
    local t=injections.threshold*(s and s.width or p.space or 0)-2
    return t>0 and t or 0,f
end
--/UF


Now it works again and also the "unknown option" warning is gone. 


> i have no clue how otfload locates files but maybe you need to add an 
> entry to
> 
> local remapper = {
>      otf    = "opentype fonts",
>      ttf    = "truetype fonts",
>      ttc    = "truetype fonts",
>      cid    = "cid maps",
>      cidmap = "cid maps",
>   -- fea    = "font feature files", -- no longer supported
>      pfb    = "type1 fonts",        -- needed for vector loading
>      afm    = "afm",
>      enc    = "enc files",
>      lua    = "tex", -- LIKE THIS
> }

     lua    = "misc fonts", 
would be better (then one can put the fonts in fonts/misc. 

But it doesn't help with the main problem that luaotfload calls
resolvers.findfile first for "basename + otf, tfm, ofm", then
triggers a rebuild of the database and only then calls
resolvers.findfile again with the fullname.

Also I really want to avoid to patch the merged code. I'm regularly
getting the newest version from context and try out if it still
works and prefer if I can use them unchanged.  

-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2018-06-11 16:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08 21:51 Ulrike Fischer
2018-06-09  9:52 ` Hans Hagen
2018-06-09 21:34   ` Ulrike Fischer
2018-06-10 10:42     ` Hans Hagen
2018-06-10 10:58       ` Ulrike Fischer
2018-06-10 11:24         ` Hans Hagen
2018-06-11 16:35           ` Ulrike Fischer [this message]
2018-06-13 11:55           ` Ulrike Fischer
2018-06-13 13:57             ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='s940qf7x5157$.dlg@nililand.de' \
    --to=news3@nililand.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).