summaryrefslogtreecommitdiff
path: root/tex/context/base/lpdf-fld.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2011-01-26 11:02:00 +0100
committerHans Hagen <pragma@wxs.nl>2011-01-26 11:02:00 +0100
commitd537da741abd9c53eae3c2de8c1df68e448be2f0 (patch)
treee2e01ae428581a7c69f4b3cae5ecfacef4a76886 /tex/context/base/lpdf-fld.lua
parent4548239c47a4c08a0d019f370f641902b0b77abe (diff)
downloadcontext-d537da741abd9c53eae3c2de8c1df68e448be2f0.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