aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2017-08-07 09:56:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-08 15:27:19 +0000
commitc6c10b45188f0921c9451644b61b072e3a36ee12 (patch)
tree34c7ae0b90be040daa5523657fec04d6771f9472 /resources
parent0ac06e47269a40c177747310a613d213c95d1d6d (diff)
Remove SkTypeface::Style from fuzzers and lua.
Change-Id: I53be039e21a4c11ec3a4bc54c1424cd3e15afc6a Reviewed-on: https://skia-review.googlesource.com/31643 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'resources')
-rw-r--r--resources/slides.lua22
-rw-r--r--resources/test.lua2
2 files changed, 13 insertions, 11 deletions
diff --git a/resources/slides.lua b/resources/slides.lua
index 43c9b3b32f..9d61a87273 100644
--- a/resources/slides.lua
+++ b/resources/slides.lua
@@ -1,7 +1,7 @@
gShowBounds = false
gUseBlurInTransitions = false
-gPath = "/skia/trunk/resources/"
+gPath = "resources/"
function load_file(file)
local prev_path = package.path
@@ -12,17 +12,17 @@ end
load_file("slides_utils")
-gSlides = parse_file(io.open("/skia/trunk/resources/slides_content2.lua", "r"))
+gSlides = parse_file(io.open("resources/slides_content2.lua", "r"))
function make_rect(l, t, r, b)
return { left = l, top = t, right = r, bottom = b }
end
-function make_paint(typefacename, stylebits, size, color)
+function make_paint(typefacename, style, size, color)
local paint = Sk.newPaint();
paint:setAntiAlias(true)
paint:setSubpixelText(true)
- paint:setTypeface(Sk.newTypeface(typefacename, stylebits))
+ paint:setTypeface(Sk.newTypeface(typefacename, style))
paint:setTextSize(size)
paint:setColor(color)
return paint
@@ -102,27 +102,29 @@ function make_tmpl(paint, extra_dy)
end
function SkiaPoint_make_template()
+ normal = Sk.newFontStyle()
+ bold = Sk.newFontStyle(700)
local title = {
margin_x = 30,
margin_y = 100,
}
- title[1] = make_paint("Arial", 1, 45, { a=1, r=1, g=1, b=1 })
+ title[1] = make_paint("Arial", bold, 45, { a=1, r=1, g=1, b=1 })
title[1]:setTextAlign("center")
- title[2] = make_paint("Arial", 1, 25, { a=1, r=.75, g=.75, b=.75 })
+ title[2] = make_paint("Arial", bold, 25, { a=1, r=.75, g=.75, b=.75 })
title[2]:setTextAlign("center")
local slide = {
margin_x = 20,
margin_y = 25,
}
- slide[1] = make_tmpl(make_paint("Arial", 1, 35, { a=1, r=1, g=1, b=1 }), 18)
- slide[2] = make_tmpl(make_paint("Arial", 0, 25, { a=1, r=1, g=1, b=1 }), 10)
- slide[3] = make_tmpl(make_paint("Arial", 0, 20, { a=1, r=.9, g=.9, b=.9 }), 5)
+ slide[1] = make_tmpl(make_paint("Arial", bold, 35, { a=1, r=1, g=1, b=1 }), 18)
+ slide[2] = make_tmpl(make_paint("Arial", normal, 25, { a=1, r=1, g=1, b=1 }), 10)
+ slide[3] = make_tmpl(make_paint("Arial", normal, 20, { a=1, r=.9, g=.9, b=.9 }), 5)
return {
title = title,
slide = slide,
- codePaint = make_paint("Courier", 0, 20, { a=1, r=.9, g=.9, b=.9 }),
+ codePaint = make_paint("Courier", normal, 20, { a=1, r=.9, g=.9, b=.9 }),
}
end
diff --git a/resources/test.lua b/resources/test.lua
index 1029db41ed..03201baeda 100644
--- a/resources/test.lua
+++ b/resources/test.lua
@@ -47,7 +47,7 @@ function onStartup()
local paint = Sk.newPaint();
paint:setColor{a=1, r=1, g=0, b=0};
if false then
- local doc = Sk.newDocumentPDF('/skia/trunk/test.pdf');
+ local doc = Sk.newDocumentPDF('out/test.pdf');
local canvas = doc:beginPage(72*8.5, 72*11);
canvas:drawText('Hello Lua', 300, 300, paint);
doc:close();