Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: experimental/webtry/webtry.go

Issue 635373002: In the generated fiddle, set the portable fonts flag first. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/webtry/build ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/webtry/webtry.go
diff --git a/experimental/webtry/webtry.go b/experimental/webtry/webtry.go
index 36c7afe5db6d428582d2a1fb4b45645940d0ac88..947eca7aa0d5d9ba7e544fa8aa3d6d6184841e17 100644
--- a/experimental/webtry/webtry.go
+++ b/experimental/webtry/webtry.go
@@ -372,11 +372,12 @@ func expandCode(code string, source int) (string, error) {
// TODO(humper): Make this more robust, supporting things like setTypeface
inputCodeLines := strings.Split(code, "\n")
- outputCodeLines := []string{}
+ outputCodeLines := []string{"DECLARE_bool(portableFonts);"}
for _, line := range inputCodeLines {
outputCodeLines = append(outputCodeLines, line)
- if strings.HasPrefix(strings.TrimSpace(line), "SkPaint ") {
- outputCodeLines = append(outputCodeLines, "sk_tool_utils::set_portable_typeface(&p);")
+ if strings.HasPrefix(strings.TrimSpace(line), "SkPaint p") {
+ outputCodeLines = append(outputCodeLines, "FLAGS_portableFonts = true;")
+ outputCodeLines = append(outputCodeLines, "sk_tool_utils::set_portable_typeface(&p, \"Helvetica\", SkTypeface::kNormal);")
}
}
« no previous file with comments | « experimental/webtry/build ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698