Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
210424c7
Unverified
Commit
210424c7
authored
Feb 09, 2022
by
Oleksandr Karpovich
Committed by
GitHub
Feb 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Shaper functions (#486)
parent
f7831c1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Shaper.kt
...src/commonMain/kotlin/org/jetbrains/skia/shaper/Shaper.kt
+4
-2
No files found.
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/Shaper.kt
View file @
210424c7
...
@@ -105,10 +105,11 @@ class Shaper internal constructor(ptr: NativePointer) : Managed(ptr, _FinalizerH
...
@@ -105,10 +105,11 @@ class Shaper internal constructor(ptr: NativePointer) : Managed(ptr, _FinalizerH
fun
shape
(
text
:
String
?,
font
:
Font
?,
opts
:
ShapingOptions
,
width
:
Float
,
offset
:
Point
):
TextBlob
?
{
fun
shape
(
text
:
String
?,
font
:
Font
?,
opts
:
ShapingOptions
,
width
:
Float
,
offset
:
Point
):
TextBlob
?
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
managedString
=
ManagedString
(
text
)
val
ptr
=
interopScope
{
val
ptr
=
interopScope
{
_nShapeBlob
(
_nShapeBlob
(
_ptr
,
_ptr
,
ManagedString
(
text
)
.
_ptr
,
managedString
.
_ptr
,
getPtr
(
font
),
getPtr
(
font
),
optsFeaturesLen
=
opts
.
features
?.
size
?:
0
,
optsFeaturesLen
=
opts
.
features
?.
size
?:
0
,
optsFeaturesIntArray
=
arrayOfFontFeaturesToInterop
(
opts
.
features
),
optsFeaturesIntArray
=
arrayOfFontFeaturesToInterop
(
opts
.
features
),
...
@@ -191,11 +192,12 @@ class Shaper internal constructor(ptr: NativePointer) : Managed(ptr, _FinalizerH
...
@@ -191,11 +192,12 @@ class Shaper internal constructor(ptr: NativePointer) : Managed(ptr, _FinalizerH
fun
shapeLine
(
text
:
String
?,
font
:
Font
?,
opts
:
ShapingOptions
):
TextLine
{
fun
shapeLine
(
text
:
String
?,
font
:
Font
?,
opts
:
ShapingOptions
):
TextLine
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
managedString
=
ManagedString
(
text
)
interopScope
{
interopScope
{
TextLine
(
TextLine
(
_nShapeLine
(
_nShapeLine
(
_ptr
,
_ptr
,
ManagedString
(
text
)
.
_ptr
,
managedString
.
_ptr
,
getPtr
(
font
),
getPtr
(
font
),
optsFeaturesLen
=
opts
.
features
?.
size
?:
0
,
optsFeaturesLen
=
opts
.
features
?.
size
?:
0
,
optsFeatures
=
arrayOfFontFeaturesToInterop
(
opts
.
features
),
optsFeatures
=
arrayOfFontFeaturesToInterop
(
opts
.
features
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment