Skip to content

justify text not works as expected! #47

Description

@hristowwe

Hello, first I want to thank you for the wonderful library! However, after trying it, I found that there was an bug in the styling property! I will post my code below but let me explain first! So when i set textAlign: "justify", It puts extra white space even though it does not exist in the original text. See this photo !
Screenshot_1644616278

In the original text it looks like this typesetting, remaining essentially - there aren't that many spaces! But in styled text there is more than one! So my code so far -

import { StyleSheet, View } from "react-native";
import StyledText from "react-native-styled-text";

export default function App() {
  const text =
    "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";

  return (
    <View style={styles.container}>
      <StyledText style={styles.header}>{text}</StyledText>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
  },
  header: {
    fontSize: 24,
    color: "orange",
    textAlign: "justify",
    padding: 30,
  },
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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