none
Graphics Window Professionals Needed RRS feed

  • Question

  • What is it?: Well I'm Looking for anyone who has a decent calligrapy input Graphics window code. As in a code where i can type in what I would like it to say and when i run the program, it will write it out in the graphics window in a calligraphic font style, if possible a cursive font style of calligraphy. If anyone has a program similar to this. The code or Ideas on how to code such a program would be greatly appreciated and will help me out very much.

    Im using Small Basic to code. Only coding program I posses.

    Friday, December 19, 2014 5:13 PM

Answers

  • Hey SOAcaptain001, I'm not exactly the professional that you are looking for, but, I'll give a shot at some help before the cavalry come in.  

    Are you looking to have the program write the calligraphy, or just simply show up?  If you need the program itself to draw it, I can't help with that, though there was recently a monthly challenge where people did something similar.  

    I have a working version of a small part so far, so I'll help you throughout your process (unless someone does it better heh, then you should listen to him).  What I would suggest for you to do is this:

    1st make a spot where the user inputs text >> Controls.AddMultiLineTextBox(X, Y) plus other fancy stuff like font size and font color to your liking.

    *2nd make a spot where the text output is shown, same thing >> Controls.AddMultiLineTextBox(X, Y) as well as your other fancy stuff.  Here we can also define the font you want so the text box knows what you want it to look like.  I used "Edwardian Script ITC Regular" because that was the closest I could find to calligraphy in my **Fonts folder.  So you can use GraphicsWindow.FontName = "ABC" to define what font you want to show here.  ABC of course being the calligraphy font name you have. 

    3rd make something to trigger the transfer from the input textbox to the output textboxt (because we already made it such that the text in 2nd will be whatever we want.  So, we just have to copy the text in essence.  >> I made a Sub here to use a button to take the 1st textbox of input and place it in the 2nd textbox.

    *This actually isn't exactly what you are asking for.  This is entering text in a window, and seeing it in the same window.  Well, it is 5AM here and I was ready to sleep about 6 hours ago but I ended up working in Small Basic again.  But, one thing I learned from the guys here the past few days was to do things in smaller parts, which I'm trying to do for myself now.  Make a portion of the program, test it, see if it works and polish it up.  Then continue with the rest or other issues.  So, if you are keen on having a different window than the one we are entering text in, we can figure it out once we figure out how to change the input font to a different output font.

    **I put a star in the 2nd part on 'Fonts' because if you didn't know, you can go to computer and type in the search bar 'fonts' and go to the folder and check what fonts you have.  If you can't find a decent calligraphy font I'm sure you can download one somewhere that is calligraphy style and more cursive like you want.  I haven't tried this part so I don't know if that would work to be honest.

    I don't know how much Small Basic you know so I'm sorry if this gives away too much, or if it isn't enough and you are still stuck.  I don't want to give everything away, I'm not doing people's homework here.  But, if you work on it and try, then I'll work on it with you.  After this part, depending on exactly what you want, we can start looking at GraphicsWindow.DrawText() instead of text boxes, and how to separate input from output.



    Friday, December 19, 2014 9:22 PM
  • Hi SOAcap

    Small Basic is really good for this sort of program.

    Try and have a go at doing some of it yourself and when you're ready post what you've done so far. We can help you resolve anything you might have questions about. The curriculum can help you work out how to do this.

    To do this task you'll need to:

    1. Set up the Graphics Window by adding the Controls you wish to use and set some GraphicsWindow properties. In other words Initialise your program.
    2. It will be an Event Driven program so you'll need to add an Event to your set up, like a Button Click,
    3. Other Controls you can add are TextBoxes. Users can type text into them.
    4. The user could click a button to tell the program to do something to the text like Draw it in a fancy font.

    Friday, December 19, 2014 9:13 PM
    Moderator
  • A different approach ID: DDD833

    Enter your text in the lower part of the window (MLTextBox)

    Saturday, December 20, 2014 2:45 PM
    Answerer

All replies

  • Hi SOAcap

    Small Basic is really good for this sort of program.

    Try and have a go at doing some of it yourself and when you're ready post what you've done so far. We can help you resolve anything you might have questions about. The curriculum can help you work out how to do this.

    To do this task you'll need to:

    1. Set up the Graphics Window by adding the Controls you wish to use and set some GraphicsWindow properties. In other words Initialise your program.
    2. It will be an Event Driven program so you'll need to add an Event to your set up, like a Button Click,
    3. Other Controls you can add are TextBoxes. Users can type text into them.
    4. The user could click a button to tell the program to do something to the text like Draw it in a fancy font.

    Friday, December 19, 2014 9:13 PM
    Moderator
  • Hey SOAcaptain001, I'm not exactly the professional that you are looking for, but, I'll give a shot at some help before the cavalry come in.  

    Are you looking to have the program write the calligraphy, or just simply show up?  If you need the program itself to draw it, I can't help with that, though there was recently a monthly challenge where people did something similar.  

    I have a working version of a small part so far, so I'll help you throughout your process (unless someone does it better heh, then you should listen to him).  What I would suggest for you to do is this:

    1st make a spot where the user inputs text >> Controls.AddMultiLineTextBox(X, Y) plus other fancy stuff like font size and font color to your liking.

    *2nd make a spot where the text output is shown, same thing >> Controls.AddMultiLineTextBox(X, Y) as well as your other fancy stuff.  Here we can also define the font you want so the text box knows what you want it to look like.  I used "Edwardian Script ITC Regular" because that was the closest I could find to calligraphy in my **Fonts folder.  So you can use GraphicsWindow.FontName = "ABC" to define what font you want to show here.  ABC of course being the calligraphy font name you have. 

    3rd make something to trigger the transfer from the input textbox to the output textboxt (because we already made it such that the text in 2nd will be whatever we want.  So, we just have to copy the text in essence.  >> I made a Sub here to use a button to take the 1st textbox of input and place it in the 2nd textbox.

    *This actually isn't exactly what you are asking for.  This is entering text in a window, and seeing it in the same window.  Well, it is 5AM here and I was ready to sleep about 6 hours ago but I ended up working in Small Basic again.  But, one thing I learned from the guys here the past few days was to do things in smaller parts, which I'm trying to do for myself now.  Make a portion of the program, test it, see if it works and polish it up.  Then continue with the rest or other issues.  So, if you are keen on having a different window than the one we are entering text in, we can figure it out once we figure out how to change the input font to a different output font.

    **I put a star in the 2nd part on 'Fonts' because if you didn't know, you can go to computer and type in the search bar 'fonts' and go to the folder and check what fonts you have.  If you can't find a decent calligraphy font I'm sure you can download one somewhere that is calligraphy style and more cursive like you want.  I haven't tried this part so I don't know if that would work to be honest.

    I don't know how much Small Basic you know so I'm sorry if this gives away too much, or if it isn't enough and you are still stuck.  I don't want to give everything away, I'm not doing people's homework here.  But, if you work on it and try, then I'll work on it with you.  After this part, depending on exactly what you want, we can start looking at GraphicsWindow.DrawText() instead of text boxes, and how to separate input from output.



    Friday, December 19, 2014 9:22 PM
  • Nice answer jaytep.

    You could also Draw the output OnClick and maybe hide the input box as well.

    Friday, December 19, 2014 9:37 PM
    Moderator
  • Jibba, I was trying to answer succinctly as you did, but it came out as a 10,000 word novella.  But, I'm a noob and got excited to help out heh.  

    Right, that is what I was thinking of adding / testing once we got something working.  I know of the hiding function, but, just as a thought, is there a way to open another GraphicsWindow/TextWindow from a GraphicsWindow/TextWindow?  Not sure why this would be wanted or needed.. 

    Friday, December 19, 2014 9:57 PM
  • Yeah spot on jaytep

    That's why there's a Run button in the ide. Write some code, then run it to see how it's working. Insert some TW.writelines to see what your variables are doing. Message boxes are also useful for testing and debugging. It's good know if the parts work and even better to know why they are working.

    You can open 1 GW and 1 TW at the same time. That can be very useful.

    Litdevs got an extension that allows you to open multiple windows.

    The OP can also write the output to a Shape as well.


    Saturday, December 20, 2014 5:09 AM
    Moderator
  • Welcome to Small Basic forum, SOAcaptain001!

    This is my sample program: ZNR767.

    Screen shot of a program Fonts Sample 0.1

    Also I wrote about fonts here.


    Nonki Takahashi


    Saturday, December 20, 2014 6:35 AM
    Moderator
  • A different approach ID: DDD833

    Enter your text in the lower part of the window (MLTextBox)

    Saturday, December 20, 2014 2:45 PM
    Answerer