Hi all.. i am working on rails version 1.2.3 (it is must to work on version
1.2.3) & ruby 1.8.6. For my project i want to convert text in to images
files.. so that i use rmagick.. it is working fine for only english.. i need
to convert images for multiple languages. I have showed my code below
require "RMagick"
def show_textimg
bg = Magick::Image.new(120,20){self.background_color = "#9E9E9E"}
ad_text = Magick::Draw.new
ad_text.text(23,14,@ad.ad_text) # here the input text.... only working
good for english but i want to convert multi language. for example if i pass
@ad.ad_text="ドの半角⇔全角"
ad_text.draw(bg)
bg.write
"#{RAILS_ROOT}/public/ad/ad_picture/#{@ad.name}-textimg.jpg"
end
Is there any way for this.
Very soon Replies are greatly appreciate..
Thank,
Arun..
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Please post your log here to see the error type for those scenarios. 2009/8/28 Arun Kumar <jakheart001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> Hi all.. i am working on rails version 1.2.3 (it is must to work on version > 1.2.3) & ruby 1.8.6. For my project i want to convert text in to images > files.. so that i use rmagick.. it is working fine for only english.. i > need to convert images for multiple languages. I have showed my code below > > require "RMagick" > def show_textimg > bg = Magick::Image.new(120,20){self.background_color = "#9E9E9E"} > ad_text = Magick::Draw.new > ad_text.text(23,14,@ad.ad_text) # here the input text.... only working good > for english but i want to convert multi language. for example if i pass > @ad.ad_text="ドの半角⇔全角" > ad_text.draw(bg) > bg.write "#{RAILS_ROOT}/public/ad/ad_picture/#{@ad.name}-textimg.jpg" > end > > Is there any way for this. > Very soon Replies are greatly appreciate.. > > > > > Thank, > Arun.. > > >-- With regards, Arunkumar B. 9789980534. http://thinkingrails.blogspot.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
try with encoding option like this
require "RMagick"
def show_textimg
bg = Magick::Image.new(120,20){self.background_color = "#9E9E9E"}
ad_text = Magick::Draw.new
*ad_text.encoding = "Unicode"*
ad_text.text(23,14,@ad.ad_text) # here the input text.... only working good
for english but i want to convert multi language. for example if i pass
@ad.ad_text="ドの半角⇔全角"
ad_text.draw(bg)
bg.write "#{RAILS_ROOT}/public/ad/ad_picture/#{@ad.name}-textimg.jpg"
end
On Mon, Aug 31, 2009 at 12:28 PM, Arunkumar B
<arunkarthick.it-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:
> Please post your log here to see the error type for those scenarios.
>
>
> 2009/8/28 Arun Kumar
<jakheart001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> Hi all.. i am working on rails version 1.2.3 (it is must to work on version
>> 1.2.3) & ruby 1.8.6. For my project i want to convert text in to
images
>> files.. so that i use rmagick.. it is working fine for only english.. i
>> need to convert images for multiple languages. I have showed my code
below
>>
>> require "RMagick"
>> def show_textimg
>> bg = Magick::Image.new(120,20){self.background_color =
"#9E9E9E"}
>> ad_text = Magick::Draw.new
>> ad_text.text(23,14,@ad.ad_text) # here the input text.... only working
>> good for english but i want to convert multi language. for example if i
pass
>> @ad.ad_text="ドの半角⇔全角"
>> ad_text.draw(bg)
>> bg.write
"#{RAILS_ROOT}/public/ad/ad_picture/#{@ad.name}-textimg.jpg"
>> end
>>
>> Is there any way for this.
>> Very soon Replies are greatly appreciate..
>>
>>
>>
>>
>> Thank,
>> Arun..
>> >>
>>
>
>
> --
> With regards,
> Arunkumar B.
> 9789980534.
> http://thinkingrails.blogspot.com
>
--
With regards,
Arunkumar B.
9789980534.
http://thinkingrails.blogspot.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---