summaryrefslogtreecommitdiff
path: root/src/fontloader/misc/fontloader-font-con.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2015-04-13 00:11:28 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2015-04-13 00:11:28 +0200
commitd843b6cca2d31197c6d416293bce344c911fbbfb (patch)
treedf706772746ccce95f668d840028ab280307b477 /src/fontloader/misc/fontloader-font-con.lua
parentf56b879cebfc6e9d1c67a8da6013777e7379c185 (diff)
downloadluaotfload-d843b6cca2d31197c6d416293bce344c911fbbfb.tar.gz
[fontloader] sync with Context as of 2015-04-13
Diffstat (limited to 'src/fontloader/misc/fontloader-font-con.lua')
-rw-r--r--src/fontloader/misc/fontloader-font-con.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/fontloader/misc/fontloader-font-con.lua b/src/fontloader/misc/fontloader-font-con.lua
index bb96912..72fbb5c 100644
--- a/src/fontloader/misc/fontloader-font-con.lua
+++ b/src/fontloader/misc/fontloader-font-con.lua
@@ -507,6 +507,7 @@ function constructors.scale(tfmdata,specification)
local nonames = properties.noglyphnames
local haskerns = properties.haskerns or properties.mode == "base" -- we can have afm in node mode
local hasligatures = properties.hasligatures or properties.mode == "base" -- we can have afm in node mode
+ local realdimensions = properties.realdimensions
--
if changed and not next(changed) then
changed = false
@@ -618,6 +619,27 @@ function constructors.scale(tfmdata,specification)
local width = description.width
local height = description.height
local depth = description.depth
+ if realdimensions then
+ -- this is mostly for checking issues
+ if not height or height == 0 then
+ local bb = description.boundingbox
+ local ht = bb[4]
+ if ht ~= 0 then
+ height = ht
+ end
+ if not depth or depth == 0 then
+ local dp = -bb[2]
+ if dp ~= 0 then
+ depth = dp
+ end
+ end
+ elseif not depth or depth == 0 then
+ local dp = -description.boundingbox[2]
+ if dp ~= 0 then
+ depth = dp
+ end
+ end
+ end
if width then width = hdelta*width else width = scaledwidth end
if height then height = vdelta*height else height = scaledheight end
-- if depth then depth = vdelta*depth else depth = scaleddepth end