From c6c10b45188f0921c9451644b61b072e3a36ee12 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Mon, 7 Aug 2017 09:56:21 -0400 Subject: Remove SkTypeface::Style from fuzzers and lua. Change-Id: I53be039e21a4c11ec3a4bc54c1424cd3e15afc6a Reviewed-on: https://skia-review.googlesource.com/31643 Reviewed-by: Ben Wagner Commit-Queue: Ben Wagner --- resources/slides.lua | 22 ++++++++++++---------- resources/test.lua | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'resources') 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(); -- cgit v1.2.3