diff options
| author | Khaled Hosny <khaledhosny@eglug.org> | 2010-02-02 22:05:24 +0200 | 
|---|---|---|
| committer | Khaled Hosny <khaledhosny@eglug.org> | 2010-02-02 22:05:24 +0200 | 
| commit | 34774e11c1d67860db9cc6812af49c1df1761eb6 (patch) | |
| tree | 07574afa14cc1d87151b603c161e07e43f4ca8ff | |
| parent | f71ad8a240a7816cc86b7fa16110fbb62c484b1d (diff) | |
| download | luaotfload-34774e11c1d67860db9cc6812af49c1df1761eb6.tar.gz | |
Support design size ranges
| -rw-r--r-- | otfl-font-dum.lua | 13 | 
1 files changed, 6 insertions, 7 deletions
diff --git a/otfl-font-dum.lua b/otfl-font-dum.lua index 2bcc8ef..2cc8aeb 100644 --- a/otfl-font-dum.lua +++ b/otfl-font-dum.lua @@ -86,15 +86,14 @@ function fonts.names.resolve(specification)                  for _,v in ipairs(family) do                     local face      = data.mappings[v]                     local subfamily = face.names.subfamily -                   local dsize     = face.size[1] and face.size[1] / 10 -                   local ssize     = specification.size and specification.size / 65536 -                   local osize     = tonumber(specification.optsize) -                   local maxsize   = face.design_range_bottom -                   local minsize   = face.design_range_top +                   local rqssize   = tonumber(specification.optsize) or specification.size and specification.size / 65536 +                   local dsnsize   = face.size[1] and face.size[1] / 10 +                   local maxsize   = face.size[2] and face.size[2] / 10 +                   local minsize   = face.size[3] and face.size[3] / 10                     local filename  = face.filename                     if subfamily then                         if sanitize(subfamily) == style then -                           if not dsize or dsize == osize or dsize == ssize then +                           if not dsnsize or dsnsize == rqssize or (rqssize > minsize and rqssize <= maxsize) then                                 found = filename                                 break                             end @@ -102,7 +101,7 @@ function fonts.names.resolve(specification)                             if synonyms[style] then                                 for _,v in ipairs(synonyms[style]) do                                     if sanitize(subfamily) == v then -                                       if not dsize or dsize == osize or dsize == ssize then +                                       if not dsnsize or dsnsize == rqssize or (rqssize > minsize and rqssize <= maxsize) then                                              found = filename                                              break                                         end  | 
