diff options
author | Yan Zhou <zhouyan@users.noreply.github.com> | 2017-02-02 02:00:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-02 02:00:34 +0800 |
commit | 0fd89868855c3c7038fcc736b0448b7f6e8c8662 (patch) | |
tree | 58eb5ccc57e774a980158638fbd246b8a79a6b21 | |
parent | 08060160fcde7a2f07fbf10260d3d2efe155f6c0 (diff) | |
download | luaotfload-0fd89868855c3c7038fcc736b0448b7f6e8c8662.tar.gz |
Fix calculation of database optical sizes
The conversion from reported design size etc., to "true `sp` value" is actually converting from `bp` to `pt`.
-rw-r--r-- | src/luaotfload-database.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua index 4a71d34..5e4fd7a 100644 --- a/src/luaotfload-database.lua +++ b/src/luaotfload-database.lua @@ -1049,8 +1049,8 @@ do --- cf. TeXbook p. 57 local dimens = { pt = function (v) return v end, - bp = function (v) return (v * 7200) / 7227 end, - dd = function (v) return (v * 1157) / 1238 end, + bp = function (v) return (v * 7227) / 7200 end, + dd = function (v) return (v * 1238) / 1157 end, } design_size_dimension = dimens.bp @@ -1367,9 +1367,9 @@ local get_size_info do --- too many upvalues :/ design_range_top = ((design_range_top or fallback_size) * 2^16) / 10 design_range_bottom = ((design_range_bottom or fallback_size) * 2^16) / 10 - design_size = (design_size * 7200) / 7227 - design_range_top = (design_range_top * 7200) / 7227 - design_range_bottom = (design_range_bottom * 7200) / 7227 + design_size = (design_size * 7227) / 7200 + design_range_top = (design_range_top * 7227) / 7200 + design_range_bottom = (design_range_bottom * 7227) / 7200 return { design_size, design_range_top, design_range_bottom, |