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.

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 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: 413
Location: Sweden

PostPosted: Tue Jan 19, 2016 6:52 pm    Post subject: [Android] System fonts Reply with quote

Does android also suffer from the limited choice of system fonts? Or is there some way to have a bigger selection?

The reason being that the custom bitmap fonts do not work for coordinates (no "N", "E", "W", "S")
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5664

PostPosted: Tue Jan 19, 2016 9:31 pm    Post subject: Reply with quote

I know too little aboout this, so I may be wrong. There are 4 basic typefaces available in Android: normal (?), sans(-serif), serif and monospace. Styles: normal, bold, italic. Size: any.

TB maps MIDP fonts to Android fonts like this:

system -> sans-serif
monospace -> monospace
proportional -> sans-serif
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 413
Location: Sweden

PostPosted: Wed Jan 20, 2016 7:20 am    Post subject: Reply with quote

Is there a way to specify the size with more granularity than big, medium and small?
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5664

PostPosted: Wed Jan 20, 2016 8:08 pm    Post subject: Reply with quote

I think it can be hacked, specifically for Android (and W10M I assume) to allow user set arbitrary font size...
Back to top
View user's profile Send private message
boowoo



Joined: 12 Jun 2013
Posts: 554
Location: France

PostPosted: Wed Jan 20, 2016 10:06 pm    Post subject: Reply with quote

Hi JNT,
I made some tests with different fonts (.apk) in my android phone. Problem is that when a font has the good size for one CMS it could display bad in others CMS or others apps.
There are more possibilities with android apps like FontEditorPro but the device need to be rooted ... Change size font with steps by 10 % !

But i use actually normal android fonts with less problems. Wink
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5664

PostPosted: Wed Jan 20, 2016 11:23 pm    Post subject: Reply with quote

Midlets support only 3 "symbolic" sizes, and actual size in pixels is platform (and maybe also phone settings dependent).
In TB for Android, these sizes - small, medium, large - are mapped to text size 12, 18, and 24 pixels.
In CMS, text-based font is specified like
Code:
<font name="smallb" system="400108"/>

08 is a midlet constant for [i]small[i] size (hexadecimal value).

I think I could hack Midlet->Android translation to allow users set any size directly in pixels. Texts in such CMS would however render correctly on Android, on other platforms, where font size cannot be specified in pixels, TB would have to fallback to one of the supported sizes (small, medium, large) with device-specific real size in pixels.
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 413
Location: Sweden

PostPosted: Thu Jan 21, 2016 8:12 am    Post subject: Reply with quote

kruch wrote:
I think I could hack Midlet->Android translation to allow users set any size directly in pixels. Texts in such CMS would however render correctly on Android, ...

That would be great, since for me Trekbuddy currently only lives in the Android world. Wink

boowoo wrote:
Problem is that when a font has the good size for one CMS it could display bad in others CMS or others apps.

Exactly! And also different devices. I think the big culprit is the different pixel densities of the devices.
A font (eg big bold system font) that is perfect on my N7, is useless on my S6 (which has a smaller screen, but higher resolution)
Back to top
View user's profile Send private message
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Thu Jan 21, 2016 11:29 am    Post subject: Reply with quote

Are you sure guys ? Smile
First, there are still TB users on other platforms.
Second - there is a sample how fonts are used on map screen - 4" smartphone on 8" tablet (Android devices).
So if fonts can be used for CMS similar way ... Smile



Tablet_8_vs_smartfon_4_screen.png
 Description:
 Filesize:  169.39 KB
 Viewed:  8265 Time(s)

Tablet_8_vs_smartfon_4_screen.png


Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5664

PostPosted: Thu Jan 21, 2016 3:07 pm    Post subject: Reply with quote

One solution could be new optional attribute to font tag, eg.
Code:
<font name="smallb" system="400108" size="25.7"/>

On MIDP-based platforms, TB would ignore the attribute, on Android (and W10M probably), TB would use to override size to any value. Backward compatible with older TB versions.

The question is which units should be used - in Android, text size can be specified in raw pixels, device-independent (density-independent) pixels or scaled pixels. For CMS, I guess device-independent pixels (or raw pixels? Have to check how bitmap are rendered) makes sense, I think.

Having said that, I just checked it, and unfortunately TB currently sets size in scaled pixels (which somehow respect user preferences set in device configuration). This is the reason why a text in one CMS may appear differently on same devices just with different user preferences Sad And that is why you can change text size in TB CMS by changing user preferences, but that affects other apps.

I'll test device-independent pixels in TB.
Back to top
View user's profile Send private message
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Thu Jan 21, 2016 3:49 pm    Post subject: Reply with quote

For map screen (in Settings, Desktop) we have bar to change OSD font size (it just gives 2 sizes now in And).
Can this bar give us more values and be used to scale CMS fonts too? Same way as line width now works for tracks, etc.
Second, font type can be already set for TB lists. Can the same font type be used as main for CMS ? CMS designer needs only to change it in xml declaration, if would. Means only initial font types/sizes should be declared for CMS fields and will be scaled same way as OSD.
Font size scaling to display is exactly the same problem as ie changing CMS background size to nearest of display size ... Smile
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5664

PostPosted: Thu Jan 21, 2016 5:44 pm    Post subject: Reply with quote

The bar for OSD font size settings has 3 levels..
Back to top
View user's profile Send private message
boowoo



Joined: 12 Jun 2013
Posts: 554
Location: France

PostPosted: Thu Jan 21, 2016 5:56 pm    Post subject: Reply with quote

It's right but the third level work only with tap or long press ...
On android slide action dont work from level 2 to level 3 (small bug) maybe reason why Ranger dont see 3 levels ... Wink
Back to top
View user's profile Send private message
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Thu Jan 21, 2016 7:12 pm    Post subject: Reply with quote

To be correct - I don't use third level, just tried to check Smile
In both devices (4", 8") it was hard to do.
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5664

PostPosted: Fri Jan 22, 2016 11:56 am    Post subject: Reply with quote

Right, it is a bit difficult Neutral I've added some padding to right, should work better, but I could only test it on on very small old Xperia mini Sad

http://www.trekbuddy.net/dev/2016-01-22/trekbuddy.apk
Back to top
View user's profile Send private message
boowoo



Joined: 12 Jun 2013
Posts: 554
Location: France

PostPosted: Fri Jan 22, 2016 12:29 pm    Post subject: Reply with quote

kruch wrote:
I've added some padding to right, should work better

Samsung xCover2 JB 4.1.2 -> fixed Smile
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 1, 2, 3, 4, 5  Next
Page 1 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