Bílý vrch
icon TrekBuddy
www.trekbuddy.net
Outdoor companion.
  • internal / bluetooth / simulator GPS
  • offline raster maps
  • smart GPX / raw NMEA logs
  • waypoints and simple navigation
  • custom views
  • MIDP and Symbian phones
  • Blackberry
  • Android
Visit wiki to see all features, guides and howtos. Project tracker.
Trekbuddy is on Github now

Partners:    (Polish/Polski)(Polski) Compass mapy      (Polish/Polski)(Polski) Galileos mapy      (Polish/Polski)(Polski) CartoMedia      (Czech/Èesky)(Èesky) Eaglesoft trasy      (Polish/Polski)(Polski) ExpressMap     

 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
[Android] System fonts
Goto page Previous  1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    TrekBuddy Forum Index -> Themes
View previous topic :: View next topic  
Author Message
JNT



Joined: 10 Jan 2009
Posts: 416
Location: Sweden

PostPosted: Wed Jan 27, 2016 8:47 am    Post subject: Reply with quote

Great!

System font size setting gives the same size in pixels on the screen (Nexus 7 and Samsung S6, which have quite different pixel densities).

(One odd thing is that a text size setting of 56 in a field height of 60 does not fit, but is cut off at the bottom - see the "g" of "Target".)



2016-01-27-N7-sizes.png
 Description:
Sizes on Nexus 7
 Filesize:  26.26 KB
 Viewed:  5726 Time(s)

2016-01-27-N7-sizes.png



Screenshot_20160127-S6-sizes.png
 Description:
Sizes on Samsung S6
 Filesize:  55.97 KB
 Viewed:  5726 Time(s)

Screenshot_20160127-S6-sizes.png


Back to top
View user's profile Send private message
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Wed Jan 27, 2016 11:21 am    Post subject: Reply with quote

Can be, small letters are used in 56 size. Extending up field height doesn't help ?
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5675

PostPosted: Wed Jan 27, 2016 11:31 am    Post subject: Reply with quote

By the way, I use old Xperia mini for testing TB, and I notice some letters are cut off the bottom in Settings (eg. some checkbox labels etc) when I look carefully, and these are text elements in much smaller font than 56.
I could not figure out why yet, and because nobody complained (maybe there are no letters with descent like 'g' anywhere in Settings), I gave up on fixing it.


Last edited by kruch on Wed Jan 27, 2016 11:40 am; edited 2 times in total
Back to top
View user's profile Send private message
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Wed Jan 27, 2016 11:38 am    Post subject: Reply with quote

Probably text field size isn't extended well to font metrics ...

Last edited by Ranger on Wed Jan 27, 2016 11:48 am; edited 1 time in total
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5675

PostPosted: Wed Jan 27, 2016 11:41 am    Post subject: Reply with quote

I would understand the problem in CMS, there could be a bug in TB because it uses low-level canvas rendering, but Settings forms are made of Android views, where TB does not control absolute positioning or spacing of elements, only relative (layout direction, wrapping etc).
Back to top
View user's profile Send private message
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Wed Jan 27, 2016 12:29 pm    Post subject: Reply with quote

Sample of small letters like "y" or "j" in Settings and CMS.
Don't seems cutted any way in CMS (if field size was declared well) ...



Fonts_in_settings_and_CMS.png
 Description:
 Filesize:  42.6 KB
 Viewed:  5679 Time(s)

Fonts_in_settings_and_CMS.png


Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 416
Location: Sweden

PostPosted: Wed Jan 27, 2016 2:14 pm    Post subject: Reply with quote

This is how the text is sitting in the fields (field height 60 in all cases - yellow in the picture)

defined (for this test) as:
Code:

        <font name="smallb" system="400108" size="30"/>
        <font name="medium" system="400000" size="40"/>
        <font name="mediumb" system="400100" size="40"/>
        <font name="big" system="400010" size="50"/>
        <font name="bigb" system="400110" size="50"/>
        <font name="Ssb40" system="400108" size="40"/>
        <font name="Sm40" system="400000" size="40"/>
        <font name="Smb40" system="400100" size="40"/>
        <font name="Sb40" system="400010" size="40"/>
        <font name="Sbb40" system="400110" size="40"/>



Screenshot_20160127-SysFont.png
 Description:
Fonts size examples
 Filesize:  47.25 KB
 Viewed:  5659 Time(s)

Screenshot_20160127-SysFont.png


Back to top
View user's profile Send private message
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Wed Jan 27, 2016 2:23 pm    Post subject: Reply with quote

OK, which one is Big56 ? Smile
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5675

PostPosted: Wed Jan 27, 2016 2:56 pm    Post subject: Reply with quote

Can you post complete xml? I'm going to make some changes in font metrics tonight (I think there are some wrong calculations), with this I will have something to check if screwed up something or not. Thanks.
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 416
Location: Sweden

PostPosted: Wed Jan 27, 2016 2:58 pm    Post subject: Reply with quote

Ranger wrote:
OK, which one is Big56 ? Smile


Looks like this. Wink



Big56.png
 Description:
Big 56
 Filesize:  19.04 KB
 Viewed:  5646 Time(s)

Big56.png


Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 416
Location: Sweden

PostPosted: Wed Jan 27, 2016 3:01 pm    Post subject: Reply with quote

kruch wrote:
Can you post complete xml?


Here it is.



cms.sail04.zip
 Description:
xml

Download
 Filename:  cms.sail04.zip
 Filesize:  684 Bytes
 Downloaded:  5 Time(s)

Back to top
View user's profile Send private message
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Wed Jan 27, 2016 3:01 pm    Post subject: Reply with quote

So try to use 70 for field ... Smile
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 416
Location: Sweden

PostPosted: Wed Jan 27, 2016 3:21 pm    Post subject: Reply with quote

Ranger wrote:
So try to use 70 for field ... Smile


I guess 64 might even already work... but my point is that you cannot use the text size and the field size and then be 100% sure where the text will end up (in vertical placement). In the end you always have to nudge them around a little to get them where you want them. It is not a big deal, but it would be easier if one could predict where it would end up exactly. Cool
Back to top
View user's profile Send private message
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Wed Jan 27, 2016 3:24 pm    Post subject: Reply with quote

Right, font metrics should be known in phone itself ... Cool
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5675

PostPosted: Wed Jan 27, 2016 7:08 pm    Post subject: Reply with quote

Paint.setTextSize(px) obviously is not the way to achieve what we need. Eg. for px=56, I get metrics where ascent=-52 and descent=14, ie. font(?) height 66px Confused

So, in new apk TB starts with specified size when creating a font and iterates until it reaches desired font metrics.

http://www.trekbuddy.net/dev/2016-01-27/trekbuddy.apk
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    TrekBuddy Forum Index -> Themes All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 4 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group