×

Discussion Board

Results 1 to 3 of 3

Thread: larger font ?

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    4

    larger font ?

    hey guys i made a camera app that prints the date that the picture is taken on
    here is the photo http://img27.imageshack.us/img27/9497/09jan20101205.jpg if you zoom it in 100% it's perfect. The problem is that the font is too small to be viewed in the nokia's gallery help me fix it.
    Here is the app
    Code:
    import e32, appuifw, camera, time, key_codes
    appuifw.app.orientation='landscape'
    appuifw.app.screen = 'normal'
    full_path_str = 'C:\\Nokia\\Images\\%s.jpg'
    global pic_name
    location_i = 0   # 0 for phone memory, 1 for memory card
    print_date_i = 1 # print the date on the picture
    #------------- location_i -----------------
    def save_on_c():
        global full_path_str, location_i
        full_path_str = 'C:\\Nokia\\Images\\%s.jpg'
        location_i = 0
    def save_on_e():
        global full_path_str, location_i
        full_path_str = 'E:\\Images\\%s.jpg'
        location_i = 1
    #--------------- white balance ----------
    white_bal_str = 'auto'
    def whbal_auto():
        global white_bal_str
        white_bal_str = 'auto'
    def whbal_daylight():
        global white_bal_str
        white_bal_str = 'daylight'
    def whbal_cloudy():
        global white_bal_str
        white_bal_str = 'cloudy'
    def whbal_fluorescent():
        global white_bal_str
        white_bal_str = 'fluorescent'
    def whbal_tungsten():
        global white_bal_str
        white_bal_str = 'tungsten'
    #--------------- flash modes ------------
    flash_mode = 'auto'
    def flash_auto():
        global flash_mode
        flash_mode = 'auto'
    def flash_on():
        global flash_mode
        flash_mode = 'forced'
    def flash_off():
        global flash_mode
        flash_mode = 'none'
    #------------- exposure -----------------
    exp_mode = 'auto'
    def exp_auto():
        global exp_mode
        exp_mode = 'auto'
    def exp_center():
        global exp_mode
        exp_mode = 'center'
    def exp_night():
        global exp_mode
        exp_mode = 'night'
    #------------ picture size --------------
    pic_size_tup = (1600, 1200)
    def set_max():
        global pic_size_tup
        pic_size_tup = (1600, 1200)
    def set_1024():
        global pic_size_tup
        pic_size_tup = (1024, 768)
    def set_800():
        global pic_size_tup
        pic_size_tup = (800, 600)
    def set_vga():
        global pic_size_tup
        pic_size_tup = (640, 480)
    def set_min():
        global pic_size_tup
        pic_size_tup = (160, 120)
    #--------- date printing ---------------
    def date_printing_on():
        global print_date_i
        print_date_i = 1 
    def date_printing_off():
        global print_date_i
        print_date_i = 0
    def viewfinder(img):
     canvas.blit(img)
    def shoot():
     camera.stop_finder()
     photo = camera.take_photo('RGB',pic_size_tup,0,flash_mode,exp_mode,white_bal_str,0)
     canvas.blit(photo, target = (0, 0, w, h), scale = 1)
     ltime=time.localtime()
     if ltime[1] == 1:
      month = '-Jan-'
     elif ltime[1] == 2:
      month = '-Feb-'
     elif ltime[1] == 3:
      month = '-Mar-'
     elif ltime[1] == 4:
      month = '-Apr-'
     elif ltime[1] == 5:
      month = '-May-'
     elif ltime[1] == 6:
      month = '-Jun-'
     elif ltime[1] == 7:
      month = '-Jul-'
     elif ltime[1] == 8:
      month = '-Aug-'
     elif ltime[1] == 9:
      month = '-Sep-'
     elif ltime[1] == 10:
      month = '-Oct-'
     elif ltime[1] == 11:
      month = '-Nov-'
     elif ltime[1] == 12:
      month = '-Dec-'
     dd = ltime[2]
     if dd < 10 :
      dd = "0" + str(ltime[2])
     hh = ltime[3]
     if hh == 0 :
      hh = 22
     elif hh == 1 :
      hh = 23
     elif hh < 12 :
      hh = "0" + str(ltime[3] - 2)
     else : hh = ltime[3] - 2
     min = ltime[4]
     if min < 10 :
      min = "0" + str(ltime[4])
     sc = ltime[5]
     if sc < 10 :
      sc = "0" + str(ltime[5])
     date = str(dd) + month + str(ltime[0]) + u'   ' + str(hh) + u':' + str(min) + u':' + str(sc) 
     photo.text((20, 20), date, 0x00FF00, 'normal')
     photo.save(full_path_str%date, format='JPEG', quality=100, bpp=24, compression='none')
     camera.start_finder(viewfinder, size=(h * 1.34, h))
    def exit():
     camera.stop_finder()
     app_lock.signal()
    appuifw.app.body = canvas = appuifw.Canvas()
    w, h = canvas.size
    camera.start_finder(viewfinder, size=(h * 1.34, h))
    menu = [(u'Image size',((u'1600x1200', set_max),
                                   (u'1024x768', set_1024),
                                    (u'800x600', set_800),
                                    (u'640x480', set_vga),
                                    (u'160x120', set_min)
                                    ) 
                     ),
                   (u"Flash mode",((u"Auto",flash_auto),
                                        (u"On",  flash_on),
                                        (u"Off", flash_off)
                                       )
                        ),
                   (u"Exposure",((u"Auto",  exp_auto),
                                      (u"Center",exp_center),
                                      (u"Night", exp_night)
                                     )
                        ),
                    (u'White balance',((u'Auto',       whbal_auto),
                                       (u'Daylight',   whbal_daylight),
                                       (u'Cloudy',     whbal_cloudy),
                                       (u'Neon',       whbal_fluorescent),
                                       (u'Tungsten',   whbal_tungsten)
                                       )
                     ),
                    (u'Print date on image', ((u'On',  date_printing_on),
                                              (u'Off', date_printing_off)
                                              )
                     ),
                    (u'Memory in use', ((u'Phone memory', save_on_c),
                                        (u'Memory card',  save_on_e)
                                        )
                     )
                   ]
    appuifw.app.menu = menu
    canvas.bind(key_codes.EKeySelect, shoot)
    canvas.bind(key_codes.EKeyRightSoftkey, exit)
    app_lock = e32.Ao_lock()
    app_lock.wait()

  2. #2
    Registered User
    Join Date
    Dec 2008
    Posts
    35

    Re: larger font ?

    Just use

    Code:
    photo.text((20, 20), date, 0x00FF00, ('normal',19))
    Replace 19 with any font size you prefer. This is all documented here: http://pys60.garage.maemo.org/doc/s60/node36.html

    PS Instead of converting date to string manually, you could use strftime() function from datetime module.

    PPS Is this Bulgary on your photo? Just curious.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    4

    Re: larger font ?

    thx works
    Quote Originally Posted by uhm57 View Post
    PPS Is this Bulgary on your photo? Just curious.
    Yes it is Bulgaria
    Last edited by tanago; 2010-01-09 at 20:49.

Similar Threads

  1. How to make a larger font in J2ME?
    By joykeyer in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2010-11-08, 19:35
  2. Using the font from setting list in custom listbox
    By alav in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-11-05, 17:17
  3. How to get the name of the used font
    By chrishawaii in forum Symbian User Interface
    Replies: 1
    Last Post: 2007-06-22, 06:55
  4. Replies: 7
    Last Post: 2006-06-08, 22:17
  5. Larger font than iEikonEnv->TitleFont()
    By pengox in forum Symbian C++
    Replies: 2
    Last Post: 2004-03-09, 12:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •