Re: How to change font direction?

2006-09-18 Thread Frederic Rentsch
theju wrote:
> Well here are some self explanatory functions that I've written for
> displaying the text vertically and from right to left. As for rotation
> gimme some more time and i'll come back to you. Also I don't guarantee
> that this is the best method(cos I myself am a newbie), but I can
> guarantee you that it works.
> Here it goes...
>
> im=Image.open("imgfile.jpg")
> draw=ImageDraw.Draw(im)
>
> def verdraw(width,height,spacing,a="Defaulttext"):
>   for i in range(0,len(a)):
>   draw.text((width,height),a[i],())
>   height+=spacing
>
> def right2leftdraw(width,height,spacing,a="Defaulttext"):
>   for i in range(0,len(a)):
>   draw.text((width,height),a[len(a)-i-1],())
>   width += spacing
>
>  is a 3 field length tuple is mentioned in the PIL-Handbook.
> Hope you find it useful
> -Theju
>
> Daniel Mark wrote:
>   
>> Hello all:
>>
>> I am using PIL to draw some graphics and I need to draw some texts
>> in vertical direction rather than the default left-to-right horizontal
>> direction.
>>
>> Is there anyway I could do that?
>>
>>
>> Thank you
>> -Daniel
>> 
>
>   

I have done a circular 24-hour dial with the numbers arranged to read 
upright as seen from the center. I remember writing each number into a 
frame, rotating the frame and pasting it into the dial image at the 
right place. I also remember using a transparency mask, so the white 
background of the little frame didn't cover up what it happened to 
overlap (minute marks). The numbers were black on white, so the frame 
was monochrome and could be used as its own transparency mask.
  (This could well be an needlessly complicated approach. When 
confronting a problem, I tend to weigh the estimated time of  hacking 
against the estimated time of shopping and reading recipes and often 
decide for hacking as the faster alternative.)

Regards

Frederic

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to change font direction?

2006-09-15 Thread theju
Well here are some self explanatory functions that I've written for
displaying the text vertically and from right to left. As for rotation
gimme some more time and i'll come back to you. Also I don't guarantee
that this is the best method(cos I myself am a newbie), but I can
guarantee you that it works.
Here it goes...

im=Image.open("imgfile.jpg")
draw=ImageDraw.Draw(im)

def verdraw(width,height,spacing,a="Defaulttext"):
for i in range(0,len(a)):
draw.text((width,height),a[i],())
height+=spacing

def right2leftdraw(width,height,spacing,a="Defaulttext"):
for i in range(0,len(a)):
draw.text((width,height),a[len(a)-i-1],())
width += spacing

 is a 3 field length tuple is mentioned in the PIL-Handbook.
Hope you find it useful
-Theju

Daniel Mark wrote:
> Hello all:
>
> I am using PIL to draw some graphics and I need to draw some texts
> in vertical direction rather than the default left-to-right horizontal
> direction.
> 
> Is there anyway I could do that?
> 
> 
> Thank you
> -Daniel

-- 
http://mail.python.org/mailman/listinfo/python-list


How to change font direction?

2006-09-15 Thread Daniel Mark
Hello all:

I am using PIL to draw some graphics and I need to draw some texts
in vertical direction rather than the default left-to-right horizontal
direction.

Is there anyway I could do that?


Thank you
-Daniel

-- 
http://mail.python.org/mailman/listinfo/python-list