Rotating a text field

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 307
Joined: Mon Jun 10, 2013 1:32 pm

Rotating a text field

Post by Lagi Pittas » Fri Apr 27, 2018 5:59 pm

Hi All,

I want to print some labels to a printer but the sizes I can get are "rotated" so as not to waste space.

Iv'e thought of a couple of ways to do this - in order of simplicity.

1. Take a snapshot of the text field after it has been "filled in" , rotate the snapshot how I wish on a card exactly the size of the label and print that card - job done.

2. Create a browser widget sized to the label and use the transform command in CSS with a javascript call to rotate it after I've populated the "canvas"

3. Create a PDF with sideways printed writing assuming I can rotate text using the new PDF addition.

I wouldn't know if 3 was possible without wasting a lot of time , 2 seems very possible , 1 is a doddle but wouldn't it be nice if there was something in that dictionary I have missed. -

BTW I'm Using V9 for this project so I can use all the goodies.

Regards Lagi

livecodeali
Livecode Staff Member
Livecode Staff Member
Posts: 168
Joined: Thu Apr 18, 2013 2:48 pm

Re: Rotating a text field

Post by livecodeali » Fri Apr 27, 2018 10:41 pm

The extensions course contains code for a rotated text widget here (click the downloads icon on the right)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2720
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Rotating a text field

Post by richmond62 » Sat Apr 28, 2018 11:48 am

I dunno about anything else, livecodeali, but those links are worth a thousand words. :D

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 307
Joined: Mon Jun 10, 2013 1:32 pm

Re: Rotating a text field

Post by Lagi Pittas » Mon Apr 30, 2018 10:11 am

Hi Ali

Thanks for that - might take a little longer to learn but definitely worth the time.

Thanks again

Lagi

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1765
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Rotating a text field

Post by [-hh] » Mon May 21, 2018 11:41 am

Hi Lagi,

the only way to rotate a multiline text field is to use a browser widget, see hhTextEditBasic and hhTextEditFull in "Sample Stacks". You can with that even justify text and edit the text in rotated state.
See http://forums.livecode.com/viewtopic.ph ... 16#p161916

With LC Builder you can make a rotatedText widget for one line only. For multiline texts you have to do your own word break algorithm. I have done the latter in widget IconGrid (use a 1x1 grid), see
http://forums.livecode.com/viewtopic.ph ... 12#p158112
and (then apply to widget 'orientedText')
http://forums.livecode.com/viewtopic.ph ... 90#p148690
shiftLock happens

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 307
Joined: Mon Jun 10, 2013 1:32 pm

Re: Rotating a text field

Post by Lagi Pittas » Mon May 21, 2018 12:22 pm

Hi

Thank's Hermann. I haven't had chance to look into it since the post - it's a freebie for a relative so I have a couple more weeks to "fob him off" :D.

But I will definitely look at that as well.

Best, Lagi

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”