You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My project needs to support both Chinese and English. English is not garbled, but Chinese is garbled. Is it because the font is not supported? My phone can support Chinese display,
The displayed Chinese effect is as follows
The text was updated successfully, but these errors were encountered:
Yes this is definitely because of the font. We test Chinese characters in our test suite. If you think there is a bug, please submit a reproduction and we will investigate it. Closing it for now.
Description
import { Canvas, Image as SkiaIamge, useImage, Path, Skia, FontStyle, Text as SkiaText, useTexture } from '@shopify/react-native-skia';
const familyName = Platform.select({ ios: "Helvetica", default: "serif" });
const fontMgr = Skia.FontMgr.System();
const typeface = fontMgr.matchFamilyStyle(familyName, FontStyle.Bold);
const font = Skia.Font(typeface, 12);
<Canvas
style={[styles.image, { height: editImgHeight, width: editImgWidth }]}
>
<SkiaText
x={0}
y={30}
text={'你好呀,世界'}
font={font}
style="fill"
color={'#DE4188'}
/>
Text component draws Chinese garbled characters
My project needs to support both Chinese and English. English is not garbled, but Chinese is garbled. Is it because the font is not supported? My phone can support Chinese display,
The displayed Chinese effect is as follows
The text was updated successfully, but these errors were encountered: