summaryrefslogtreecommitdiff
path: root/tex/context/base/lpdf-fld.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-01-31 00:37:26 +0200
committerMarius <mariausol@gmail.com>2011-01-31 00:37:26 +0200
commitcf65f174d2b790545f27134a5d41d39c942a1d5b (patch)
tree1d4ecf3edd2608aaeefaca5dc400592fcedabbf7 /tex/context/base/lpdf-fld.lua
parent4d9822eafe9e74e63e1f970e3cdf29d0f3b2cdd5 (diff)
downloadcontext-cf65f174d2b790545f27134a5d41d39c942a1d5b.tar.gz
beta 2011.01.26 11:02
Diffstat (limited to 'tex/context/base/lpdf-fld.lua')
-rw-r--r--tex/context/base/lpdf-fld.lua26
1 files changed, 16 insertions, 10 deletions
diff --git a/tex/context/base/lpdf-fld.lua b/tex/context/base/lpdf-fld.lua
index 969383595..79b184e9a 100644
--- a/tex/context/base/lpdf-fld.lua
+++ b/tex/context/base/lpdf-fld.lua
@@ -184,25 +184,31 @@ local fontnames = {
local usedfonts = { }
local function fieldsurrounding(specification)
- local size = specification.fontsize or "12pt"
- local style = specification.fontstyle or "rm"
- local alternative = specification.fontalternative or "tf"
- local s = fontnames[style]
+ local fontsize = specification.fontsize or "12pt"
+ local fontstyle = specification.fontstyle or "rm"
+ local fontalternative = specification.fontalternative or "tf"
+ local colorvalue = specification.colorvalue
+ local s = fontnames[fontstyle]
if not s then
- style, s = "rm", fontnames.rm
+ fontstyle, s = "rm", fontnames.rm
end
- local a = s[alternative]
+ local a = s[fontalternative]
if not a then
alternative, a = "tf", s.tf
end
- local tag = style .. alternative
- size = todimen(size)
+ local tag = fontstyle .. fontalternative
+ fontsize = todimen(fontsize)
+ local fontcode = format("%0.4f Tf",(fontsize and (bpfactor * fontsize)) or 12)
+ local colorcode = lpdf.color(3,colorvalue) -- we force an rgb color space
+ if trace_fields then
+ report_fields("fontcode : %s %s @ %s => %s => %s",fontstyle,fontalternative,fontsize,tag,fontcode)
+ report_fields("colorcode: %s => %s",colorvalue,colorcode)
+ end
local stream = pdfstream {
pdfconstant(tag),
- format("%0.4f Tf",(size and (bpfactor * size)) or 12),
+ format("%s %s",fontcode,colorcode)
}
usedfonts[tag] = a -- the name
- -- add color to stream: 0 g
-- move up with "x.y Ts"
return tostring(stream)
end