| Reply | « Previous Thread | Next Thread » |
|
Started from here: http://discussion.forum.nokia.com/fo...ad.php?t=97573
Get it from here: http://www.student.oulu.fi/~jtoivola...t_patch_V2.zip Screenshot here: http://www.student.oulu.fi/~jtoivola/s60/shot.png ############### V2 15.02.2007 ############### WARNING: If you use the new features, this patch may not be a 'temporary' solution anymore. ![]() Fixed:
Added:
If both getwidth and maxwidth are given, character count is returned. For those who do not know what is a "twip" let me quote this piece of poetry from Python for Series 60 Platform API Reference: Quote:
The font_leaktest.py is updated with a test for the above mentioned crash and example use of the added features. What it still needs, is a way to store all attributes of the previous font. PS: The Ball works now ![]() I hope you can test this and report any bugs you encounter. Edit: Oops... GCCE didn't compile because of those cursed goto -statements. Fixed.
Last edited by GameDude : 2007-02-16 at 10:23.
|
|
hello ,
You are great man ![]() Code works but API is awfull ![]() Could you refine API in graphics.py ? I would have width in pixels with a new function not embedded with the all purpose text Thanks you for the future G3 patch ! ![]() pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
You are welcome.
API is awfull, I know. Causes long lines sometimes. The text -function has all the operations to set the font, so it was easier for me to put all functionality in it. Bad decision maybe. I have been thinking to make it similar to Symbian's API. By using a separate function to set the font, I could separate the other functionality also in similar way. It would be a bit faster also, since there would be no need to set the font attributes for drawing every time. In Python it would look something like this: Code:
draw.setFont( "normal", size = 7, bold = True, fill = ( 255,0,0 ) ) width = draw.getWidth( u"Title:" ) draw.text( (10, 15), u"Title:" ) draw.text( (10 + width, 15), u"value" ) And I'm not sure, if the text drawing function should be kept backwards compatible with scripts written for pre 3rd edition. At least those new features I added will be removed to separate functions. After setting the font, all that is actually needed is the text and position parameters. By using separate setFont -function, it would propably be easier to make scripts work in both platforms: Code:
if s60ver >= (3,0): draw.setFont( u"Times New Roman", size=12 ) else: draw.setFont( u"LatinBold12" ) |
|
Quote:
![]() I think it would be better to make a not compatible solution because many features are not available in 3rd and new API proposal seems the same as this from appuifw.text with font settings can be set by default and not each time in the drawing function ... pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
Thanks a lot GameDude!
This is what I was waiting for!!! With the getwidth feature I can now really use it for my PyS60RemoteControl app... But I also think you should change the API and make a seperate setfont and getwidth function! One last thing ;-) Could you also post a precompiled version when you're finished with it? I don't want to install the whole Symbian SDK just for that... Thanks again Dorian |
| DorianScholz |
| View Public Profile |
| Find all posts by DorianScholz |
|
Quote:
Have you missed this announce from me : PyS60 1.3.1.8 with GameDude font 3rd patch ? keep up the good job Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
Thanks Cyke!
I didn't see your announcement... Got here by searching... Cheers Dorian |
| DorianScholz |
| View Public Profile |
| Find all posts by DorianScholz |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| 3rd party dual mode phone app on the S60 3rd edition SDK | ZelimirD | VoIP | 7 | 2007-11-30 15:49 |
| Problems with MIDlet icon size in application shell on S60 3rd edition devices | knorring | Mobile Java General | 7 | 2007-09-05 11:38 |
| Remote Camera Manager - S60 3rd edition | pspickett | General Discussion | 0 | 2006-12-18 08:02 |
| Device font in S60 Platform SDK 3rd ED | jiipee63 | Mobile Java Tools & SDKs | 4 | 2006-10-02 11:09 |
| OpenGL ES Support in S60 3rd Edition Beta SDK | choefele | Symbian Media (Graphics & Sounds) | 2 | 2005-12-14 07:01 |