Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

filter symlinks to avoid duplicate entries in the database ? #359

Closed
jfbu opened this issue May 14, 2016 · 3 comments
Closed

filter symlinks to avoid duplicate entries in the database ? #359

jfbu opened this issue May 14, 2016 · 3 comments
Labels

Comments

@jfbu
Copy link

jfbu commented May 14, 2016

This is both a question and perhaps a suggestion.

I am on Mac OS X and for reasons unrelated to LuaLaTeX/luaotfload, I needed to add symlinks to my ~/Library/Fonts to my TeXLive opentype and truetype repertories.

Then I did luaotfload-tool -fu -vvv and it ends up with

luaotfload | db : Fonts in the database: 3038
luaotfload | util : Task completed successfully.

to be compared to the earlier situation

luaotfload | db : Fonts in the database: 1788
luaotfload | util : Task completed successfully.

I checked in the /usr/local/texlive/2016/texmf-var/luatex-cache/generic/names/luaotfload-names.lua.gz and I find there (as expected) entries which point to the same physical location:

   ["basename"]="texgyretermes-regular.otf",
   ["familyname"]="texgyretermes",
   ["fontname"]="texgyretermesregular",
   ["format"]="otf",
   ["fullname"]="texgyretermesregular",
   ["fullpath"]="/usr/local/texlive/2016/texmf-dist/fonts/opentype/public/tex-gyre/texgyretermes-regular.otf",
   ["index"]=992,
...

and

   ["basename"]="texgyretermes-regular.otf",
   ["familyname"]="texgyretermes",
   ["fontname"]="texgyretermesregular",
   ["format"]="otf",
   ["fullname"]="texgyretermesregular",
   ["fullpath"]="/Users/XXXXX/Library/Fonts/TeXOpenTypeFonts/public/tex-gyre/texgyretermes-regular.otf",
   ["index"]=1616,
...

The second path is in fact the same as the first, ~/Library/Fonts/TeXOpenTypeFonts being a symlink.

My question is twofold: will this slow-down LuaTeX ? if yes, is there a way during database construction to filter out paths if they point to the same file ?

@jfbu
Copy link
Author

jfbu commented May 14, 2016

I meant "if they point to the same absolute path location".

phi-gamma added a commit to phi-gamma/luaotfload that referenced this issue Jun 8, 2016
Addresses lualatex#359 and lualatex#325

To avoid duplicate entries, paths have to be resolved before collecting
them. This necessitates loop detection of some sort, currently
implemented naively as a flat table containing the directories already
traversed.
@phi-gamma phi-gamma added the bug label Jun 16, 2016
@phi-gamma phi-gamma reopened this Jun 16, 2016
@jfbu
Copy link
Author

jfbu commented Jun 18, 2016

Now I get from same set-up (with symlinks in $HOME/Library/Fonts to TeXLive opentype and truetype repertories):

luaotfload | db : Fonts in the database: 1797
luaotfload | util : Task completed successfully.

and not the earlier 3038. Thanks for the added feature !

@phi-gamma
Copy link
Member

···<date: 2016-06-18, Saturday>···<from: Jean-François B.>···

Now I get from same set-up (with symlinks in $HOME/Library/Fonts to TeXLive opentype and truetype repertories):

luaotfload | db : Fonts in the database: 1797
luaotfload | util : Task completed successfully.

and not the earlier 3038. Thanks for the added feature !

No problem, I consider this a bugfix.

Best,
Philipp

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants