Skip to content

Instantly share code, notes, and snippets.

@TPXP
Last active October 1, 2025 22:41
Show Gist options
  • Select an option

  • Save TPXP/a2595d2f2f85c4524f470fc343787450 to your computer and use it in GitHub Desktop.

Select an option

Save TPXP/a2595d2f2f85c4524f470fc343787450 to your computer and use it in GitHub Desktop.
RNSVG Blurry emoji rendering reproduction
import React from 'react';
import {View} from 'react-native';
import Svg, {Path, Text} from 'react-native-svg';
const Test1 = () => (
<Svg
width={500}
height={500}
style={{backgroundColor: 'white'}}
viewBox={`0 0 40 40`}>
<Text x={19.7} y={33.5} fontSize={30} dx={-0.9} dy={1.1} fontWeight={'bold'} letterSpacing={-0.5} textAnchor={"middle"}>🥳</Text>
</Svg>
);
const Test2 = () => (
<Svg
width={500}
height={500}
style={{backgroundColor: 'white'}}
viewBox={`0 0 400 400`}>
<Text x={200} y={350} fontSize={300} dx={100} dy={100} textAnchor={"middle"}>🥳</Text>
</Svg>
);
const Test3 = () => (
<Svg
width={500}
height={500}
viewBox={`0 0 50 50`}>
<Path fill={'#fff'} d="M0 0h360v180H0z" />
<Text
x={10}
y={40}
textAnchor="middle"
fontSize={3}
fill={'#000'}
fontWeight={'bold'}>
{'>>>🥳X🥳<'}
</Text>
<Text
x={40}
y={10}
textAnchor="middle"
fontSize={3}
fill={'#000'}
fontWeight={'bold'}>
{'X😊<<<'}
</Text>
</Svg>
);
export default function App() {
return <View style={{width: '100%', height:'100%', alignItems: 'center', justifyContent: 'space-between', backgroundColor: 'red', flexDirection:'row'}}>
<Test1 />
<Test3 />
</View>;
}
import {AppRegistry} from 'react-native';
import App from './App';
AppRegistry.registerComponent('App', () => App);
{
"name": "app",
"version": "1.0.0",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest",
},
"dependencies": {
"react": "19.0.0",
"react-native": "0.79.3",
"react-native-svg": "https://github.com/kacperzolkiewski/react-native-svg.git#fixPixelatedEmoji",
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "18.0.0",
"@react-native-community/cli-platform-android": "18.0.0",
"@react-native-community/cli-platform-ios": "18.0.0",
"@react-native/babel-preset": "0.79.3",
"@react-native/eslint-config": "0.79.3",
"@react-native/metro-config": "0.79.3",
"@react-native/typescript-config": "0.79.3",
"@types/jest": "^29.5.13",
"@types/react": "^19.0.0",
"@types/react-test-renderer": "^19.0.0",
"eslint": "^8",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "19.0.0",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment