Git Product home page Git Product logo

luxuriant777 / handwritten-text-generator Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 961 KB

This project offers a simple and intuitive interface for users to input text and generate images that showcase the text in a handwritten style. The generator supports several stylistic modifications including bold, underline, and color alterations, allowing users to create personalized and visually appealing images from their text.

License: GNU General Public License v3.0

Python 100.00%
python python3 text-editing text-editor text-processing text-to-image image-generation image-processing pil pillow wxpython handwriting handwriting-generation handwriting-simulator handwriting-synthesis handwritten-digits

handwritten-text-generator's Introduction

Handwritten Text Image Generator

Handwritten Text Image Generator is a creative tool designed to transform text inputs into beautiful, high-resolution images stylized with handwritten fonts. Users have the flexibility to choose different fonts, apply various styles such as bold, underline and color, and view the changes in real time. The final design can be exported as a PNG image.

To add a fun and creative twist, the "Randomize" feature randomly applies styles to words. A "Reset Styling" function is also available for those who prefer a clean slate to start with. Whether you are a graphic designer, social media influencer, or someone who enjoys personalizing your digital content, this tool is for you!

Installation

You will need Python installed on your machine. If you don't have Python installed, you can download it from the official site - https://www.python.org/.

Once you have Python installed, open your terminal or command prompt and run these commands:

  1. wxPython is used for creating the GUI. Install it with:

    pip install wxPython
  2. PIL (Pillow) is used for creating and manipulating images. Install it with:

    pip install Pillow
  3. Get the project to your PC:

    git clone https://github.com/luxuriant777/Handwritten-Text-Generator

Usage

  1. Navigate to the project directory:

    cd Handwritten-Text-Generator
  2. Run the script:

    python hwt-generator.py
  3. Enter your text into the provided text box.

    Screenshot_1

  4. Use the interface buttons to apply styles to your text.

  5. Preview the changes in real time.

    Screenshot_2

  6. When you're satisfied, select the font you want to use, from the list.

    SucMtoe

  7. Press "Export to Image" to save your design as a PNG image.

  8. Open file output.png and enjoy the result!

    output

Licensing

This project is licensed under the terms of the GNU General Public License v3.0. This license allows you to use, modify, and distribute the software, provided that any modifications are also distributed under the same license.

Contributing

We welcome contributions from the community to help improve this project. Whether you're fixing bugs, adding new features, or updating documentation, your efforts are greatly appreciated. Please create a pull request on the dev branch or report an issue.

Disclaimer

While every effort has been made to ensure the accuracy and reliability of this software, it is provided "as is", without warranty of any kind, expressed or implied. This encompasses any assurances of suitability for a specific purpose or non-infringement. The authors hold no liability for claims, damages, or any other liabilities that might arise in connection with the software, its usage, or any related dealings.

End-users bear the sole responsibility of deeming its appropriateness for use and accepting all inherent risks. These risks may include, among others, program errors, data loss or damage, equipment failure, or operational interruptions.

handwritten-text-generator's People

Stargazers

 avatar  avatar

Watchers

 avatar

handwritten-text-generator's Issues

no attribute "textsize" on imagedraw

hi, im succesfully run the code. but when im trying to export, there's error on line 106.
this the error message;

line 106, in on_export_image
char_width = temp_draw.textsize(char, font=font)[0]
^^^^^^^^^^^^^^^^^^
AttributeError: 'ImageDraw' object has no attribute 'textsize'.

and this is the code ;

 def on_export_image(self, event):
        lines = self.richTextCtrl.GetValue().split('\n')
        selected_font = self.font_choice.GetStringSelection()
        max_line_width = 0
        temp_image = Image.new("RGBA", (1, 1))
        temp_draw = ImageDraw.Draw(temp_image)

        for line_no, line in enumerate(lines):
            line_width = 0
            for char in line:
                font = ImageFont.truetype(f"./fonts/{selected_font}", self.font_size)
106--->   char_width = temp_draw.textsize(char, font=font)[0]
                line_width += char_width

i've already rewrite and trying fix the problem by changing the code, but the error still the same. maybe anyone or the developer it self can help. because this is for my class project. thanksss

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.