Bookmaker to work on Linux.
This also updates one fiddle example which used SkTypeface::kBold, which is now private. Change-Id: I799b64bfaa377d02f0a045d2f077410d4f38413d Reviewed-on: https://skia-review.googlesource.com/68902 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
parent
f8e2502819
commit
700ff17125
@ -3247,7 +3247,7 @@ implementation.
|
|||||||
#Height 100
|
#Height 100
|
||||||
void draw(SkCanvas* canvas) {
|
void draw(SkCanvas* canvas) {
|
||||||
SkPaint paint;
|
SkPaint paint;
|
||||||
paint.setTypeface(SkTypeface::MakeDefault(SkTypeface::kBold));
|
paint.setTypeface(SkTypeface::MakeFromName(nullptr, SkFontStyle()));
|
||||||
paint.setAntiAlias(true);
|
paint.setAntiAlias(true);
|
||||||
paint.setTextSize(36);
|
paint.setTextSize(36);
|
||||||
canvas->drawString("A Big Hello!", 10, 40, paint);
|
canvas->drawString("A Big Hello!", 10, 40, paint);
|
||||||
|
@ -3250,7 +3250,7 @@ implementation.
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
<div><fiddle-embed name="c18b1696b8c1649bebf7eb1f8b89e0b0"></fiddle-embed></div>
|
<div><fiddle-embed name="1a7a5062725139760962582f599f1b97"></fiddle-embed></div>
|
||||||
|
|
||||||
<a name="SkPaint_getTypeface"></a>
|
<a name="SkPaint_getTypeface"></a>
|
||||||
## getTypeface
|
## getTypeface
|
||||||
|
@ -308,9 +308,12 @@ bool Definition::exampleToScript(string* result, ExampleOptions exampleOptions)
|
|||||||
code += "}";
|
code += "}";
|
||||||
}
|
}
|
||||||
string example = "\"" + normalizedName + "\": {\n";
|
string example = "\"" + normalizedName + "\": {\n";
|
||||||
size_t nameStart = fFileName.find("\\", 0);
|
|
||||||
SkASSERT(string::npos != nameStart);
|
string baseFile = [this]() {
|
||||||
string baseFile = fFileName.substr(nameStart + 1, fFileName.length() - nameStart - 5);
|
string baseNameExt = fFileName.substr(fFileName.find_last_of("/\\") + 1);
|
||||||
|
size_t p = baseNameExt.find_last_of('.');
|
||||||
|
return (p > 0 && p != string::npos) ? baseNameExt.substr(0, p) : baseNameExt;
|
||||||
|
}();
|
||||||
if (ExampleOptions::kText == exampleOptions) {
|
if (ExampleOptions::kText == exampleOptions) {
|
||||||
example += " \"code\": \"" + code + "\",\n";
|
example += " \"code\": \"" + code + "\",\n";
|
||||||
example += " \"hash\": \"" + fHash + "\",\n";
|
example += " \"hash\": \"" + fHash + "\",\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user