@shopify/react-native-skia 0.1.223 → 0.1.225
Sign up to get free protection for your applications and to get access to all the features.
- package/cpp/api/JsiSkApi.h +1 -1
- package/cpp/api/JsiSkParagraphStyle.h +3 -2
- package/cpp/api/JsiSkStrutStyle.h +10 -3
- package/cpp/api/{JsiSkTypeFaceFontProviderFactory.h → JsiSkTypefaceFontProviderFactory.h} +1 -1
- package/package.json +1 -1
- /package/cpp/api/{JsiSkTypeFaceFontProvider.h → JsiSkTypefaceFontProvider.h} +0 -0
package/cpp/api/JsiSkApi.h
CHANGED
@@ -44,9 +44,9 @@
|
|
44
44
|
#include "JsiSkShaderFactory.h"
|
45
45
|
#include "JsiSkSurfaceFactory.h"
|
46
46
|
#include "JsiSkTextBlobFactory.h"
|
47
|
-
#include "JsiSkTypeFaceFontProviderFactory.h"
|
48
47
|
#include "JsiSkTypeface.h"
|
49
48
|
#include "JsiSkTypefaceFactory.h"
|
49
|
+
#include "JsiSkTypefaceFontProviderFactory.h"
|
50
50
|
#include "JsiSkVertices.h"
|
51
51
|
|
52
52
|
namespace RNSkia {
|
@@ -24,6 +24,7 @@ namespace RNSkia {
|
|
24
24
|
namespace jsi = facebook::jsi;
|
25
25
|
|
26
26
|
namespace para = skia::textlayout;
|
27
|
+
|
27
28
|
/**
|
28
29
|
Implementation of the ParagraphStyle object in JSI
|
29
30
|
*/
|
@@ -60,7 +61,7 @@ public:
|
|
60
61
|
|
61
62
|
if (object.hasProperty(runtime, "disableHinting")) {
|
62
63
|
auto propValue = object.getProperty(runtime, "disableHinting");
|
63
|
-
if (
|
64
|
+
if (asBool(runtime, propValue)) {
|
64
65
|
retVal.turnHintingOff();
|
65
66
|
}
|
66
67
|
}
|
@@ -83,7 +84,7 @@ public:
|
|
83
84
|
}
|
84
85
|
if (object.hasProperty(runtime, "replaceTabCharacters")) {
|
85
86
|
auto propValue = object.getProperty(runtime, "replaceTabCharacters");
|
86
|
-
retVal.setReplaceTabCharacters(
|
87
|
+
retVal.setReplaceTabCharacters(asBool(runtime, propValue));
|
87
88
|
}
|
88
89
|
if (object.hasProperty(runtime, "textAlign")) {
|
89
90
|
auto propValue = object.getProperty(runtime, "textAlign");
|
@@ -20,6 +20,13 @@ namespace jsi = facebook::jsi;
|
|
20
20
|
|
21
21
|
namespace para = skia::textlayout;
|
22
22
|
|
23
|
+
bool asBool(jsi::Runtime &runtime, const jsi::Value &value) {
|
24
|
+
if (!value.isBool()) {
|
25
|
+
throw jsi::JSError(runtime, "Expected boolean value");
|
26
|
+
}
|
27
|
+
return value.getBool();
|
28
|
+
}
|
29
|
+
|
23
30
|
/**
|
24
31
|
Implementation of the TextStyle object in JSI for the paragraph builder
|
25
32
|
*/
|
@@ -47,7 +54,7 @@ public:
|
|
47
54
|
|
48
55
|
if (object.hasProperty(runtime, "strutEnabled")) {
|
49
56
|
auto propValue = object.getProperty(runtime, "strutEnabled");
|
50
|
-
retVal.setStrutEnabled(
|
57
|
+
retVal.setStrutEnabled(asBool(runtime, propValue));
|
51
58
|
}
|
52
59
|
if (object.hasProperty(runtime, "fontFamilies")) {
|
53
60
|
auto propValue = object.getProperty(runtime, "fontFamilies")
|
@@ -78,7 +85,7 @@ public:
|
|
78
85
|
}
|
79
86
|
if (object.hasProperty(runtime, "halfLeading")) {
|
80
87
|
auto propValue = object.getProperty(runtime, "halfLeading");
|
81
|
-
retVal.setHalfLeading(
|
88
|
+
retVal.setHalfLeading(asBool(runtime, propValue));
|
82
89
|
}
|
83
90
|
if (object.hasProperty(runtime, "leading")) {
|
84
91
|
auto propValue = object.getProperty(runtime, "leading");
|
@@ -86,7 +93,7 @@ public:
|
|
86
93
|
}
|
87
94
|
if (object.hasProperty(runtime, "forceStrutHeight")) {
|
88
95
|
auto propValue = object.getProperty(runtime, "forceStrutHeight");
|
89
|
-
retVal.setForceStrutHeight(
|
96
|
+
retVal.setForceStrutHeight(asBool(runtime, propValue));
|
90
97
|
}
|
91
98
|
|
92
99
|
return retVal;
|
package/package.json
CHANGED
File without changes
|