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

allow non-ascii bytes in cache file names #17

Closed
phi-gamma opened this issue Apr 28, 2013 · 7 comments
Closed

allow non-ascii bytes in cache file names #17

phi-gamma opened this issue Apr 28, 2013 · 7 comments

Comments

@phi-gamma
Copy link
Member

Here’s the original report: http://tug.org/pipermail/lualatex-dev/2013-April/001499.html

Intuitively I’d opt for replacing the functions by their equivalents from the unicode library, but they cause strange output on my system:

#!/usr/bin/env texlua

local gsub, lower = unicode.utf8.gsub, unicode.utf8.lower

local non_ascii_names = {
  [[华文仿宋.ttf]], [[华文细黑.ttf]], [[华文黑体.ttf]],
}

for i = 1, #non_ascii_names do
  local name = non_ascii_names[i]
  print("[a]", name, string.gsub(string.lower(name), "[^%w%d\128-\255]+","-"))
  print("[b]", name, gsub(lower(name), "[^%w%d]+","-"))
end

From which I get:
....
华文仿宋.ttf å-æ-ä-å-ttf
....

So for now I’m in favor of applying the patch by Dohyun Kim to v1, whereas for the dev version I’ll ask Hans first (data-con.lua is entirely his own territory).

You can also put it as an override in luaotfload.lua somewhere after data-con.lua is loaded, somewhere around the location where attribute[0] is set.

@eroux
Copy link
Member

eroux commented Apr 28, 2013

Ok for v1. Also, is ttc correctly handled by v1 or should we wait for v2.2 to remove the ttc from the blacklist?

@phi-gamma
Copy link
Member Author

If it’s true, just go ahead and remove it. I can’t really test it myself for lack of a specimen.

@phi-gamma
Copy link
Member Author

It’s now applied with the new master.

I think I can test one ttc later today.

@eroux
Copy link
Member

eroux commented Apr 28, 2013

The bug is interesting... maybe it should be reported to the maintainers of the unicode library? By the way, I'll build a svn fontforge today and if it still fails with lingoes, I'll report it.

@eroux
Copy link
Member

eroux commented Apr 28, 2013

It seems that my debian stable is outdated for fontforge building, I'll report it anyway...

@phi-gamma
Copy link
Member Author

I tested Cambria.ttc (with 2 subfonts) and it should be fine.

Also, I connected the dots and I believe I know now who the ominous Kim was that the subfont rule in the original request parser was dedicated to (grep for subvalue in otfl-font-xtx.lua). Now that we apparently have a confirmed ttc user I also added this rule again to the new syntax parser. There will also be test file for ttc/subfonts.

@phi-gamma
Copy link
Member Author

Fixed in upstream: phi-gamma@ed0cde7

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

No branches or pull requests

2 participants