Skip to content

Text不能显示且useFont存在问题 #25

@changym5

Description

@changym5

版本:1.3.7-0.0.2和1.3.7-0.0.4
设备:Mate 60 Pro
软件版本:5.0.0.123

问题:
使用 0.0.4 版本的 skia,发现无法显示文本,且useFont返回null。

相关代码:

import React, {Component} from 'react';
import {Canvas, Text, useFont} from '@shopify/react-native-skia';
import {View} from 'react-native';
import arial from '../../../res/font/Arial.ttf';

const TestSkia = () => {
    const font = useFont(arial, 24);
    console.log(font)

    const width = 256;
    const height = 256;
    return (
        <Canvas style={{width, height}}>
            <Text text={'Test Skia'} font={font} x={50} y={50} />
        </Canvas>
    );
};

export default class TestPage2 extends Component {
    render() {
        return (
            <View
                style={{
                    backgroundColor: '#ccc',
                    marginHorizontal: 20,
                    marginVertical: 50,
                }}>
                <TestSkia />
            </View>
        );
    }
}

显示效果:

对比安卓显示效果:

看之前的issue和提交,应该是在0.0.1存在这个问题,在0.0.2解决了。但是一开始测试0.0.4,后来又试了0.0.2 都存在这个问题。
麻烦看下,是否未完全修复。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions