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
 
Post new topic   Reply to topic    TrekBuddy Forum Index -> Themes
View previous topic :: View next topic  
Author Message
JNT



Joined: 10 Jan 2009
Posts: 415
Location: Sweden

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

kruch wrote:
... and iterates until it reaches desired font metrics.


Never thought text will require that level of complication... But it seems to work perfectly now. Thanks!

Now of course it begs the question: What fonts are available (accessible)? Wink Cool
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5673

PostPosted: Wed Jan 27, 2016 8:06 pm    Post subject: Reply with quote

Quote:
- "system" fonts also available (but they depend on device, firmware/OS version and god knows what else... try-and-see) in hexa format FFSSZZ (face-style-size):
FF - 40 (proportional), 20 (monospace), 00 (system)
SS - 04 (underlined), 02 (italic), 01 (bold), 00 (plain)
ZZ - 10 (big), 00 (medium), 08 (small)

Example: 200008 is monospace plain small font.


In Android, proportional maps to Typeface.SANS_SERIF, system dtto, and monospace to Typeface.MONOSPACE. Ie. there are just 2 fonts available now.

Typeface: http://developer.android.com/reference/android/graphics/Typeface.html. It does not seem to provide many options...
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 415
Location: Sweden

PostPosted: Wed Jan 27, 2016 8:22 pm    Post subject: Reply with quote

I was really hoping we could somehow access other internal font files... or even place our own font files somewhere to make them accessible.

The link does not work since the "." at the end is included...
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5673

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

JNT wrote:
I was really hoping we could somehow access other internal font files


Maybe; it is just I know practically nothing about fonts in Android. I'm just afraid there really is Sans, Sans-Serif a Monospace only.

http://developer.android.com/reference/android/graphics/Typeface.html

See http://stackoverflow.com/questions/12128331/how-to-change-fontfamily-of-textview-in-android, it seems that built-in are just variants of Sans-Serif.
Back to top
View user's profile Send private message
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Wed Jan 27, 2016 10:40 pm    Post subject: Reply with quote

Fonts can be extended using apps like iFont, even selected as system font in some models (FlipFont) and used in apps, etc.
Try to check Display setting to see what is available. It is not subject specific for one app Smile
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 415
Location: Sweden

PostPosted: Thu Jan 28, 2016 7:11 am    Post subject: Reply with quote

Ranger wrote:
Fonts can be extended using apps like iFont ... It is not subject specific for one app Smile


Thanks for the info. Looks very useful for some use-cases.

I don't really want to change the fonts in my Android installation, since this will really make sharing a CMS that depends on strange fonts quite tricky. I was just hoping there would be a simple Trekbuddy-specific solution. I can certainly happily live with what we have now. Being able to accurately set the size of the system font is really a huge step forward. Very Happy
Back to top
View user's profile Send private message
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Thu Jan 28, 2016 12:43 pm    Post subject: Reply with quote

Sample of using new CMS (Android) scaled fonts feature Smile
Code:
<?xml version="1.0"?>
<cms version="1.0">
<fonts>
<font name="bigb" system="400110" size="128"/>
</fonts>
  <screen mode="full" background="winter.png" w="1280" h="1280">
    <area x="200" y="200" w="800" h="400" font="bigb" align="left">           
      <value>TrekBuddy</value>       
    </area>       
  </screen>
</cms>



System_fonts_CMS_sample.png
 Description:
 Filesize:  167.93 KB
 Viewed:  4169 Time(s)

System_fonts_CMS_sample.png


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


Joined: 02 Jul 2006
Posts: 5673

PostPosted: Thu Jan 28, 2016 1:44 pm    Post subject: Reply with quote

Nice 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 Previous  1, 2, 3, 4, 5
Page 5 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