Jump to content
Sign in to follow this  
GMK

Wrapping a text file

Recommended Posts

GMK

I would like to take a text file and wrap the lines to conform to 1280px wide with an Arial Black font at 70pt size. I've looked for a way to do this with GDI+, but with no success. Does anyone have any ideas?

Share this post


Link to post
Share on other sites
sleepydvdr

Something like this?

#Include <EditConstants.au3>
#Include <GUIConstantsEx.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 1337, 701, 193, 125)
$Edit1 = GUICtrlCreateEdit("", 25, 24, 1280, 633, $ES_MULTILINE)
GUICtrlSetFont(-1, 70, 400, 0, "Arial")
$Button1 = GUICtrlCreateButton("Button1", 608, 664, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $text = FileRead("data.txt")
            GUICtrlSetData($Edit1, $text)
    EndSwitch
WEnd
Edited by sleepydvdr

#include <ByteMe.au3>

Share this post


Link to post
Share on other sites
GMK

Thanks for the reply. Perhaps I need to clarify. I have a plain old text file. I want to import the text into another program that displays Arial Black 70pt at 1280x1024 resolution. I want to be able to wrap the text file before the import--so I'd be rewriting the text file with the wrapped text.

Example: The following one-line text file

This is a test to see if this text will wrap.

would become a two-line text file:

This is a test to see if this text
will wrap.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×